Home >Backend Development >PHP Tutorial >Discuz X32 enables mobile phone number login

Discuz X32 enables mobile phone number login

WBOY
WBOYOriginal
2016-07-28 08:27:301310browse

1. It is very simple to implement mobile phone number login

Add mobile fields to the pre_common_member and pre_ucenter_members tables

I found that the login call is the uc_user_login interface method of UC. This method is in the uc_client/client.php file,

then track it , find the onlogin() method in the controller folder uc_client/control/user.php,

Continue to track and find the get_user_by_username method in the model file uc_client/model/user.php, and modify

$arr = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."members WHERE username='$username' ");
to:
$arr = $this->db->fetch_first("SELECT * FROM ".UC_DBTABLEPRE."members WHERE username='$username' or mobile='$username'");

Done! ! !

The above introduces the implementation of mobile phone number login with Discuz X32, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn