zoukankan      html  css  js  c++  java
  • ecshop商城用户名和邮箱都能登陆方法

    修改方法:/includes/modules/integrates/integrate.php文件约145– 162行的用户登入函数.如下

        function login($username, $password, $remember = null)
        {
            if ($this->check_user($username, $password) > 0)
            {
                if ($this->need_sync)
                {
                    $this->sync($username,$password);
                }
                $this->set_session($username);
                $this->set_cookie($username, $remember);

                return true;
            }
            else
            {
                return false;
            }
        }

    修改为:

      function login($username, $password, $remember = null)
         {

             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;
    }
             if ($this->check_user($username, $password) > 0)
             {
                 if ($this->need_sync)
                 {
                     $this->sync($username,$password);
                 }
                 $this->set_session($username);
                 $this->set_cookie($username, $remember);

                 return true;
             }
             else
             {
                 return false;
             }
         }

    ------------------------------------------华丽丽的分割线--------------------- ------------------------------------

    源厂制造10-10000级洁净无尘车间防静电防尘用品!网址:http://www.lgfjd.com 微信号:614412
  • 相关阅读:
    cisco/CCNA思科静态路由配置(附PKA文件)
    Web前端常用词汇大全
    解决Linux无法安装pygame问题
    CC2530常用的控制寄存器
    解决MySQL外键约束中的引用列和引用列不兼容问题
    详解使用Hyper-V安装Ubuntu Server 16.10
    虚拟机VMware下CentOS6.6安装教程图文详解
    word论文排版技法之五——标题样式关联多级列表
    如何写《软件需求规格说明书》
    VisualStudio官网使用教程
  • 原文地址:https://www.cnblogs.com/wangblognet/p/2728022.html
Copyright © 2011-2022 走看看