zoukankan      html  css  js  c++  java
  • 让ecshop用户名、手机号、email登陆方法

    让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'";
     
  • 相关阅读:
    C++ VC实现对话框窗口任意分割
    C++ 关于滚动条的滚动问题
    C++ 自定义控件的移植(将在其它程序中设计的自定义控件,移植到现在的系统中)
    C++ 动态创建按钮及 按钮的消息响应
    C++ Custom Control控件 向父窗体发送对应的消息
    C++ MFC 改变控件大小和位置
    C++ 使用VS2010创建MFC ActiveX工程项目
    VC++ 自定义控件的建立及使用方法
    C++ CTreeview的checkbox使用方法
    C++ vc中怎么使用SendMessage自定义消息函数
  • 原文地址:https://www.cnblogs.com/myhappylife/p/4884991.html
Copyright © 2011-2022 走看看