|
@@ -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();
|