爱吾下载 - 努力做内容最丰富最安全的下载站!

爱吾下载站

当前位置:爱吾下载 > 源码技巧 > Ecshop > Ecshop二次改造实现用户名或Email都能登陆

Ecshop二次改造实现用户名或Email都能登陆

发表时间:2015-11-04 11:34作者:fang人气:更新时间:2025-10-06 23:14:20

相信很多使用ECSHOP的朋友都想要这个功能,网上也有很多类似的修改教程。

下面说一下我的方法,也比较简单,已在ECSHOP2.7.2版测试通过。

打开 /includes/modules/integrates/integrate.php 文件。

找到

if ($this->check_user($username, $password) > 0)

在它上面添加下面代码段

if(is_email($username))

{

$sql = "select ".$this->field_name." from ".$this->table($this->user_table)." where ".$this->field_email."='".$username."'";

$username = $this->db->getOne($sql);

if(!$username) return false;

}

是不是挺简单的。

其他版本的ECSHOP,站长没有亲自测试,相信也可以用此方法来解决。

标签Ecshop,二次,改造,现用,户名,Email,都能,登陆

相关下载

查看所有评论+

网友评论

网友
您的评论需要经过审核才能显示

公众号