Skip to content
Snippets Groups Projects
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
Branches
Tags
No related merge requests found
...@@ -48,13 +48,17 @@ abstract class Unl_Controller_Action_Authenticate extends Unl_Controller_Action ...@@ -48,13 +48,17 @@ abstract class Unl_Controller_Action_Authenticate extends Unl_Controller_Action
$this->_destroyUser(Zend_Auth::getInstance()->getIdentity()); $this->_destroyUser(Zend_Auth::getInstance()->getIdentity());
Zend_Auth::getInstance()->clearIdentity(); Zend_Auth::getInstance()->clearIdentity();
$baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();
if (parse_url($baseUrl, PHP_URL_SCHEME)) {
$returnUrl = $baseUrl;
} else {
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') { if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
$returnUrl = 'https://'; $returnUrl = 'https://';
} else { } else {
$returnUrl = 'http://'; $returnUrl = 'http://';
} }
$returnUrl .= $_SERVER['SERVER_NAME'] . $baseUrl;
$returnUrl .= $_SERVER['SERVER_NAME'] . Zend_Controller_Front::getInstance()->getBaseUrl(); }
$logoutUrl = $this->_getCasAdapter()->getLogoutUrl($returnUrl); $logoutUrl = $this->_getCasAdapter()->getLogoutUrl($returnUrl);
$this->_redirect($logoutUrl); $this->_redirect($logoutUrl);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment