Go to the Kirby panel and create a “Login” page. Once done, create a second “Account” page. Subpages will be automatically added.
use
Use
To enjoy the links, just add this code in your menu:
(…)
Config
Set the language to be used.
c :: set (‘membership.language’, ‘en’);
Changelog
0.1
Requirements
Kirby 2.3+
Warning
This plugin is provided “as is” without warranty. Use it at your own risk and always test it before use in a production environment. If you encounter problems, please create a new issue.
Licence
CC-BY-NC-SA - Creative Commons
Credits
Mailgun for the emails template.
This post on the forum that allowed the quick development of this plugin.
This plugin could really help me, but I get an error when I install it.
I have followed every steps : renaming the folder to “membership”, put the folder into site/plugins/, and create the two pages with their respective names.
This is what the error says : Undefined variable: kirby in /Applications/MAMP/htdocs/membership/site/plugins/membership/membership.php on line 26
I already have an admin account into the folder accounts so I don’t understand…Could someone reproduce this error with a basic starterkit and installing this plugin ?
Ok, so if anyone can reproduce it, it comes from me.
I started from a new kirby 2.5.8, and have a new error
Call to a member function isOpen() on boolean from this line : <li><a<?php e($pages->find('account')->isOpen(), ' class="active"') ?> href="<?= url('account') ?>">Account</a></li>
What do you mean exactly by "Create a login template with a template login" and same this account ?
I have created two folders : 5-Login and 6-Account, inside them a .txt file with login.txt and account.txt, and in the templates folder, I did a double copy-paste of default template and renamed them account.php and login.php…
Yes tank you both, for you screenshots and your explanations. It’s working very well now !
Just two things :
In local, when I want to register, the email can’t be send (I think it’s normal…). So I tested on server, the mail is sended, but is there a way to avoid this on local ?
On server, when I want to login, firefox said Firefox has detected that the server is redirecting the request for this address in a way that will not succeed. The cause of this problem may be the disabling or refusal of cookies.
This is maybe due to my Firefox settings, I don’t allow to save history. Is there a way to avoid it too ?
The cookie is set by the Kirby user login method which is needed to store the session data.
Do you mean prevent trying to send an email when on localhost? Guess you can check if you are on localhost and either send the email or not in register.php
About the first point, forget it. I didn’t remember that we can’t send email via localhost.
About the cookies, it’s quite embarassing to not be able to enter into the login page because, this is the goal of this plugin !
I tested with Safari/Firefox/Chrome, and all browsers get an error when entering the “login” page, on server and on local.
I suspect that’s because the site is in a sub-folder, maybe due to some htaccess settings or something else…
I get ane error on your site as well, saying that there are too many redirects. I only tested the plugin on my localhost and there I can access the login page without any problems. Nevertheless, there seem to be some errors with snippets not getting the right variables… but that is on another page.