Home >Backend Development >PHP Tutorial >Discuz X32 enables mobile phone number login
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'");
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.