Monday, 28 March 2011 15:00

Create Joomla! Auto Login after registration Featured

Written by Miguel

 

The user registration process can sometimes be a pain, and visitors are at times not willing to go through the various steps to complete the registration.

Captcha1

The registration process can be made easier by eliminating some of the steps. One such step is the email activation.

Captcha2

The email activation is a secure way to ensure that you are dealing with a human being, and not a script that could result in spam or even compromise your website. You can eliminate the email activation step, and still keep the website secure and avoid spam, by installing a Captcha application to the registration form.

 

Here's how you go about eliminating the email activation step:

  • In your Joomla! website's Global Configuration, under User Settings, Select No for New User Account Activation.
  • Next, edit the file /components/com_user/controller.php as such

Around line 282, comment out the line

$this->setRedirect('index.php', $message);

 

and add the following lines

$usersipass['username'] = $user->get('username');

$usersipass['password'] = $password;

$mainframe->login($usersipass);

$mainframe->redirect( 'index.php' );

 

When the visitor clicks on the submit button, the username and password are automatically filled in and logged in.

 

Furthermore, you can redirect the user to a specific page by editing the line $mainframe->redirect( 'index.php' ); and changing index.php to the page of your choice.

 

e.g. $mainframe->redirect( 'index.php?option=com_content&view=article&id=71&Itemid=39' );

Last modified on Tuesday, 29 March 2011 07:45
Miguel

Miguel

E-mail: This e-mail address is being protected from spambots. You need JavaScript enabled to view it

Add comment



Call Us: +27 11 612 7460