修改跨域登录功能

This commit is contained in:
Li Jianxuan 2014-06-11 01:39:18 +00:00
parent f7fbbf4e64
commit 1a6b0375a9
2 changed files with 742 additions and 726 deletions

View File

@ -564,6 +564,8 @@ class AccountController extends Zend_Controller_Action
} //找回密码 } //找回密码
/*
//westdc cross doamin login
public function wcdloginAction() public function wcdloginAction()
{ {
$this->_helper->layout()->disableLayout(); $this->_helper->layout()->disableLayout();
@ -584,6 +586,7 @@ class AccountController extends Zend_Controller_Action
} }
return; return;
} }
*/
} }

View File

@ -20,6 +20,8 @@ class Member
public $FieldLastloginIp = "last_login_ip"; public $FieldLastloginIp = "last_login_ip";
public $GravatarEmailField = "gravatar_email"; public $GravatarEmailField = "gravatar_email";
public $rootdomain = "";
public $RoleMember = "member"; public $RoleMember = "member";
function __construct() function __construct()
@ -41,6 +43,11 @@ class Member
{ {
$this->user= $_COOKIE['user']; $this->user= $_COOKIE['user'];
} }
if(!isset($this->config->auth->domain) && !empty($this->config->auth->domain))
{
$this->rootdomain = $this->config->auth->domain;
}
} }
@ -98,8 +105,14 @@ class Member
$time = 604800; $time = 604800;
} }
if(empty($this->rootdomain))
{
setcookie('user',$uname,time()+$time,'/'); setcookie('user',$uname,time()+$time,'/');
setcookie('scr',$scrString,time()+$time,'/'); setcookie('scr',$scrString,time()+$time,'/');
}else{
setcookie('user',$uname,time()+$time,'/',$this->rootdomain);
setcookie('scr',$scrString,time()+$time,'/',$this->rootdomain);
}
return true; return true;
} catch (Exception $e) { } catch (Exception $e) {