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
  • 相关阅读:
    ios自动布局
    Android真机调试流程
    Window phone应用中的多触点手势解读以及toolKit.dll和Microsoft.Phone.dll 冲突问题
    软件质量可视化与软件测试
    软件测试中不可忽视的 Warning
    软件测试作业1 -- 关于c++项目中类相互调用的问题与解决
    软件测试 总结
    系统测试,集成测试,单元测试的联系与区别
    白盒测试
    关于UI测试的一些实例操作
  • 原文地址:https://www.cnblogs.com/wangblognet/p/2728022.html
Copyright © 2011-2022 走看看