Jump to content

FrontendLoginRegister - A configurable module for fast implementation of an user management system based on FrontendForms


Juergen
 Share

Recommended Posts

A module for ProcessWire CMS to integrate a user registration/login functionality based on the FrontendForms module. This module creates pages and templates during the installation for faster development.

The intention for the development of such a module was to provide a ready-to-use solution for user management, which can be installed and put into operation in a few minutes.

It works out of the box, but it provides a lot of configuration settings in the backend:

module-config.thumb.jpg.a85ccb0b15d57604403c399b32a31c0a.jpg

Highlights

  • "One-click" integration of an user login/registration system without the hazzle of creating all pages and forms by hand
  • "One-click" switch between login or login and registration option
  • Double opt-in with activation link on new registrations
  • Option for automatic sending of reminder mails, if account activation is still pending
  • Option for automatic deletion of unverified accounts after a certain time to prevent unused accounts
  • Option to use TFA-Email if installed for higher security on login
  • Mutli-language
  • Select if you want to login with username and password or email and password
  • Select the desired roles for newly created users
  • Select, which fields of the user template should be displayed on the registration and profile form (beside the mandatory fields). Fields and order can be changed via drag and drop functionality
  • Offer users the possibility to delete their account in the members area using a deletion link with time expiration
  • Customize the texts of the emails which will be send by this module
  • Usage of all the benefits of FrontendForms (fe. CAPTCHA, various security settings,...)
  • Support for SeoMaestro if installed
  • Lock accounts if suspicious login attempts were made
  • Support of Ajax form submission

This module runs on top of the FrontendForms module, so please download and install this module first.

UPDATE 03.11.2023: The module is now available inside the Processwire modules directory: Frontendloginregister

This module is early Beta stage, so please do not use it on live sites at the moment.

If you discover any issues, please report them directly on GitHub ?. Thanks!

Edited by Juergen
Link to module directory added
  • Like 15
  • Thanks 4
Link to comment
Share on other sites

  • Juergen changed the title to FrontendLoginRegister - A configurable module for fast implementation of an user management system based on FrontendForms
  • 3 weeks later...

The custom user fields will be taken from the user template and mapped to the FrontendForms class. So PW fields will be re-written to FrontendForm fields.

Take a look at https://github.com/juergenweb/FrontendLoginRegister#support-for-custom-user-fields

Some of the values as set in the PW fields will be added to the FrontendForm fields too.

Example: If you take the PW password field and you have set the requirements to at least "1 letter and 1 digit", this requirement will also be used in the Frontendforms input field for the password on the frontend.

Validation will only be taken by FrontendForms.

Does this answer your question?

  • Like 3
Link to comment
Share on other sites

Hi Andy,

Maybe you are thinking of profile images?

I have thought about it, but my experience in the the past has shown me, that users do not upload profile images.

A few years ago I have created a user registration with the opportunity to upload a profile image, but no one has used it... so I dont think so, because it would only make sense if you can manipulate (crop, position,..) the image after the upload to get the best fit for the image. This is very complex to implement.

Best regards

  • Like 1
Link to comment
Share on other sites

@Juergen

Thank you for your reply.

How much you need to add avatar images to your profile depends on the format of your project. In my projects, this is a fairly common feature. I use LoginRegisterPro, which @ryan suggests. There, adding an image doesn't give you any image editing functionality. But you don't really need it either, as there are a lot of image editing programs on the fly right now.

Link to comment
Share on other sites

@Andy I will probably thinking over to add this feature (support for image upload). Technically, uploading an image without image manipulation should not be a problem in this case. At the moment I am quite busy on creating a new module for a contact form based on FrontendForms, but if I have more time left, I will probably give this feature a chance.

Best regards

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

Version 1.2.3 is ready!

PLEASE DEINSTALL THE OLD VERSION OF FRONTENDLOGINEGISTER AND UPGRADE FRONTENDFORMS TO THE LATEST VERSION BEFORE, BECAUSE THERE ARE A LOT OF CHANGES AND NEW FEATURES!! OTHERWISE YOU WILL GET ERRORS!

Beside fixing a lot of bugs, this new version supports upload for an user image too.

Supported Fieldtypes for images are FieldtypeImage and FieldtypeCroppableImage3.

Please note: You can only use ProcessWire image fields with single upload - multi-upload fields will be ignored and cannot be selected. So if you want to use an existing image field or you need to create a new one, take care to set the image upload only to 1 single file.

After you have added this field to the user template, you can select this field inside the module configuration and add it to the profile form and/or to the registration form. Take also care that this field is editable by the user, otherwise it will also not be selectable.

Just to mention: Technically you can add as many image fields as you want to these 2 forms, but it would not make sense, because each user needs only one image. But if you want.... you can.

There were a lot of changements taken, so please let me know if you discover issues.

Best regards

  • Like 2
  • Thanks 2
Link to comment
Share on other sites

  • 4 months later...

Version 1.2.5 is out!!

This version now supports Ajax form submission, which can be enabled in the backend configuration. In order to use it, you have to update FrontendForms to version 1.2.47 first, which includes all changes to support Ajax form submission.

You can read more about this new feature in the FrontendForms forum.

Best regards

Link to comment
Share on other sites

The first version of FrontendLoginRegister was released a long time ago, and the module in its latest version (2.1.8) is now available in the Processwire modules directory.

After a long development period, I have decided to add this module to the modules' directory. This will make it much easier to update the module in the future, and I hope that a larger community will test the module and report problems.

The module has BETA status. I have tested it and have not found any problems, so it should work as expected (but I probably cannot test all possible scenarios). Therefore, I would be happy if many people would test the module and help me to reach the stable status after a while.

Best regards

  • Like 4
  • Thanks 1
Link to comment
Share on other sites

  • 1 month later...
  • 4 weeks later...

Hello @Juergen – Thank you for developing this great module. It looks like the outgoing emails from this module cannot use WireMail() custom modules though. It is possible to make it work with custom WireMail module. I am specifically using WireMailPostmark for all outgoing emails. Thank you!

Link to comment
Share on other sites

Hello @mayks

 I have installed the module and I have sent 2 mails with it (I have clicked the "Password forgotten" link to send me a mail, where I can change my password). From the statistic data, it seems to work (only the "Sent" will be displayed, but I guess this is because I have the trial plan).

image.thumb.png.87c0c929c49e7599bcf72d56fd12371a.png

I have tested it only on the "Password forgotten" page, but at the first sight, it seems that only the mail object instantiation is a little bit different than like the WireMail, but all other methods are equal.

I cannot promise at 100% that I will implement it and if so I do not know when I will find the time (not today and not tomorrow), but it seems not to be so complicated.

I did not know this module or this mail service before and personally I will not use it, because I do not want to pay for it, but it could be interesting for users, who want a statistic.

My idea: If I implement it, I would add a Select option inside the module configuration with the options "WireMail" and "Postmark", so you can select, which kind you want to use.

Best regards Jürgen

 

Link to comment
Share on other sites

46 minutes ago, Juergen said:

Hello @mayks

 I have installed the module and I have sent 2 mails with it (I have clicked the "Password forgotten" link to send me a mail, where I can change my password). From the statistic data, it seems to work (only the "Sent" will be displayed, but I guess this is because I have the trial plan).

image.thumb.png.87c0c929c49e7599bcf72d56fd12371a.png

I have tested it only on the "Password forgotten" page, but at the first sight, it seems that only the mail object instantiation is a little bit different than like the WireMail, but all other methods are equal.

I cannot promise at 100% that I will implement it and if so I do not know when I will find the time (not today and not tomorrow), but it seems not to be so complicated.

I did not know this module or this mail service before and personally I will not use it, because I do not want to pay for it, but it could be interesting for users, who want a statistic.

My idea: If I implement it, I would add a Select option inside the module configuration with the options "WireMail" and "Postmark", so you can select, which kind you want to use.

Best regards Jürgen

 

Huh, strange.. I tried on "Forgot Login data" page and it never managed to send out the emails through Postmark. To be clear, I do not specifically ask for it to work with Postmark, but any other WireMail modules (eg. SMTP, Mailgun, Gmail, etc.)

So to clarify, were you able to send the two mails without making adjustments to the module or did you actually have to make changes to the code?

Link to comment
Share on other sites

No, I mean I have tested it locally on Xampp after adding some code to the "Password forgotten" page only for testing purposes. The version on GitHub is not updated!!

Sorry, this was a little bit confusing written by me.

Link to comment
Share on other sites

Version 1.3.0 ist out!

This version supports mail sending with Postmark mail sending service.

Read the full changelog.md for more information about Postmark and what has been changed.

If you have one of the Postmark modules as mentioned in the changelog installed, you will find a new configuration field inside the module configuration.

postmark.thumb.jpg.cf86da38e2a3edd27fb268273662bf1f.jpg

Here you can select if you want to send your mails with Postmark or not. Selecting "none" means using the default WireMail class for sending mails.

In order to work properly, you will need at least FrontendForms 2.1.57 installed (as mentiond in the changelog.md).

As always, this is Beta-status, so please take care that everything works as expected.

Happy testing! ?

Jürgen

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Nevermind @mayks!

I hope it works as expected, because I do not use Postmark and therefore I have only tested the base function (sending process). Please take care that only 1 external mail module is installed, otherwise you will run into problems, but this is not a module related issue, it is an PW issue. In this case PW takes always the first external module in line and ignores all others (independent of you settings inside this module config).

  • Thanks 1
Link to comment
Share on other sites

  • 4 months later...

Hi @Juergen, I gave a look at the module, but came across a few issues (the biggest one would be that after submitting, nothing really happened?). I am testing the module locally, on Processwire 3.0.229; PHP 8.2.0. I am a wondering what could have been missed during the installation?

  • I seem to have all the module requirements
  • I've got this error during installing the module via directory "Integrity constraint violation: 1062 Duplicate entry 'fl_registerpage' for key 'name'", which didn't show after submitting the module
  • You mentioned that 10 templates and pages will be created (with those names fl_activationpage,...), no new template or page has been added to my site, could it be because of the previous error?
  • The 8 new fields for the user have been added successfully 

 

For this basic use of $modules->get('FrontendLoginRegister')->LoginPage(); I have got an error related to the main FrontendForms module.

$login = $modules->get('FrontendLoginRegister')->LoginPage();
$login->setPrependBody(true);
echo $login->render();

$register = $modules->get('FrontendLoginRegister')->RegisterPage();
$register->setPrependBody(true);
echo $register->render();

The corresponding error:

Quote

Look out… Fatal Error: Uncaught TypeError: FrontendForms\Link::setLinkText(): Argument #1 ($linktext) must be of type string, null given, called in site/modules/FrontendForms/Formelements/Textelements/Link.php on line 71 and defined in site/modules/FrontendForms/Formelements/Textelements/Link.php:55

#0 site/modules/FrontendForms/Formelements/Textelements/Link.php (71): FrontendForms\Link->setLinkText(NULL)
#1 site/modules/FrontendLoginRegister/pages/LoginPage.php (98): FrontendForms\Link->setPageLink(Object(NullPage))
#2 wire/core/Wire.php (413): FrontendLoginRegister\LoginPage->___passwordForgottenLink()
#3 wire/core/WireHooks.php (968): Wire->_callMethod('___passwordForg...', Array)
#4 wire/core/Wire.php (484): WireHooks->runHooks(Object(FrontendLoginRegister\LoginPage), 'passwordForgott...', Array)
#5 site/modules/FrontendLoginRegister/pages/LoginPage.php (410): Wire->__call('passwordForgott...', Array)
#6 site/templates/og_login.php (92): FrontendLoginRegister\LoginPage->render()
#7 wire/core/TemplateFile.php (328): require('/Users/mariemad...')
#8 wire/core/Wire.php (413): TemplateFile->___render()
#9 wire/core/WireHooks.php (968): Wire->_callMethod('___render', Array)
#10 wire/core/Wire.php (484): WireHooks->runHooks(Object(TemplateFile), 'render', Array)
#11 wire/modules/PageRender.module (574): Wire->__call('render', Array)
#12 wire/core/Wire.php (416): PageRender->___renderPage(Object(HookEvent))
#13 wire/core/WireHooks.php (968): Wire->_callMethod('___renderPage', Array)
#14 wire/core/Wire.php (484): WireHooks->runHooks(Object(PageRender), 'renderPage', Array)
#15 wire/core/WireHooks.php (1094): Wire->__call('renderPage', Array)
#16 wire/core/Wire.php (484): WireHooks->runHooks(Object(Page), 'render', Array)
#17 wire/modules/Process/ProcessPageView.module (184): Wire->__call('render', Array)
#18 wire/modules/Process/ProcessPageView.module (114): ProcessPageView->renderPage(Object(Page), Object(PagesRequest))
#19 wire/core/Wire.php (416): ProcessPageView->___execute(true)
#20 wire/core/WireHooks.php (968): Wire->_callMethod('___execute', Array)
#21 wire/core/Wire.php (484): WireHooks->runHooks(Object(ProcessPageView), 'execute', Array)
#22 index.php (55): Wire->__call('execute', Array)
#23 {main}
thrown (line 55 of site/modules/FrontendForms/Formelements/Textelements/Link.php)

This error message was shown because: site is in debug mode. ($config->debug = true; => site/config.php). Error has been logged.

I would be more than happy to receive some help on how to properly install it and use it, thanks in advance !

Link to comment
Share on other sites

Hello @marie.mdna

I am sorry that the module installation does not work as expected in your case. It seems that there has been something going wrong. I have installed the module on my localhost without problems.

What I can say for sure, is that all the error messages that you have mentioned are caused by the missing installation of the templates. For me it seems that you had troubles during a first installation attempt, and then you have tried to install it once more.

19 minutes ago, marie.mdna said:

"Integrity constraint violation: 1062 Duplicate entry 'fl_registerpage' for key 'name'"

This is a typical error message if an entry with the name "fl_registerpage" is still present in the database at the moment during you have tried to install the module again. So it must have been stored during a previous attempt to install the module. This entry in the database is the "root cause" for your problem.

I do not know the reason during the first module installation in your case, but you have to try to deinstall AND DELETE the module once more, to keep no orphans of the module inside the filesystem and inside the database. If the database is not "free" of FrontendLoginRegister entries, you will always get this or another error.

So please try first to deinstall and delete the module the normal way. If it does not work, you have to go to directly to the database and delete the entries there. 

The sql error mentioned above results from an entry inside the table "templates" inside the database.

Please try the deinstallation and the deletion of the module first and then download and install the module once more. Let me know if the problem persists. 

Do you have the possibility to go into the database (fe. with phpmyadmin)?

Best regards

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...