為了獲取更多最新內(nèi)容及功能更新,請直接訪問我們的首頁以查看DzzOffice筆記的最新地址。
擴展現(xiàn)有Dzz登錄功能,以便支持使用系統(tǒng)手機號進行登錄。
文件:core/function/function_core.php在
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);
}
文件:user/function/function_user.php在
elseif ($isuid == 2) {
$user = C::t('user')->fetch_by_email($username);
}
后添加
elseif ($isuid == 3) {//手機號碼登錄
$user = C::t('user')->fetch_by_phone($username);
}
在
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);
}
文件:user/language/zh-cn/lang.php將
'email_username' => '郵箱或用戶名',
修改為
'email_username' => '郵箱、用戶名或手機號',
系統(tǒng)手機號需由管理員在機構(gòu)用戶中進行設(shè)置,不是用戶個人資料中的手機號。
更多建議: