您现在的位置是:首页 > 教程 > 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注册VIP推荐送现金的方法
ecshop中的促销售功能还不是很完善,随着电子商务系统的发展和进步,越来越多的促销需求需要ecshop做的更灵活,这就造成了很大必要的对ecshop促销系统进行处理和重新开发 -
ecshop订单表结构ecs_order_info说明
CREATE TABLE IF NOT EXISTS `ecs_order_info` ( `order_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '订单详细信息 -
ecshop出现Call to undefined function insert_ads()的解决方法
ECShop Fatal error: Call to undefined function insert_ads() in includes/cls_template.php on line 1157 报错解决方法 -
ecshop商品浏览历史怎么按照先后排序
ecshop本身默认的产品浏览历史(通常在左栏下方,视模板而定)的默认显示顺序是按照商品ID排序。这样似乎用户体验不太好,观察几个大型电商网站
留言与评论 (共有 条评论) |