summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/Controller/Auth.php9
-rw-r--r--app/Template/header.php12
-rw-r--r--app/constants.php3
3 files changed, 17 insertions, 7 deletions
diff --git a/app/Controller/Auth.php b/app/Controller/Auth.php
index fef7f0e3..b98dff5d 100644
--- a/app/Controller/Auth.php
+++ b/app/Controller/Auth.php
@@ -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'));
+ }
}
/**
diff --git a/app/Template/header.php b/app/Template/header.php
index fd9ff24d..72d89b80 100644
--- a/app/Template/header.php
+++ b/app/Template/header.php
@@ -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> \ No newline at end of file
+</header>
diff --git a/app/constants.php b/app/constants.php
index 1740494e..011fa784 100644
--- a/app/constants.php
+++ b/app/constants.php
@@ -97,6 +97,9 @@ defined('ENABLE_URL_REWRITE') or define('ENABLE_URL_REWRITE', isset($_SERVER['HT
// Hide login form
defined('HIDE_LOGIN_FORM') or define('HIDE_LOGIN_FORM', false);
+// Disabling logout (for external SSO authentication)
+defined('DISABLE_LOGOUT') or define('DISABLE_LOGOUT', false);
+
// Bruteforce protection
defined('BRUTEFORCE_CAPTCHA') or define('BRUTEFORCE_CAPTCHA', 3);
defined('BRUTEFORCE_LOCKDOWN') or define('BRUTEFORCE_LOCKDOWN', 6);