diff --git a/application/config/ConfigManager.php b/application/config/ConfigManager.php index 8eab26f..c94d92a 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 188a3c0..d90e95e 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 76526bd..f2f3b93 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 eb6d837..5777a21 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 8417638..1becd44 100644 --- a/tpl/vintage/loginform.html +++ b/tpl/vintage/loginform.html @@ -24,7 +24,9 @@ {if="$returnurl"}{/if}