summaryrefslogtreecommitdiff
path: root/framework/Security
diff options
context:
space:
mode:
authorxue <>2007-06-25 22:01:01 +0000
committerxue <>2007-06-25 22:01:01 +0000
commitdcddd8cba228aae64c948ea742891b09524fd79b (patch)
tree4f1c8a2a6c37c6af9301b3c0cac5f60e52e78960 /framework/Security
parentc4b96269e8b1a129612d813c25cf67e98b9dbc65 (diff)
Added TAuthManager.ReturnUrlVarName property
Added TPageService.DefaultPageUrl property
Diffstat (limited to 'framework/Security')
-rw-r--r--framework/Security/TAuthManager.php30
1 files changed, 26 insertions, 4 deletions
diff --git a/framework/Security/TAuthManager.php b/framework/Security/TAuthManager.php
index ef9f47f9..cbad51dc 100644
--- a/framework/Security/TAuthManager.php
+++ b/framework/Security/TAuthManager.php
@@ -47,15 +47,19 @@ class TAuthManager extends TModule
/**
* @var IUserManager user manager instance
*/
- private $_userManager=null;
+ private $_userManager;
/**
* @var string login page
*/
- private $_loginPage=null;
+ private $_loginPage;
/**
* @var boolean whether authorization should be skipped
*/
private $_skipAuthorization=false;
+ /**
+ * @var string the session var name for storing return URL
+ */
+ private $_returnUrlVarName;
/**
* Initializes this module.
@@ -67,6 +71,8 @@ class TAuthManager extends TModule
{
if($this->_userManager===null)
throw new TConfigurationException('authmanager_usermanager_required');
+ if($this->_returnUrlVarName===null)
+ $this->_returnUrlVarName=$this->getApplication()->getID().':'.self::RETURN_URL_VAR;
$application=$this->getApplication();
if(is_string($this->_userManager))
{
@@ -177,11 +183,27 @@ class TAuthManager extends TModule
}
/**
+ * @return string the name of the session variable storing return URL. It defaults to 'AppID:ReturnUrl'
+ */
+ public function getReturnUrlVarName()
+ {
+ return $this->_returnUrlVarName;
+ }
+
+ /**
+ * @param string the name of the session variable storing return URL.
+ */
+ public function setReturnUrlVarName($value)
+ {
+ $this->_returnUrlVarName=$value;
+ }
+
+ /**
* @return string URL that the browser should be redirected to when login succeeds.
*/
public function getReturnUrl()
{
- return $this->getSession()->itemAt(self::RETURN_URL_VAR);
+ return $this->getSession()->itemAt($this->getReturnUrlVarName());
}
/**
@@ -190,7 +212,7 @@ class TAuthManager extends TModule
*/
public function setReturnUrl($value)
{
- $this->getSession()->add(self::RETURN_URL_VAR,$value);
+ $this->getSession()->add($this->getReturnUrlVarName(),$value);
}
/**