Print Thread
Email Login Tutorial
Using an email address as an substitute in PHP-Fusion is both more secure and promotes anti-spam capabilities in comparison to the default username login.

As a pre-warning, if you decide to make the modifications, you will not be able to login with your username, you, along with all your websites members, will need to login using their email.

This tutorial was developed using PHP-Fusion v7.02.06. It can become backwards compatible if one knows where to edit/replace via earlier versions.

Let's get started!


Edit the Authenticate Class: includes/classes/Authenticate.class.php

Around line 41 -


Download source  Code
$result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_name='".$inputUserName."' LIMIT 1");


Download source  Code
$result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_email='".$inputUserName."' LIMIT 1");

Now all one needs to do is edit instances where the user would normally use the field UserName such as the user login panel - Change UserName to Email so as to not confuse the member to which to use.
With this code you can use both Nickname or Emailadress
Download source  Code
$result = dbquery("   SELECT * FROM ".DB_USERS." WHERE user_name='".$inputUserName."' || user_email='".$inputUserName."' LIMIT 1");

Jump to Forum: