关于让ecshop用户名、手机号、email登陆方法
2016-09-11 20:39 来源:www.chinab4c.com 作者:ecshop专家
让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'";
 
        
					
						
                          
					
				 
      
      最近更新
常用插件
- ecshop2.7.1邮件发送插件
                                  ecshop2.7.1邮件发送插件:该插件主要的开发思想是源于ecshop短信发送系统... 
- ecshop没登陆情况下订单查
                                  ecshop没登陆情况下订单查询插件,主要是针对ecshop在没有登陆的情况下... 
- ecshop最小购买数量控制插
                                  ecshop最小购买数量控制插件,这个插件主要是为我们提供一个十分方便... 
- ecshop2.7.2生成虚拟订单2.
                                  以前我们开发过ecshop下的虚拟订单,就是客户在访问的时候,会自动生... 
- ecshop二次开发商品购买增
                                  图片1香... 
ecshop热门问答
ecshop热门资料
          
               
            ecshop我的资料 
                
            ecshop显示价格 
                
            ecshop绑定 
                
            邮件密码 
                
            ecshopopening 
                
            ecmall匿名购 
                
            ecshopecs_goods 
                
            ecshop货物 
                
            ecshop名牌 
                
            ecshopLength 
                
            ec和dz同步登陆 
                
            ecshopselected 
                
            ecshop淘宝开店 
                
            修改评论 
                
            ecshop可视化 
                
            ecshop限制购买 
                
            ecshopConnect 
                
            ecshop宽屏 
                
            ecshop产品模板 
                
            ecshop遮住了 
                
            ecshop会员中心显 
                
            ecshop详细信息 
                
            ecshop二级分类图标 
                
            ecshophttp 
                
            ecshopkeyword 
                
            ecshop最好 
                
            ecshop上传照片 
                
            ecshopchina 
                
            ecshopEC无法注册会员 
                
            ecshop淘宝店 
             
        
      


