Authored by whb

登录bug

@@ -232,6 +232,7 @@ class Q_Action extends Yaf_Controller_Abstract @@ -232,6 +232,7 @@ class Q_Action extends Yaf_Controller_Abstract
232 echo "</script>"; 232 echo "</script>";
233 } 233 }
234 echo "<meta http-equiv=\"refresh\" content=\"{$content};url={$url}\">"; 234 echo "<meta http-equiv=\"refresh\" content=\"{$content};url={$url}\">";
  235 + exit();
235 } 236 }
236 237
237 /** 238 /**
@@ -240,7 +241,7 @@ class Q_Action extends Yaf_Controller_Abstract @@ -240,7 +241,7 @@ class Q_Action extends Yaf_Controller_Abstract
240 * @param string $url 241 * @param string $url
241 * @param int $content 242 * @param int $content
242 */ 243 */
243 - protected function helpLocation($message, $url = '',$content = 0) 244 + protected function helpLocation($message, $url = '',$delay = 0)
244 { 245 {
245 if (!empty($message)) { 246 if (!empty($message)) {
246 header("content-type: text/html; charset=utf-8"); 247 header("content-type: text/html; charset=utf-8");
@@ -252,12 +253,13 @@ class Q_Action extends Yaf_Controller_Abstract @@ -252,12 +253,13 @@ class Q_Action extends Yaf_Controller_Abstract
252 } 253 }
253 if(!empty($url)) 254 if(!empty($url))
254 { 255 {
255 - echo "<meta http-equiv=\"refresh\" content=\"{$message};url={$url}\">"; 256 + echo "<meta http-equiv=\"refresh\" content=\"{$delay};url={$url}\">";
256 } 257 }
257 else 258 else
258 { 259 {
259 - echo "<meta http-equiv=\"refresh\" content=\";url={$_SERVER['REQUEST_URI']}\">"; 260 + echo "<meta http-equiv=\"refresh\" content=\"{$delay};url={$_SERVER['REQUEST_URI']}\">";
260 } 261 }
  262 + exit();
261 } 263 }
262 264
263 protected function _g() 265 protected function _g()
@@ -12,13 +12,14 @@ class IndexController extends QLib_Actions_Login @@ -12,13 +12,14 @@ class IndexController extends QLib_Actions_Login
12 public function loginAction() 12 public function loginAction()
13 { 13 {
14 $this->disableView(); 14 $this->disableView();
  15 +
15 $username = trim($this->_post('username')); 16 $username = trim($this->_post('username'));
16 $inputPassword = trim($this->_post('password')); 17 $inputPassword = trim($this->_post('password'));
17 $refer = trim($this->_post('refer')); 18 $refer = trim($this->_post('refer'));
18 if (empty($username) || empty($inputPassword)) { 19 if (empty($username) || empty($inputPassword)) {
19 $this->helpLocation('账号和密码不能为空.', '/'); 20 $this->helpLocation('账号和密码不能为空.', '/');
20 } 21 }
21 - $profile = Adminx_Models_Profile_Client::getProfileByUsername($username); 22 + $profile = Adminx_Models_Profile_Client::getProfileByUsername($username);
22 if (empty($profile)) { 23 if (empty($profile)) {
23 $this->helpLocation('账号不存在或者被禁用.', '/'); 24 $this->helpLocation('账号不存在或者被禁用.', '/');
24 } 25 }
@@ -32,9 +33,9 @@ class IndexController extends QLib_Actions_Login @@ -32,9 +33,9 @@ class IndexController extends QLib_Actions_Login
32 if ($profile['is_lock'] == 'Y') { 33 if ($profile['is_lock'] == 'Y') {
33 $this->helpLocation('账号已锁定请联系管理员.', '/'); 34 $this->helpLocation('账号已锁定请联系管理员.', '/');
34 } 35 }
35 - /*if ((int)$profile['expires'] < time()) { 36 + if ((int)$profile['expires'] < time()) {
36 $this->helpLocation('账号已过期请联系管理员.', '/'); 37 $this->helpLocation('账号已过期请联系管理员.', '/');
37 - }*/ 38 + }
38 ############################################# 39 #############################################
39 $cache = Q_Cache::factory('Memcached')->setPrefix('adminx' . '.' . 'profile'); 40 $cache = Q_Cache::factory('Memcached')->setPrefix('adminx' . '.' . 'profile');
40 ############################################# 41 #############################################
@@ -46,7 +47,8 @@ class IndexController extends QLib_Actions_Login @@ -46,7 +47,8 @@ class IndexController extends QLib_Actions_Login
46 if ($cache->get($logKey) > 3) { 47 if ($cache->get($logKey) > 3) {
47 Adminx_Models_Profile_Client::updateProfileLockByPid($profile['pid']); 48 Adminx_Models_Profile_Client::updateProfileLockByPid($profile['pid']);
48 } 49 }
49 - $this->helpLocation('密码错误.'); 50 + $this->helpLocation('密码错误.', '/');
  51 +
50 } 52 }
51 ################################### BEGIN SET COOKIE ############################################### 53 ################################### BEGIN SET COOKIE ###############################################
52 $profile['signin_time'] = time(); 54 $profile['signin_time'] = time();