diff --git a/application/default/controllers/AccountController.php b/application/default/controllers/AccountController.php index 762f3597..d5cf52af 100755 --- a/application/default/controllers/AccountController.php +++ b/application/default/controllers/AccountController.php @@ -350,9 +350,11 @@ class AccountController extends Zend_Controller_Action view::Post($this,"登录成功,正在跳转",$tohref); return true; + }else{ + $this->view->captcha = $captcha->setCaptcha(); } - $this->view->captcha = $captcha->setCaptcha(); + } public function captchaAction() diff --git a/application/default/views/scripts/account/login.phtml b/application/default/views/scripts/account/login.phtml index 42874937..ac421001 100755 --- a/application/default/views/scripts/account/login.phtml +++ b/application/default/views/scripts/account/login.phtml @@ -6,21 +6,6 @@ $this->breadcrumb('用户登录'); $this->breadcrumb()->setSeparator(' > '); ?> -
error)) { ?> @@ -29,7 +14,7 @@
- error['error'] ?> + error['error'])? $this->error['error'] : $this->error ?>
diff --git a/application/models/CustomControllerAclManager.php b/application/models/CustomControllerAclManager.php index 60330350..0bee8403 100755 --- a/application/models/CustomControllerAclManager.php +++ b/application/models/CustomControllerAclManager.php @@ -1,4 +1,8 @@ auth->hasIdentity()) { - $mb = new member(); - $mb->db=$this->db; - if($mb->checkcookie()) + $member = new Member(); + + if($member->checkcookie()) { - $auth = Zend_Auth::getInstance(); - $authAdapter = new Zend_Auth_Adapter_DbTable($this->db); - $authAdapter->setTableName('users') - ->setIdentityColumn('username') - ->setCredentialColumn('password'); - $authAdapter->setIdentity($mb->user)->setCredential($mb->srpwd); - $result = $auth->authenticate($authAdapter); - if ($result->isValid()) { - $data = $authAdapter->getResultRowObject(null,'password'); - //头像 - include_once("Avatar.php"); - $avatar = new Avatar(); - $data->avatar = $avatar->Get($data->email,40); - - //组ID - include_once("Users.php"); - $usr = new Users($this->db); - $data->gid = $usr->getGroup($data->id); - - $auth->getStorage()->write($data); - $this->db->query("update users set ts_last_login=now() where username=?",array($mb->user)); + $data = array( + 'username' => $member->user, + 'password' => $member->srpwd + ); + + $account = new Account(); + $status = $account->storeLogin($data,false); + + if(isset($status['error'])) + { + $auth = Zend_Auth::getInstance(); + $auth->clearIdentity(); + Member::flushcookie(); } } } diff --git a/application/module/Users/Member.php b/application/module/Users/Member.php index fcb2bce2..c7ad012c 100644 --- a/application/module/Users/Member.php +++ b/application/module/Users/Member.php @@ -3,9 +3,9 @@ namespace Users; class Member { - var $ck='DCC3ER4T8L2EFX94OPDF'; - var $db; //传入PDO对象 - var $mid; //会员ID + public $ck='DCC3ER4T8L2EFX94OPDF'; + public $db; //传入PDO对象 + public $mid; //会员ID public $scr; //cookie 安全码 $_COOKIE['scr'] public $user;//cookie User $_COOKIE['user']