邮箱登录

a.找到function login(){} ,增加一个邮箱判断is_mail()  ,

b.如果通过,增读取出username ,

c.再通过默认的login功能

1.需要修改文件include/modules/integrates/integrate.php

原代码 第145行

function login($username, $password, $remember = null)
{ if ($this->check_user($username, $password) > )
{
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(is_telephone($username)){
$sql = "select ".$this->field_name." from ".$this->table($this->user_table)." where mobile_phone ='".$username."'";
$username = $this->db->getOne($sql);
if(!$username) return false;
} if ($this->check_user($username, $password) > )
{
if ($this->need_sync)
{
$this->sync($username,$password);
}
$this->set_session($username);
$this->set_cookie($username, $remember); return true;
}
else
{
return false;
}
}

2.include/lib_common.php 增加手机判断格式  第40行

function is_telephone($phone){
$chars = "/^13[0-9]{1}[0-9]{8}$|15[0-9]{1}[0-9]{8}$|18[0-9]{1}[0-9]{8}$/";
if(preg_match($chars, $phone)){
return true;
}else{
return false;
}
}

ecshop登录的更多相关文章

  1. 删除ecshop登录后台看到的系统信息

    登陆ecshop后台,默认打开在页面顶部会出现个系统信息,显示操作系统,数据库版本,以及安装日期系统版本号.部分客户问到怎么删除,这里最模板提供ecshop教程告诉大家方法. 找到admin\temp ...

  2. phpwind ecshop 用户整合

    phpwind ecshop 用户整合,其实很简单.但在网上搜到的尽是乱七八遭的方法,搞得很复杂. 原来公司做的phpwind 与 ecshop 结合的项目,别的同事已经把用户整合好了,当时我还不知道 ...

  3. ecshop 除去版权信息

    ECSHOP 2.73彻底去版权的方法 前台部分: 1. 去掉头部TITLE “- Powered by ecshop” 后者打开includes/lib_main.php $page_title = ...

  4. UCENTER同步登录工作原理和配置要点

    ucenter的同步登录原理: 1)Ucenter是和uc_client同步的.每个PHP应用,加入了UCENTER后,都会在主目录下有个UC_CLIENT目录.这个目录里,都有一个client.PH ...

  5. 自动化测试-19.selenium定位之通过JS修改html写入日期数据以及从文本读取数据实战

    # -*- coding: utf-8 -*- from selenium import webdriver from selenium.webdriver.support.select import ...

  6. Selenium(4)

    练习1:使用selenium+firefox测试ecshop登录过程 一.WebDriver 1.启动浏览器 (1)启动Firefox浏览器 a.启动默认路径下的浏览器 WebDriver drive ...

  7. 『心善渊』Selenium3.0基础 — 29、使用HTMLTestRunner生成unittest的HTML报告

    目录 1.HTMLTestRunner介绍 2.HTMLTestRunner的使用 3.测试报告示例 4.封装成模块 1.HTMLTestRunner介绍 HTMLTestRunner是一个基于uni ...

  8. ECshop 快捷登录插件 支持QQ 支付宝 微博

    亲自测试可以使用,分享给大家.(承接各种EcShop改版,二次开发等相关项目 QQ:377898650) 安装的时候按照里面说明.安装即可. 代码下载:http://pan.baidu.com/s/1 ...

  9. ECSHOP会员登录后直接进用户中心

    ECSHOP系统在会员登录成功后,不是直接进入用户中心,而是跳转回了上一个页面或者是跳转到了首页. 注意:这里说的是,用户没有主动点击前往哪个页面,让系统自动跳转. 那如何让会员登录成功后自动进入“用 ...

随机推荐

  1. spoj687 后缀数组重复次数最多的连续重复子串

    REPEATS - Repeats no tags  A string s is called an (k,l)-repeat if s is obtained by concatenating k& ...

  2. sql-truncate,delete,drop删除表数据的区别

    TRUNCATE TABLE 删除表中的所有行,而不记录单个行删除操作. 语法 TRUNCATE TABLE name 参数 name 是要截断的表的名称或要删除其全部行的表的名称. 注释 TRUNC ...

  3. 字符串String: 常量池

    2.1          String类 String是不可变类, 即一旦一个String对象被创建, 包含在这个对象中的字符序列是不可改变的, 直至该对象被销毁. String类是final类,不能 ...

  4. HTTP之referer(网上搜集)

    1.打开httpfox抓包插件,在百度中搜索126.com,搜索项中点击网站入口,通过抓包工具,查看http请求 在http请求的Headers部分可见Referer. Referer http:// ...

  5. 16 IO操作文件读写

    IO的分类 第一种分法: 1.输入流 2.输出流 第二种分法: 1.字节流 2.字符流 第三种分法: 1.节点流 2.处理流 I/O当中的核心类: InputStream  <--------F ...

  6. bzoj3514Codechef MARCH14 GERALD07加强版

    #include <iostream> #include <cstdio> #include <cstring> #include <cmath> #i ...

  7. CSS3伪类选择器:nth-child()(nth-child(odd)/nth-child(even))

    nth-child(odd):奇数 nth-child(even):偶数 使用时,如果是精确到数字时,切记是从同一级别的元素开始计算,而不是指定某个类才开始计算. 比如: <li>< ...

  8. oracle 前滚和回滚

    前滚(Rollforward): 在数据库关闭时候,很多已经提交的数据没有写到磁盘上, 数据恢复时,在文件上重演日志内容,把文件恢复到数据库关闭时的状态. 回滚(Rollback): 在数据库关闭时, ...

  9. [NOIP2014] 普及组

    珠心算测验 模拟. 将所有“两个不同数之和”装进桶里,扫描原数组记录满足条件的数的个数. /*by SilverN*/ #include<iostream> #include<alg ...

  10. python pep8

    有这个自动的规范检查工具 pip install pep8 具体使用不说了 ==. 百度一堆  http://blog.sae.sina.com.cn/archives/4781  看这里