您现在的位置是:首页 > 教程 > ecshop商城教程ecshop商城教程
ecshop用户名,手机号,email同步登陆的实现方法
靖柏2023-10-21 16:17:10ecshop商城教程已有人查阅
导读该ECSHOP插件仅适用于没有做过任何平台整合的ECSHOP网站;includes/modules/integrates/ecshop.php
该ECSHOP插件仅适用于没有做过任何平台整合的ECSHOP网站
修改文件:
1、includes/modules/integrates/ecshop.php
找到
修改文件:
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后台打印订单修改电话、地址、信息等信息的方法
整理下关于ecshop后台订单的一些小修改1、去除“订单列表”的TEL和[]字样,因为这个不方便打印: -
ecshop调用指定文章分类及调用指定商品分类商品的方法
ecshop数据调用分好几种, 种是js调用,利用后台生成js代码调用相应的产品,js调用的好处就是方便实用,一句话就可以完成调用,而且可以跨站调用,有利于推广。 -
ecshop后台拿shell的方法
ecshop后台拿shell总结 ecshop拿shell一、系统==>数据库管理==>sql查询(可爆出物理路径):二、前台留个言,内容是我们的一句话木马: 接着在后台系统==>数据库管理==>数据备份==>选择自定义备份 -
ecshop商品页面增加上一个商品下一个商品商品名称
ecshop商品页面增加上一个商品下一个商品商品名称,第一步:修改 goods.php 文件找到下面这段代码
留言与评论 (共有 条评论) |