前端录网站,记录前端点点滴滴,帮助程序猿快速成长!

(转)phpcms 实现用户名和邮件均可登录

PHPCMSV9
第一步:修改登陆的验证JS
  修改 statics/js/formvalidatorregex.js找到

ps_username:”^[u4E00-u9FA5uF900-uFA2D_w]+$”
改成
ps_username:”^[\\u4E00-\\u9FA5\\uF900-\\uFA2D_\\w@\.]+$”

第二步: 修改登录文件
     修改 phpcms/modules/member/index.php

将 $status = $this->client->ps_member_login($username, $password);

改为
if(is_email($username)){
$status = $this->client->ps_member_login($username, $password,1);
} else {
$status = $this->client->ps_member_login($username, $password);
}


转载请注明:前端录»(转)phpcms 实现用户名和邮件均可登录