讓ecshop使用者名稱、手機號、email登陸方法

來源:互聯網
上載者:User

標籤:

讓ecshop使用者名稱、手機號、email登陸方法, 僅適用於沒有做過任何平台整合的ECSHOP網站

 修改檔案: 1、includes/modules/integrates/ecshop.php $this->field_email = ‘email‘; 在以上代碼下面增加 $this->field_phone = ‘mobile_phone‘; ===================================================================== 找到    function check_user($username, $password = null)  這個下面的 $sql = "SELECT " . $this->field_id .                   " FROM " . $this->table($this->user_table).                   " WHERE " . $this->field_name . "=‘" . $post_username . "‘"; 修改為 $sql = "SELECT " . $this->field_id .                   " FROM " . $this->table($this->user_table).                   " WHERE " . $this->field_name . "=‘" . $post_username . "‘ or " . $this->field_phone . "=‘" . $post_username . "‘ or " . $this->field_email . "=‘" . $post_username . "‘";  再找到 $sql = "SELECT user_id, password, salt,ec_salt " .                   " FROM " . $this->table($this->user_table).                   " WHERE user_name=‘$post_username‘"; 修改為 $sql = "SELECT user_id, password, salt,ec_salt " .                   " FROM " . $this->table($this->user_table).                   " WHERE user_name=‘$post_username‘ or mobile_phone=‘$post_username‘ or email=‘$post_username‘";  2、includes/modules/integrates/integrate.php 找到     /* 會員郵箱的欄位名 */    var $field_email    = ‘‘; 在下面增加     /* 會員手機的欄位名 */    var $field_phone    = ‘‘;  找到 function login($username, $password, $remember = null) 下面的    if ($this->need_sync)   {          $this->sync($username,$password);   } 在上面增加    $sql = "SELECT " . $this->field_name .               " FROM " . $this->table($this->user_table).               " WHERE " . $this->field_phone . " = ‘$username‘ or " . $this->field_name . " = ‘$username‘ or " . $this->field_email . " = ‘$username‘";   $username = $this->db->getOne($sql, true);  找到 function check_user($username, $password = null) 下面的    $sql = "SELECT " . $this->field_id .                   " FROM " . $this->table($this->user_table).                   " WHERE " . $this->field_name . "=‘" . $post_username . "‘"; 修改為    $sql = "SELECT " . $this->field_id .                   " FROM " . $this->table($this->user_table).                   " WHERE " . $this->field_name . "=‘" . $post_username . "‘ or " . $this->field_phone . "=‘" . $post_username . "‘ or " . $this->field_email . "=‘" . $post_username . "‘";  找到    $sql = "SELECT " . $this->field_id .                   " FROM " . $this->table($this->user_table).                   " WHERE " . $this->field_name . "=‘" . $post_username . "‘ AND " . $this->field_pass . " =‘" . $this->compile_password(array(‘password‘=>$password)) . "‘";  修改為    $sql = "SELECT " . $this->field_id .                   " FROM " . $this->table($this->user_table).                   " WHERE (" . $this->field_name . "=‘" . $post_username . "‘ or " . $this->field_phone . "=‘" . $post_username . "‘ or " . $this->field_email . "=‘" . $post_username . "‘) AND " . $this->field_pass . " =‘" . $this->compile_password(array(‘password‘=>$password)) . "‘";  再找到 function sync ($username, $password=‘‘, $md5password=‘‘)  下面的    $sql = "SELECT user_name, email, password, sex, birthday".               " FROM " . $GLOBALS[‘ecs‘]->table(‘users‘).               " WHERE user_name = ‘$username‘"; 修改為    $sql = "SELECT user_name, email, password, sex, birthday".               " FROM " . $GLOBALS[‘ecs‘]->table(‘users‘).               " WHERE user_name = ‘$username‘ or mobile_phone = ‘$username‘ or email = ‘$username‘";

讓ecshop使用者名稱、手機號、email登陸方法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.