From 1563870c5ee0ace2346c4a8dc4054aa2a6863630 Mon Sep 17 00:00:00 2001 From: Li Heng Date: Wed, 4 Dec 2013 07:46:58 +0000 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=B7=A8=E7=AB=99=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E5=8F=8A=E5=88=86=E7=AB=99=E9=87=8D=E5=86=99cookie.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/controllers/AccountController.php | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/application/default/controllers/AccountController.php b/application/default/controllers/AccountController.php index 16190f86..5dacba04 100755 --- a/application/default/controllers/AccountController.php +++ b/application/default/controllers/AccountController.php @@ -3,6 +3,7 @@ use Helpers\View; use Helpers\Curl; use Users\Member; use Users\Account; +use Users\Users; class AccountController extends Zend_Controller_Action { @@ -398,10 +399,21 @@ class AccountController extends Zend_Controller_Action $data = $curl->request($url,array('data'=>$encoded_param),"POST"); $KEY = \Helpers\MCrypt::decrypt($data['response'],"CH6668"); - $cache_data = json_decode($KEY,true); - view::Dump($cache_data,false); - $host = $_SERVER['SERVER_NAME']; - view::Dump($host,false); + $cache_data = json_decode($KEY); + if (isset($cache_data -> error)) + { + $this->view->error =$cache_data -> error; + return; + } + $Users = new Users(); + if(!$Users -> storeNewAuthCredential($cache_data)) + { + $this-> view->error ="登录失败,请重新登录。"; + return; + }else{ + + view::Post($this,"登录成功!",$tohref); + } return true; }