用email登陆,好处很明显.
function login($username, $password) { if ($this->check_user($username, $password) > 0) { if ($this->need_sync) { $this->sync($username,$password); } $this->set_session($username); $this->set_cookie($username);
return true; } else { return false; } }
改为:
function login($username, $password) { if(is_email($username)) { if ($this->need_sync) { $this->sync($username,$password); } $this->set_session($username); $this->set_cookie($username);
return true; } else { return false; } } (责任编辑:好模板) |