]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
new setting: default value for 'remember me' checkbox 944/head
authorWilli Eggeling <mail@wje-online.de>
Sat, 26 Aug 2017 07:27:10 +0000 (09:27 +0200)
committerWilli Eggeling <mail@wje-online.de>
Sun, 27 Aug 2017 14:03:37 +0000 (16:03 +0200)
- 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

application/config/ConfigManager.php
doc/md/Shaarli-configuration.md
index.php
tpl/default/loginform.html
tpl/vintage/loginform.html

index 8eab26f1264e58f0288d3f61fe5c04434b445ed5..c94d92a8bf3ef4168eb9bf910a9cbd188874390b 100644 (file)
@@ -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);
index 188a3c09161ef5c68676a3d29d8b133464ede493..d90e95eb5e33168a5869088170db5a194190af82 100644 (file)
@@ -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,
index 76526bd54717efeaf2d56eed8f83ed6a6970e67d..f2f3b93e83ed1a17a7e7c56c8bf6add3f0c21ae6 100644 (file)
--- 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;
     }
index eb6d83781817690374ad593d4457eaf0fdd60401..5777a2186da5d94521d5d7c43726a4ab79da1de1 100644 (file)
@@ -30,7 +30,8 @@
         </div>
         <div class="remember-me">
           <input type="checkbox" name="longlastingsession" id="longlastingsessionform"
-             checked="checked" tabindex="22">
+             {if="$remember_user_default"}checked="checked"{/if}
+             tabindex="22">
           <label for="longlastingsessionform">{'Remember me'|t}</label>
         </div>
         <div>
index 84176385765837973d77be29941db622ccad1f6a..1becd44f7db6c305d9bed899c65c13db6aa16305 100644 (file)
@@ -24,7 +24,9 @@
         </label>
         <input type="submit" value="Login" class="bigbutton" tabindex="4">
         <label for="longlastingsession">
-          <input type="checkbox" name="longlastingsession" id="longlastingsession" tabindex="3">
+          <input type="checkbox" name="longlastingsession"
+                 id="longlastingsession" tabindex="3"
+                 {if="$remember_user_default"}checked="checked"{/if}>
           Stay signed in (Do not check on public computers)</label>
         <input type="hidden" name="token" value="{$token}">
         {if="$returnurl"}<input type="hidden" name="returnurl" value="{$returnurl}">{/if}