From: Willi Eggeling Date: Sat, 26 Aug 2017 07:27:10 +0000 (+0200) Subject: new setting: default value for 'remember me' checkbox X-Git-Tag: v0.9.4~7^2~10^2 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=2e07e77573a379f9af006b2c523117eef9fdf9b2;p=github%2Fshaarli%2FShaarli.git new setting: default value for 'remember me' checkbox - the default state for the login page's 'remember me' checkbox can now be configured - adapted the default and vintage theme to consider the new setting - added documentation for the new setting --- diff --git a/application/config/ConfigManager.php b/application/config/ConfigManager.php index 8eab26f1..c94d92a8 100644 --- a/application/config/ConfigManager.php +++ b/application/config/ConfigManager.php @@ -328,6 +328,8 @@ class ConfigManager $this->setEmpty('privacy.default_private_links', false); $this->setEmpty('privacy.hide_public_links', false); $this->setEmpty('privacy.hide_timestamps', false); + // default state of the 'remember me' checkbox of the login form + $this->setEmpty('privacy.remember_user_default', true); $this->setEmpty('thumbnail.enable_thumbnails', true); $this->setEmpty('thumbnail.enable_localcache', true); diff --git a/doc/md/Shaarli-configuration.md b/doc/md/Shaarli-configuration.md index 188a3c09..d90e95eb 100644 --- a/doc/md/Shaarli-configuration.md +++ b/doc/md/Shaarli-configuration.md @@ -91,6 +91,8 @@ _These settings should not be edited_ - **default_private_links**: Check the private checkbox by default for every new link. - **hide_public_links**: All links are hidden while logged out. - **hide_timestamps**: Timestamps are hidden. +- **remember_user_default**: Default state of the login page's *remember me* checkbox + - `true`: checked by default, `false`: unchecked by default ### Feed @@ -192,7 +194,8 @@ _These settings should not be edited_ "privacy": { "default_private_links": true, "hide_public_links": false, - "hide_timestamps": false + "hide_timestamps": false, + "remember_user_default": true }, "thumbnail": { "enable_thumbnails": true, diff --git a/index.php b/index.php index 76526bd5..f2f3b93e 100644 --- a/index.php +++ b/index.php @@ -745,6 +745,8 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history) $PAGE->assign('username', escape($_GET['username'])); } $PAGE->assign('returnurl',(isset($_SERVER['HTTP_REFERER']) ? escape($_SERVER['HTTP_REFERER']):'')); + // add default state of the 'remember me' checkbox + $PAGE->assign('remember_user_default', $conf->get('privacy.remember_user_default')); $PAGE->renderPage('loginform'); exit; } diff --git a/tpl/default/loginform.html b/tpl/default/loginform.html index eb6d8378..5777a218 100644 --- a/tpl/default/loginform.html +++ b/tpl/default/loginform.html @@ -30,7 +30,8 @@
+ {if="$remember_user_default"}checked="checked"{/if} + tabindex="22">
diff --git a/tpl/vintage/loginform.html b/tpl/vintage/loginform.html index 84176385..1becd44f 100644 --- a/tpl/vintage/loginform.html +++ b/tpl/vintage/loginform.html @@ -24,7 +24,9 @@ {if="$returnurl"}{/if}