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() public function logout()
{ {
$this->sessionManager->close(); if (! DISABLE_LOGOUT) {
$this->response->redirect($this->helper->url->to('auth', 'login')); $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> <i class="fa fa-life-ring fa-fw"></i>
<?= $this->url->link(t('Documentation'), 'doc', 'show') ?> <?= $this->url->link(t('Documentation'), 'doc', 'show') ?>
</li> </li>
<li> <?php if (! DISABLE_LOGOUT): ?>
<i class="fa fa-sign-out fa-fw"></i> <li>
<?= $this->url->link(t('Logout'), 'auth', 'logout') ?> <i class="fa fa-sign-out fa-fw"></i>
</li> <?= $this->url->link(t('Logout'), 'auth', 'logout') ?>
</li>
<?php endif ?>
</ul> </ul>
</div> </div>
</li> </li>
</ul> </ul>
</nav> </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_PORT') or define('HTTP_PROXY_PORT', '3128');
defined('HTTP_PROXY_USERNAME') or define('HTTP_PROXY_USERNAME', ''); defined('HTTP_PROXY_USERNAME') or define('HTTP_PROXY_USERNAME', '');
defined('HTTP_PROXY_PASSWORD') or define('HTTP_PROXY_PASSWORD', ''); defined('HTTP_PROXY_PASSWORD') or define('HTTP_PROXY_PASSWORD', '');
// Disabling logout (for external SSO authentication)
defined('DISABLE_LOGOUT') or define('DISABLE_LOGOUT', 0);