View Full Version : Email as Username

Marina Charalampous
December 11, 2013, 02:15 AM
Hello can I make the email of my user as a username because it's easier to remember his username when is his email.


Kemoid Wilson
December 11, 2013, 08:22 AM
I was thinking some thing similar. Maybe we could use both username/email

December 12, 2013, 06:42 AM
both email and username i think easy to do, maybe im wrong but i think just two places to change

1.includes/classes/rlAccount -> function login

find code

$sql .= "WHERE `T1`.`Username` = '{$username}' AND `T1`.`Status` <> 'trash'";

$GLOBALS['rlHook'] -> load('loginSql', $sql);

change sql line to

$sql .= "WHERE (`T1`.`Username` = '{$username}' OR `T1`.`Mail` = '{$username}') AND `T1`.`Status` <> 'trash'";

2. 1.includes/classes/rlAccount -> function isLogin

find code

$account_password = $this -> getOne('Password', "`Username` = '{$username}' AND `Status` = 'active'", 'accounts');

change to

$account_password = $this -> getOne('Password', "(`Username` = '{$username}' OR `Mail` = '{$username}') AND `Status` = 'active'", 'accounts');

Also to change text maybe to say that you may login also with email.

Login only with email also can be done, but changes are different.
Easiest way without remaking lot of things is to hide username field on registration step, copy email to username field in the database and some other changes and corrections.

April 9, 2017, 08:55 AM
In Both IOS and Android App how can we achieve this

April 10, 2017, 08:31 AM
Hi Errol,

In 4.5.x version of the software we've added option "Users sign in with" with similar functional.
Now if admin select "Email" in this, users can use Email or Username.