支持系統(tǒng)手機號登錄系統(tǒng)

2024-07-17 23:49 更新

為了獲取更多最新內(nèi)容及功能更新,請直接訪問我們的首頁以查看DzzOffice筆記的最新地址。

介紹

擴展現(xiàn)有Dzz登錄功能,以便支持使用系統(tǒng)手機號進行登錄。

實現(xiàn)方法

文件: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è)置,不是用戶個人資料中的手機號。



以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號