Add config parameter to disable/enable RememberMe authentication

This commit is contained in:
Frederic Guillot 2015-08-01 12:46:55 -04:00
parent fb44818707
commit b377b57516
6 changed files with 20 additions and 3 deletions

View File

@ -7,6 +7,7 @@ New features:
* Add new api procedures: getDefaultTaskColor(), getDefaultTaskColors() and getColorList()
* Add user api access
* Add config parameter to define session duration
* Add config parameter to disable/enable RememberMe authentication
Bug fixes:

View File

@ -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());

View File

@ -21,7 +21,9 @@
<?= $this->form->text('captcha', $values, $errors, array('required')) ?>
<?php endif ?>
<?= $this->form->checkbox('remember_me', t('Remember Me'), 1, true) ?><br/>
<?php if (REMEMBER_ME_AUTH): ?>
<?= $this->form->checkbox('remember_me', t('Remember Me'), 1, true) ?><br/>
<?php endif ?>
<div class="form-actions">
<input type="submit" value="<?= t('Sign in') ?>" class="btn btn-blue"/>

View File

@ -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');

View File

@ -142,6 +142,9 @@ define('REVERSE_PROXY_DEFAULT_ADMIN', '');
// Default domain to use for setting the email address
define('REVERSE_PROXY_DEFAULT_DOMAIN', '');
// Enable/disable remember me authentication
define('REMEMBER_ME_AUTH', true);
// Enable or disable "Strict-Transport-Security" HTTP header
define('ENABLE_HSTS', true);

View File

@ -185,6 +185,14 @@ define('REVERSE_PROXY_DEFAULT_ADMIN', '');
define('REVERSE_PROXY_DEFAULT_DOMAIN', '');
```
RememberMe Authentication settings
----------------------------------
```php
// Enable/disable remember me authentication
define('REMEMBER_ME_AUTH', true);
```
Secure HTTP headers settings
----------------------------