diff options
author | xue <> | 2006-08-02 01:06:16 +0000 |
---|---|---|
committer | xue <> | 2006-08-02 01:06:16 +0000 |
commit | 38fc83fb70a87f0f8a1b4bc0f4753e3063749522 (patch) | |
tree | ae8d0ab570dc1f33bb4a4a1b93d8d23d032c72f3 | |
parent | 8ab3ff590bd67acf666c6f3e2c71032424dd93ce (diff) |
Fixed an issue in TAuthManager about authentication order.
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | framework/Security/TAuthManager.php | 8 | ||||
-rw-r--r-- | framework/Web/THttpResponse.php | 15 |
3 files changed, 12 insertions, 12 deletions
@@ -10,7 +10,6 @@ BUG: Ticket#302 - TDatePicker's bug with AutoPostBack set to "true" (Wei) BUG: Ticket#306 - Prado::localize function may fail when localized string passed as parameter (Wei) BUG: Ticket#311 - Several bugs in TDatePicker (Wei) BUG: Ticket#312 - TDatePicker's ReadOnly property bug (Wei) -BUG: Default charset not sent (Wei) CHG: Ticket#206 - TBaseValidator.OnValidate is raised only when the validator is visible (Qiang) CHG: Raised PHP version requirement to 5.1 and above (Qiang) ENH: Ticket#178 - Added TRadioButton.UniqueGroupName property (Qiang) diff --git a/framework/Security/TAuthManager.php b/framework/Security/TAuthManager.php index ee01d5f3..e378b51e 100644 --- a/framework/Security/TAuthManager.php +++ b/framework/Security/TAuthManager.php @@ -195,10 +195,6 @@ class TAuthManager extends TModule public function onAuthenticate($param)
{
$application=$this->getApplication();
- if($this->hasEventHandler('OnAuthenticate'))
- $this->raiseEvent('OnAuthenticate',$this,$application);
- if($application->getUser()!==null)
- return;
if(($session=$application->getSession())===null)
throw new TConfigurationException('authmanager_session_required');
@@ -206,6 +202,10 @@ class TAuthManager extends TModule $sessionInfo=$session->itemAt($this->generateUserSessionKey());
$user=$this->_userManager->getUser(null)->loadFromString($sessionInfo);
$application->setUser($user);
+
+ // event handler gets a chance to do further auth work
+ if($this->hasEventHandler('OnAuthenticate'))
+ $this->raiseEvent('OnAuthenticate',$this,$application);
}
/**
diff --git a/framework/Web/THttpResponse.php b/framework/Web/THttpResponse.php index 99d8daa5..b6b675c1 100644 --- a/framework/Web/THttpResponse.php +++ b/framework/Web/THttpResponse.php @@ -314,14 +314,15 @@ class THttpResponse extends TModule implements ITextWriter protected function sendContentTypeHeader()
{
$charset=$this->getCharset();
- if(empty($charset) && ($globalization=$this->getApplication()->getGlobalization(false))!==null)
+ if($charset==='' && ($globalization=$this->getApplication()->getGlobalization(false))!==null)
$charset=$globalization->getCharset();
-
- $contentType=empty($this->_contentType)?'text/html':$this->_contentType;
- $charset=empty($charset)?'UTF-8':$charset;
-
- //default is "Content-Type: text/html;charset=UTF-8"
- $this->appendHeader('Content-Type: '.$contentType.';charset='.$charset);
+ if($charset!=='')
+ {
+ $contentType=$this->_contentType===null?'text/html':$this->_contentType;
+ $this->appendHeader('Content-Type: '.$contentType.';charset='.$charset);
+ }
+ else if($this->_contentType!==null)
+ $this->appendHeader('Content-Type: '.$this->_contentType.';charset=UTF-8');
}
/**
|