From b377b57516ce1193b4581be8b531cd0193f58d7d Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 1 Aug 2015 12:46:55 -0400 Subject: Add config parameter to disable/enable RememberMe authentication --- app/Model/Authentication.php | 4 ++-- app/Template/auth/index.php | 4 +++- app/constants.php | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/Model/Authentication.php b/app/Model/Authentication.php index f09312bd..93a463f1 100644 --- a/app/Model/Authentication.php +++ b/app/Model/Authentication.php @@ -54,7 +54,7 @@ class Authentication extends Base } // We try first with the RememberMe cookie - if ($this->backend('rememberMe')->authenticate()) { + if (REMEMBER_ME_AUTH && $this->backend('rememberMe')->authenticate()) { return true; } @@ -193,7 +193,7 @@ class Authentication extends Base */ private function createRememberMeSession(array $values) { - if (! empty($values['remember_me'])) { + if (REMEMBER_ME_AUTH && ! empty($values['remember_me'])) { $credentials = $this->backend('rememberMe') ->create($this->userSession->getId(), Request::getIpAddress(), Request::getUserAgent()); diff --git a/app/Template/auth/index.php b/app/Template/auth/index.php index efe95185..1ad1b9a4 100644 --- a/app/Template/auth/index.php +++ b/app/Template/auth/index.php @@ -21,7 +21,9 @@ form->text('captcha', $values, $errors, array('required')) ?> - form->checkbox('remember_me', t('Remember Me'), 1, true) ?>
+ + form->checkbox('remember_me', t('Remember Me'), 1, true) ?>
+
diff --git a/app/constants.php b/app/constants.php index e73e7b1a..61dfa10a 100644 --- a/app/constants.php +++ b/app/constants.php @@ -53,6 +53,9 @@ defined('REVERSE_PROXY_USER_HEADER') or define('REVERSE_PROXY_USER_HEADER', 'REM defined('REVERSE_PROXY_DEFAULT_ADMIN') or define('REVERSE_PROXY_DEFAULT_ADMIN', ''); defined('REVERSE_PROXY_DEFAULT_DOMAIN') or define('REVERSE_PROXY_DEFAULT_DOMAIN', ''); +// Remember me authentication +defined('REMEMBER_ME_AUTH') or define('REMEMBER_ME_AUTH', true); + // Mail configuration defined('MAIL_FROM') or define('MAIL_FROM', 'notifications@kanboard.local'); defined('MAIL_TRANSPORT') or define('MAIL_TRANSPORT', 'mail'); -- cgit v1.2.3