2016-12-24, 04:58 AM
Hi
I need the users can be loged with the username or with a phone number
I added the column "phone" in mybb_users table
But in PHP How can i do?
Can I use the loginhandler class?
Or is better idea, get the username with the phone
I need the users can be loged with the username or with a phone number
I added the column "phone" in mybb_users table
But in PHP How can i do?
Can I use the loginhandler class?
Or is better idea, get the username with the phone
$query = $db->simple_select("users", "username", "phone = '{$phone}'", array('limit' => 1));
$usuario=$db->fetch_field($query, 'username');
$plugins->run_hooks("member_do_login_start");
// Is a fatal call if user has had too many tries
$errors = array();
$logins = login_attempt_check();
require_once "./../../../interactu.wio.mx/public_html/inc/datahandlers/login.php";
$loginhandler = new LoginDataHandler("get");
$user = array(
'username' => $usuario,
'password' => $password,
'remember' => "yes",
'imagestring' => ""
);
$user_loginattempts = get_user_by_username($user['username'], array('fields' => 'loginattempts'));
$user['loginattempts'] = (int)$user_loginattempts['loginattempts'];
$loginhandler->set_data($user);
$validated = $loginhandler->validate_login();
Best regards