From 773bf36733cd217f257f3a5734a6e69353911a01 Mon Sep 17 00:00:00 2001 From: Dj Padzensky Date: Fri, 12 Feb 2016 15:56:13 -0800 Subject: Added a DISABLE_LOGOUT constant, to allow the logout command to be disabled, for support of external SSO solutions. --- app/Controller/Auth.php | 9 +++++++-- app/Template/header.php | 12 +++++++----- app/constants.php | 3 +++ 3 files changed, 17 insertions(+), 7 deletions(-) (limited to 'app') 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 @@ url->link(t('Documentation'), 'doc', 'show') ?> -
  • - - url->link(t('Logout'), 'auth', 'logout') ?> -
  • + +
  • + + url->link(t('Logout'), 'auth', 'logout') ?> +
  • + - \ No newline at end of file + diff --git a/app/constants.php b/app/constants.php index 1740494e..955edeb5 100644 --- a/app/constants.php +++ b/app/constants.php @@ -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); -- cgit v1.2.3