From ae1c1995b2fec431afe7cca23b2697e1bef17baf Mon Sep 17 00:00:00 2001 From: xue <> Date: Fri, 17 Feb 2006 04:28:06 +0000 Subject: moved shortcut methods from TComponent to TControl. --- framework/Security/TAuthManager.php | 8 ++++---- framework/Security/TAuthorizationRule.php | 1 - framework/Security/TUserManager.php | 1 - 3 files changed, 4 insertions(+), 6 deletions(-) (limited to 'framework/Security') diff --git a/framework/Security/TAuthManager.php b/framework/Security/TAuthManager.php index 819b7b36..a41da914 100644 --- a/framework/Security/TAuthManager.php +++ b/framework/Security/TAuthManager.php @@ -133,7 +133,7 @@ class TAuthManager extends TModule { $this->onAuthenticate($param); - $service=$this->getService(); + $service=$this->getApplication()->getService(); if(($service instanceof TPageService) && $service->getRequestedPagePath()===$this->getLoginPage()) $this->_skipAuthorization=true; } @@ -181,7 +181,7 @@ class TAuthManager extends TModule */ public function getReturnUrl() { - return $this->getSession()->itemAt(self::RETURN_URL_VAR); + return $this->getApplication()->getSession()->itemAt(self::RETURN_URL_VAR); } /** @@ -244,7 +244,7 @@ class TAuthManager extends TModule { if(!$user->getIsGuest()) { - if(($session=$this->getSession())===null) + if(($session=$this->getApplication()->getSession())===null) throw new TConfigurationException('authmanager_session_required'); else $session->add($this->generateUserSessionKey(),$user->saveToString()); @@ -279,7 +279,7 @@ class TAuthManager extends TModule */ public function logout() { - if(($session=$this->getSession())===null) + if(($session=$this->getApplication()->getSession())===null) throw new TConfigurationException('authmanager_session_required'); else { diff --git a/framework/Security/TAuthorizationRule.php b/framework/Security/TAuthorizationRule.php index 81955a44..8248a45a 100644 --- a/framework/Security/TAuthorizationRule.php +++ b/framework/Security/TAuthorizationRule.php @@ -63,7 +63,6 @@ class TAuthorizationRule extends TComponent */ public function __construct($action,$users,$roles,$verb='') { - parent::__construct(); $action=strtolower(trim($action)); if($action==='allow' || $action==='deny') $this->_action=$action; diff --git a/framework/Security/TUserManager.php b/framework/Security/TUserManager.php index 06b5d321..c799c446 100644 --- a/framework/Security/TUserManager.php +++ b/framework/Security/TUserManager.php @@ -52,7 +52,6 @@ class TUser extends TComponent implements IUser */ public function __construct($manager=null) { - parent::__construct(); $this->_manager=$manager; } -- cgit v1.2.3