Check-in [fe019f946b]
Not logged in
Overview

SHA1 Hash:fe019f946b5853d9975b5e643f7b4505e4c0a268
Date: 2009-12-18 22:01:57
User: drh
Comment:Change the name of the "anon-login-enable-captcha-filler" setting to "auto-captcha". Move the GUI setting of this setting over to the "Setup/Behavior" page.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/db.c from [a46411d47c] to [2ee5db4d82].

@@ -1433,47 +1433,46 @@
 ** With a value argument it changes the property for the current repository.
 **
 ** The "unset" command clears a property setting.
 **
 **
-**    anon-login-enable-captcha-filler
-**                     If enabled, the Login page will provide a button
+**    auto-captcha     If enabled, the Login page will provide a button
 **                     which uses JavaScript to fill out the captcha for
-**                     the user. (Most bots cannot use JavaScript.)
+**                     the "anonymous" user. (Most bots cannot use JavaScript.)
 **
 **    autosync         If enabled, automatically pull prior to
 **                     commit or update and automatically push
 **                     after commit or tag or branch creation.
+**
+**    clearsign        When enabled (the default), fossil will attempt to
+**                     sign all commits with gpg.  When disabled, commits will
+**                     be unsigned.
 **
 **    diff-command     External command to run when performing a diff.
 **                     If undefined, the internal text diff will be used.
 **
 **    dont-push        Prevent this repository from pushing from client to
 **                     server.  Useful when setting up a private branch.
 **
 **    editor           Text editor command used for check-in comments.
 **
+**    gdiff-command    External command to run when performing a graphical
+**                     diff. If undefined, text diff will be used.
+**
 **    http-port        The TCP/IP port number to use by the "server"
 **                     and "ui" commands.  Default: 8080
-**
-**    gdiff-command    External command to run when performing a graphical
-**                     diff. If undefined, text diff will be used.
 **
 **    localauth        If enabled, require that HTTP connections from
 **                     127.0.0.1 be authenticated by password.  If
 **                     false, all HTTP requests from localhost have
 **                     unrestricted access to the repository.
 **
-**    clearsign        When enabled (the default), fossil will attempt to
-**                     sign all commits with gpg.  When disabled, commits will
-**                     be unsigned.
+**    mtime-changes    Use file modification times (mtimes) to detect when
+**                     files have been modified.
 **
 **    pgp-command      Command used to clear-sign manifests at check-in.
 **                     The default is "gpg --clearsign -o ".
-**
-**    mtime-changes    Use file modification times (mtimes) to detect when
-**                     files have been modified.
 **
 **    proxy            URL of the HTTP proxy.  If undefined or "off" then
 **                     the "http_proxy" environment variable is consulted.
 **                     If the http_proxy environment variable is undefined
 **                     then a direct HTTP connection is used.
@@ -1483,21 +1482,21 @@
 **                     Defaults to "start" on windows, "open" on Mac,
 **                     and "firefox" on Unix.
 */
 void setting_cmd(void){
   static const char *azName[] = {
-    "anon-login-enable-captcha-filler",
+    "auto-captcha",
     "autosync",
+    "clearsign",
     "diff-command",
     "dont-push",
     "editor",
     "gdiff-command",
     "http-port",
     "localauth",
-    "clearsign",
-    "pgp-command",
     "mtime-changes",
+    "pgp-command",
     "proxy",
     "web-browser",
   };
   int i;
   int globalFlag = find_option("global","g",0)!=0;

Modified src/login.c from [646f690c52] to [dc8655318b].

@@ -250,22 +250,24 @@
   @ "Login" button.  Your user name will be stored in a browser cookie.
   @ You must configure your web browser to accept cookies in order for
   @ the login to take.</p>
   if( zAnonPw ){
     unsigned int uSeed = captcha_seed();
-    char const * zDecoded = captcha_decode(uSeed);
-    int iAllowPasswordFill = db_get_boolean( "anon-login-enable-captcha-filler", 0 );
+    char const *zDecoded = captcha_decode(uSeed);
+    int bAutoCaptcha = db_get_boolean("auto-captcha", 0);
     char *zCaptcha = captcha_render(zDecoded);
 
     @ <input type="hidden" name="cs" value="%u(uSeed)"/>
     @ <p>Visitors may enter <b>anonymous</b> as the user-ID with
     @ the 8-character hexadecimal password shown below:</p>
     @ <center><table border="1" cellpadding="10"><tr><td><pre>
     @ %s(zCaptcha)
     @ </pre></td></tr></table>
-    if( iAllowPasswordFill ) {
-        @ <input type="button" value="Fill out captcha" onclick="document.getElementById('u').value='anonymous'; document.getElementById('p').value='%s(zDecoded)';"/>
+    if( bAutoCaptcha ) {
+        @ <input type="button" value="Fill out captcha"
+        @  onclick="document.getElementById('u').value='anonymous';
+        @           document.getElementById('p').value='%s(zDecoded)';"/>
     }
     @ </center>
     free(zCaptcha);
   }
   if( g.zLogin ){

Modified src/setup.c from [800f3104a6] to [63e15c6923].

@@ -269,11 +269,10 @@
   ** modified user record.  After writing the user record, redirect
   ** to the page that displays a list of users.
   */
   doWrite = cgi_all("login","info","pw") && !higherUser;
   if( doWrite ){
-    char const * anonLoginCheckedbox = PD("anonymousEnableAutofill",0);
     char zCap[50];
     int i = 0;
     int aa = P("aa")!=0;
     int ad = P("ad")!=0;
     int ae = P("ae")!=0;
@@ -338,16 +337,10 @@
     db_multi_exec(
        "REPLACE INTO user(uid,login,info,pw,cap) "
        "VALUES(nullif(%d,0),%Q,%Q,%Q,'%s')",
       uid, P("login"), P("info"), zPw, zCap
     );
-    if( anonLoginCheckedbox && (*anonLoginCheckedbox) ){
-      db_set( "anon-login-enable-captcha-filler", "on", 0 );
-    }
-    else{
-      db_set( "anon-login-enable-captcha-filler", "off", 0 );
-    }
     cgi_redirect("setup_ulist");
     return;
   }
 
   /* Load the existing information about the user, if any
@@ -813,10 +806,18 @@
 
   @ <hr>
   onoff_attribute("Automatically synchronize with repository",
                   "autosync", "autosync", 1);
   @ <p>Automatically keeps your work in sync with a centralized server.</p>
+
+  @ <hr>
+  onoff_attribute("Show javascript button to fill in CAPTCHA",
+                  "auto-captcha", "auto-captcha", 0);
+  @ <p>When enabled, a button appears on the login screen for user
+  @ "anonymous" that will automatically fill in the CAPTCHA password.
+  @ This is less secure that forcing the user to do it manually, but is
+  @ usually secure enough.</p>
 
   @ <hr>
   onoff_attribute("Sign all commits with GPG",
                   "clearsign", "clearsign", 1);
   @ <p>When enabled (the default), fossil will attempt to