mirror of
https://github.com/DzzXH/DzzOffice.git
synced 2026-03-01 14:52:43 +08:00
@@ -628,6 +628,11 @@ function isemail($email)
|
||||
return strlen($email) > 6 && strlen($email) <= 32 && preg_match("/^([A-Za-z0-9\-_.+]+)@([A-Za-z0-9\-]+[.][A-Za-z0-9\-.]+)$/", $email);
|
||||
}
|
||||
|
||||
function isphone($phone)
|
||||
{
|
||||
return preg_match("/^1[3456789]\d{9,10}$/", $phone);
|
||||
}
|
||||
|
||||
function quescrypt($questionid, $answer)
|
||||
{
|
||||
return $questionid > 0 && $answer != '' ? substr(md5($answer . md5($questionid)), 16, 8) : '';
|
||||
|
||||
@@ -23,7 +23,9 @@ function uc_user_login($username, $password, $isuid, $checkques = '', $questioni
|
||||
|
||||
} elseif ($isuid == 2) {
|
||||
$user = C::t('user')->fetch_by_email($username);
|
||||
} else {
|
||||
} elseif ($isuid == 3) {//手机号码登录
|
||||
$user = C::t('user')->fetch_by_phone($username);
|
||||
}else {
|
||||
$user = C::t('user')->fetch_by_username($username);
|
||||
}
|
||||
|
||||
@@ -61,6 +63,8 @@ function userlogin($username, $password, $questionid = '', $answer = '', $loginf
|
||||
$return['ucresult'] = uc_user_login($username, $password, 1, 1, $questionid, $answer, $ip);
|
||||
} elseif (isemail($username)) {
|
||||
$return['ucresult'] = uc_user_login($username, $password, 2, 1, $questionid, $answer, $ip);
|
||||
} elseif (isphone($username)) {
|
||||
$return['ucresult'] = uc_user_login($username, $password, 3, 1, $questionid, $answer, $ip);
|
||||
}
|
||||
if ($return['ucresult'][0] <= 0 && $return['ucresult'][0] != -3) {
|
||||
$return['ucresult'] = uc_user_login(addslashes($username), $password, 0, 1, $questionid, $answer, $ip);
|
||||
|
||||
@@ -98,7 +98,7 @@ $lang=array (
|
||||
'other_login' => '其他登录',
|
||||
'qq_login' => 'QQ登录',
|
||||
'automatic_login_within_thirtydays' => '30天内自动登录',
|
||||
'email_username' => '邮箱或用户名',
|
||||
'email_username' => '邮箱、用户名或手机号',
|
||||
'binding_for_account' => '绑定已有账号',
|
||||
'register_new_account_bound' => '注册新账号并绑定',
|
||||
'register_new_account' => '注册新账号',
|
||||
|
||||
Reference in New Issue
Block a user