用户跨站登录及分站重写cookie.
This commit is contained in:
parent
2c50c49baf
commit
1563870c5e
|
@ -3,6 +3,7 @@ use Helpers\View;
|
||||||
use Helpers\Curl;
|
use Helpers\Curl;
|
||||||
use Users\Member;
|
use Users\Member;
|
||||||
use Users\Account;
|
use Users\Account;
|
||||||
|
use Users\Users;
|
||||||
|
|
||||||
class AccountController extends Zend_Controller_Action
|
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");
|
$data = $curl->request($url,array('data'=>$encoded_param),"POST");
|
||||||
|
|
||||||
$KEY = \Helpers\MCrypt::decrypt($data['response'],"CH6668");
|
$KEY = \Helpers\MCrypt::decrypt($data['response'],"CH6668");
|
||||||
$cache_data = json_decode($KEY,true);
|
$cache_data = json_decode($KEY);
|
||||||
view::Dump($cache_data,false);
|
if (isset($cache_data -> error))
|
||||||
$host = $_SERVER['SERVER_NAME'];
|
{
|
||||||
view::Dump($host,false);
|
$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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue