Added a DISABLE_LOGOUT constant, to allow the logout command to be disabled, for support of external SSO solutions.

This commit is contained in:
Dj Padzensky 2016-02-12 15:56:13 -08:00
parent 77ae92b09b
commit 773bf36733
3 changed files with 17 additions and 7 deletions

View File

@ -55,8 +55,13 @@ class Auth extends Base
*/
public function logout()
{
$this->sessionManager->close();
$this->response->redirect($this->helper->url->to('auth', 'login'));
if (! DISABLE_LOGOUT) {
$this->sessionManager->close();
$this->response->redirect($this->helper->url->to('auth', 'login'));
}
else {
$this->response->redirect($this->helper->url->to('auth', 'index'));
}
}
/**

View File

@ -84,13 +84,15 @@
<i class="fa fa-life-ring fa-fw"></i>
<?= $this->url->link(t('Documentation'), 'doc', 'show') ?>
</li>
<li>
<i class="fa fa-sign-out fa-fw"></i>
<?= $this->url->link(t('Logout'), 'auth', 'logout') ?>
</li>
<?php if (! DISABLE_LOGOUT): ?>
<li>
<i class="fa fa-sign-out fa-fw"></i>
<?= $this->url->link(t('Logout'), 'auth', 'logout') ?>
</li>
<?php endif ?>
</ul>
</div>
</li>
</ul>
</nav>
</header>
</header>

View File

@ -111,3 +111,6 @@ defined('HTTP_PROXY_HOSTNAME') or define('HTTP_PROXY_HOSTNAME', '');
defined('HTTP_PROXY_PORT') or define('HTTP_PROXY_PORT', '3128');
defined('HTTP_PROXY_USERNAME') or define('HTTP_PROXY_USERNAME', '');
defined('HTTP_PROXY_PASSWORD') or define('HTTP_PROXY_PASSWORD', '');
// Disabling logout (for external SSO authentication)
defined('DISABLE_LOGOUT') or define('DISABLE_LOGOUT', 0);