Authored by whb

登录bug

... ... @@ -232,6 +232,7 @@ class Q_Action extends Yaf_Controller_Abstract
echo "</script>";
}
echo "<meta http-equiv=\"refresh\" content=\"{$content};url={$url}\">";
exit();
}
/**
... ... @@ -240,7 +241,7 @@ class Q_Action extends Yaf_Controller_Abstract
* @param string $url
* @param int $content
*/
protected function helpLocation($message, $url = '',$content = 0)
protected function helpLocation($message, $url = '',$delay = 0)
{
if (!empty($message)) {
header("content-type: text/html; charset=utf-8");
... ... @@ -252,12 +253,13 @@ class Q_Action extends Yaf_Controller_Abstract
}
if(!empty($url))
{
echo "<meta http-equiv=\"refresh\" content=\"{$message};url={$url}\">";
echo "<meta http-equiv=\"refresh\" content=\"{$delay};url={$url}\">";
}
else
{
echo "<meta http-equiv=\"refresh\" content=\";url={$_SERVER['REQUEST_URI']}\">";
echo "<meta http-equiv=\"refresh\" content=\"{$delay};url={$_SERVER['REQUEST_URI']}\">";
}
exit();
}
protected function _g()
... ...
... ... @@ -12,13 +12,14 @@ class IndexController extends QLib_Actions_Login
public function loginAction()
{
$this->disableView();
$username = trim($this->_post('username'));
$inputPassword = trim($this->_post('password'));
$refer = trim($this->_post('refer'));
if (empty($username) || empty($inputPassword)) {
$this->helpLocation('账号和密码不能为空.', '/');
}
$profile = Adminx_Models_Profile_Client::getProfileByUsername($username);
$profile = Adminx_Models_Profile_Client::getProfileByUsername($username);
if (empty($profile)) {
$this->helpLocation('账号不存在或者被禁用.', '/');
}
... ... @@ -32,9 +33,9 @@ class IndexController extends QLib_Actions_Login
if ($profile['is_lock'] == 'Y') {
$this->helpLocation('账号已锁定请联系管理员.', '/');
}
/*if ((int)$profile['expires'] < time()) {
if ((int)$profile['expires'] < time()) {
$this->helpLocation('账号已过期请联系管理员.', '/');
}*/
}
#############################################
$cache = Q_Cache::factory('Memcached')->setPrefix('adminx' . '.' . 'profile');
#############################################
... ... @@ -46,7 +47,8 @@ class IndexController extends QLib_Actions_Login
if ($cache->get($logKey) > 3) {
Adminx_Models_Profile_Client::updateProfileLockByPid($profile['pid']);
}
$this->helpLocation('密码错误.');
$this->helpLocation('密码错误.', '/');
}
################################### BEGIN SET COOKIE ###############################################
$profile['signin_time'] = time();
... ...