Commit 3dee673a authored by Tim Steiner's avatar Tim Steiner
Browse files

When doing CAS logouts, support a baseUrl with schema and host specified.

parent ecd90122
......@@ -47,15 +47,19 @@ abstract class Unl_Controller_Action_Authenticate extends Unl_Controller_Action
{
$this->_destroyUser(Zend_Auth::getInstance()->getIdentity());
Zend_Auth::getInstance()->clearIdentity();
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
$returnUrl = 'https://';
$baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();
if (parse_url($baseUrl, PHP_URL_SCHEME)) {
$returnUrl = $baseUrl;
} else {
$returnUrl = 'http://';
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
$returnUrl = 'https://';
} else {
$returnUrl = 'http://';
}
$returnUrl .= $_SERVER['SERVER_NAME'] . $baseUrl;
}
$returnUrl .= $_SERVER['SERVER_NAME'] . Zend_Controller_Front::getInstance()->getBaseUrl();
$logoutUrl = $this->_getCasAdapter()->getLogoutUrl($returnUrl);
$this->_redirect($logoutUrl);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment