Fossil SCM

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.

drh 2009-12-18 22:01 trunk
Commit fe019f946b5853d9975b5e643f7b4505e4c0a268
3 files changed +14 -15 +6 -4 +8 -7
+14 -15
--- src/db.c
+++ src/db.c
@@ -1433,48 +1433,47 @@
14331433
** With a value argument it changes the property for the current repository.
14341434
**
14351435
** The "unset" command clears a property setting.
14361436
**
14371437
**
1438
-** anon-login-enable-captcha-filler
1439
-** If enabled, the Login page will provide a button
1438
+** auto-captcha If enabled, the Login page will provide a button
14401439
** which uses JavaScript to fill out the captcha for
1441
-** the user. (Most bots cannot use JavaScript.)
1440
+** the "anonymous" user. (Most bots cannot use JavaScript.)
14421441
**
14431442
** autosync If enabled, automatically pull prior to
14441443
** commit or update and automatically push
14451444
** after commit or tag or branch creation.
1445
+**
1446
+** clearsign When enabled (the default), fossil will attempt to
1447
+** sign all commits with gpg. When disabled, commits will
1448
+** be unsigned.
14461449
**
14471450
** diff-command External command to run when performing a diff.
14481451
** If undefined, the internal text diff will be used.
14491452
**
14501453
** dont-push Prevent this repository from pushing from client to
14511454
** server. Useful when setting up a private branch.
14521455
**
14531456
** editor Text editor command used for check-in comments.
1457
+**
1458
+** gdiff-command External command to run when performing a graphical
1459
+** diff. If undefined, text diff will be used.
14541460
**
14551461
** http-port The TCP/IP port number to use by the "server"
14561462
** and "ui" commands. Default: 8080
14571463
**
1458
-** gdiff-command External command to run when performing a graphical
1459
-** diff. If undefined, text diff will be used.
1460
-**
14611464
** localauth If enabled, require that HTTP connections from
14621465
** 127.0.0.1 be authenticated by password. If
14631466
** false, all HTTP requests from localhost have
14641467
** unrestricted access to the repository.
14651468
**
1466
-** clearsign When enabled (the default), fossil will attempt to
1467
-** sign all commits with gpg. When disabled, commits will
1468
-** be unsigned.
1469
+** mtime-changes Use file modification times (mtimes) to detect when
1470
+** files have been modified.
14691471
**
14701472
** pgp-command Command used to clear-sign manifests at check-in.
14711473
** The default is "gpg --clearsign -o ".
14721474
**
1473
-** mtime-changes Use file modification times (mtimes) to detect when
1474
-** files have been modified.
1475
-**
14761475
** proxy URL of the HTTP proxy. If undefined or "off" then
14771476
** the "http_proxy" environment variable is consulted.
14781477
** If the http_proxy environment variable is undefined
14791478
** then a direct HTTP connection is used.
14801479
**
@@ -1483,21 +1482,21 @@
14831482
** Defaults to "start" on windows, "open" on Mac,
14841483
** and "firefox" on Unix.
14851484
*/
14861485
void setting_cmd(void){
14871486
static const char *azName[] = {
1488
- "anon-login-enable-captcha-filler",
1487
+ "auto-captcha",
14891488
"autosync",
1489
+ "clearsign",
14901490
"diff-command",
14911491
"dont-push",
14921492
"editor",
14931493
"gdiff-command",
14941494
"http-port",
14951495
"localauth",
1496
- "clearsign",
1497
- "pgp-command",
14981496
"mtime-changes",
1497
+ "pgp-command",
14991498
"proxy",
15001499
"web-browser",
15011500
};
15021501
int i;
15031502
int globalFlag = find_option("global","g",0)!=0;
15041503
--- src/db.c
+++ src/db.c
@@ -1433,48 +1433,47 @@
1433 ** With a value argument it changes the property for the current repository.
1434 **
1435 ** The "unset" command clears a property setting.
1436 **
1437 **
1438 ** anon-login-enable-captcha-filler
1439 ** If enabled, the Login page will provide a button
1440 ** which uses JavaScript to fill out the captcha for
1441 ** the user. (Most bots cannot use JavaScript.)
1442 **
1443 ** autosync If enabled, automatically pull prior to
1444 ** commit or update and automatically push
1445 ** after commit or tag or branch creation.
 
 
 
 
1446 **
1447 ** diff-command External command to run when performing a diff.
1448 ** If undefined, the internal text diff will be used.
1449 **
1450 ** dont-push Prevent this repository from pushing from client to
1451 ** server. Useful when setting up a private branch.
1452 **
1453 ** editor Text editor command used for check-in comments.
 
 
 
1454 **
1455 ** http-port The TCP/IP port number to use by the "server"
1456 ** and "ui" commands. Default: 8080
1457 **
1458 ** gdiff-command External command to run when performing a graphical
1459 ** diff. If undefined, text diff will be used.
1460 **
1461 ** localauth If enabled, require that HTTP connections from
1462 ** 127.0.0.1 be authenticated by password. If
1463 ** false, all HTTP requests from localhost have
1464 ** unrestricted access to the repository.
1465 **
1466 ** clearsign When enabled (the default), fossil will attempt to
1467 ** sign all commits with gpg. When disabled, commits will
1468 ** be unsigned.
1469 **
1470 ** pgp-command Command used to clear-sign manifests at check-in.
1471 ** The default is "gpg --clearsign -o ".
1472 **
1473 ** mtime-changes Use file modification times (mtimes) to detect when
1474 ** files have been modified.
1475 **
1476 ** proxy URL of the HTTP proxy. If undefined or "off" then
1477 ** the "http_proxy" environment variable is consulted.
1478 ** If the http_proxy environment variable is undefined
1479 ** then a direct HTTP connection is used.
1480 **
@@ -1483,21 +1482,21 @@
1483 ** Defaults to "start" on windows, "open" on Mac,
1484 ** and "firefox" on Unix.
1485 */
1486 void setting_cmd(void){
1487 static const char *azName[] = {
1488 "anon-login-enable-captcha-filler",
1489 "autosync",
 
1490 "diff-command",
1491 "dont-push",
1492 "editor",
1493 "gdiff-command",
1494 "http-port",
1495 "localauth",
1496 "clearsign",
1497 "pgp-command",
1498 "mtime-changes",
 
1499 "proxy",
1500 "web-browser",
1501 };
1502 int i;
1503 int globalFlag = find_option("global","g",0)!=0;
1504
--- src/db.c
+++ src/db.c
@@ -1433,48 +1433,47 @@
1433 ** With a value argument it changes the property for the current repository.
1434 **
1435 ** The "unset" command clears a property setting.
1436 **
1437 **
1438 ** auto-captcha If enabled, the Login page will provide a button
 
1439 ** which uses JavaScript to fill out the captcha for
1440 ** the "anonymous" user. (Most bots cannot use JavaScript.)
1441 **
1442 ** autosync If enabled, automatically pull prior to
1443 ** commit or update and automatically push
1444 ** after commit or tag or branch creation.
1445 **
1446 ** clearsign When enabled (the default), fossil will attempt to
1447 ** sign all commits with gpg. When disabled, commits will
1448 ** be unsigned.
1449 **
1450 ** diff-command External command to run when performing a diff.
1451 ** If undefined, the internal text diff will be used.
1452 **
1453 ** dont-push Prevent this repository from pushing from client to
1454 ** server. Useful when setting up a private branch.
1455 **
1456 ** editor Text editor command used for check-in comments.
1457 **
1458 ** gdiff-command External command to run when performing a graphical
1459 ** diff. If undefined, text diff will be used.
1460 **
1461 ** http-port The TCP/IP port number to use by the "server"
1462 ** and "ui" commands. Default: 8080
1463 **
 
 
 
1464 ** localauth If enabled, require that HTTP connections from
1465 ** 127.0.0.1 be authenticated by password. If
1466 ** false, all HTTP requests from localhost have
1467 ** unrestricted access to the repository.
1468 **
1469 ** mtime-changes Use file modification times (mtimes) to detect when
1470 ** files have been modified.
 
1471 **
1472 ** pgp-command Command used to clear-sign manifests at check-in.
1473 ** The default is "gpg --clearsign -o ".
1474 **
 
 
 
1475 ** proxy URL of the HTTP proxy. If undefined or "off" then
1476 ** the "http_proxy" environment variable is consulted.
1477 ** If the http_proxy environment variable is undefined
1478 ** then a direct HTTP connection is used.
1479 **
@@ -1483,21 +1482,21 @@
1482 ** Defaults to "start" on windows, "open" on Mac,
1483 ** and "firefox" on Unix.
1484 */
1485 void setting_cmd(void){
1486 static const char *azName[] = {
1487 "auto-captcha",
1488 "autosync",
1489 "clearsign",
1490 "diff-command",
1491 "dont-push",
1492 "editor",
1493 "gdiff-command",
1494 "http-port",
1495 "localauth",
 
 
1496 "mtime-changes",
1497 "pgp-command",
1498 "proxy",
1499 "web-browser",
1500 };
1501 int i;
1502 int globalFlag = find_option("global","g",0)!=0;
1503
+6 -4
--- src/login.c
+++ src/login.c
@@ -250,22 +250,24 @@
250250
@ "Login" button. Your user name will be stored in a browser cookie.
251251
@ You must configure your web browser to accept cookies in order for
252252
@ the login to take.</p>
253253
if( zAnonPw ){
254254
unsigned int uSeed = captcha_seed();
255
- char const * zDecoded = captcha_decode(uSeed);
256
- int iAllowPasswordFill = db_get_boolean( "anon-login-enable-captcha-filler", 0 );
255
+ char const *zDecoded = captcha_decode(uSeed);
256
+ int bAutoCaptcha = db_get_boolean("auto-captcha", 0);
257257
char *zCaptcha = captcha_render(zDecoded);
258258
259259
@ <input type="hidden" name="cs" value="%u(uSeed)"/>
260260
@ <p>Visitors may enter <b>anonymous</b> as the user-ID with
261261
@ the 8-character hexadecimal password shown below:</p>
262262
@ <center><table border="1" cellpadding="10"><tr><td><pre>
263263
@ %s(zCaptcha)
264264
@ </pre></td></tr></table>
265
- if( iAllowPasswordFill ) {
266
- @ <input type="button" value="Fill out captcha" onclick="document.getElementById('u').value='anonymous'; document.getElementById('p').value='%s(zDecoded)';"/>
265
+ if( bAutoCaptcha ) {
266
+ @ <input type="button" value="Fill out captcha"
267
+ @ onclick="document.getElementById('u').value='anonymous';
268
+ @ document.getElementById('p').value='%s(zDecoded)';"/>
267269
}
268270
@ </center>
269271
free(zCaptcha);
270272
}
271273
if( g.zLogin ){
272274
--- src/login.c
+++ src/login.c
@@ -250,22 +250,24 @@
250 @ "Login" button. Your user name will be stored in a browser cookie.
251 @ You must configure your web browser to accept cookies in order for
252 @ the login to take.</p>
253 if( zAnonPw ){
254 unsigned int uSeed = captcha_seed();
255 char const * zDecoded = captcha_decode(uSeed);
256 int iAllowPasswordFill = db_get_boolean( "anon-login-enable-captcha-filler", 0 );
257 char *zCaptcha = captcha_render(zDecoded);
258
259 @ <input type="hidden" name="cs" value="%u(uSeed)"/>
260 @ <p>Visitors may enter <b>anonymous</b> as the user-ID with
261 @ the 8-character hexadecimal password shown below:</p>
262 @ <center><table border="1" cellpadding="10"><tr><td><pre>
263 @ %s(zCaptcha)
264 @ </pre></td></tr></table>
265 if( iAllowPasswordFill ) {
266 @ <input type="button" value="Fill out captcha" onclick="document.getElementById('u').value='anonymous'; document.getElementById('p').value='%s(zDecoded)';"/>
 
 
267 }
268 @ </center>
269 free(zCaptcha);
270 }
271 if( g.zLogin ){
272
--- src/login.c
+++ src/login.c
@@ -250,22 +250,24 @@
250 @ "Login" button. Your user name will be stored in a browser cookie.
251 @ You must configure your web browser to accept cookies in order for
252 @ the login to take.</p>
253 if( zAnonPw ){
254 unsigned int uSeed = captcha_seed();
255 char const *zDecoded = captcha_decode(uSeed);
256 int bAutoCaptcha = db_get_boolean("auto-captcha", 0);
257 char *zCaptcha = captcha_render(zDecoded);
258
259 @ <input type="hidden" name="cs" value="%u(uSeed)"/>
260 @ <p>Visitors may enter <b>anonymous</b> as the user-ID with
261 @ the 8-character hexadecimal password shown below:</p>
262 @ <center><table border="1" cellpadding="10"><tr><td><pre>
263 @ %s(zCaptcha)
264 @ </pre></td></tr></table>
265 if( bAutoCaptcha ) {
266 @ <input type="button" value="Fill out captcha"
267 @ onclick="document.getElementById('u').value='anonymous';
268 @ document.getElementById('p').value='%s(zDecoded)';"/>
269 }
270 @ </center>
271 free(zCaptcha);
272 }
273 if( g.zLogin ){
274
+8 -7
--- src/setup.c
+++ src/setup.c
@@ -269,11 +269,10 @@
269269
** modified user record. After writing the user record, redirect
270270
** to the page that displays a list of users.
271271
*/
272272
doWrite = cgi_all("login","info","pw") && !higherUser;
273273
if( doWrite ){
274
- char const * anonLoginCheckedbox = PD("anonymousEnableAutofill",0);
275274
char zCap[50];
276275
int i = 0;
277276
int aa = P("aa")!=0;
278277
int ad = P("ad")!=0;
279278
int ae = P("ae")!=0;
@@ -338,16 +337,10 @@
338337
db_multi_exec(
339338
"REPLACE INTO user(uid,login,info,pw,cap) "
340339
"VALUES(nullif(%d,0),%Q,%Q,%Q,'%s')",
341340
uid, P("login"), P("info"), zPw, zCap
342341
);
343
- if( anonLoginCheckedbox && (*anonLoginCheckedbox) ){
344
- db_set( "anon-login-enable-captcha-filler", "on", 0 );
345
- }
346
- else{
347
- db_set( "anon-login-enable-captcha-filler", "off", 0 );
348
- }
349342
cgi_redirect("setup_ulist");
350343
return;
351344
}
352345
353346
/* Load the existing information about the user, if any
@@ -814,10 +807,18 @@
814807
@ <hr>
815808
onoff_attribute("Automatically synchronize with repository",
816809
"autosync", "autosync", 1);
817810
@ <p>Automatically keeps your work in sync with a centralized server.</p>
818811
812
+ @ <hr>
813
+ onoff_attribute("Show javascript button to fill in CAPTCHA",
814
+ "auto-captcha", "auto-captcha", 0);
815
+ @ <p>When enabled, a button appears on the login screen for user
816
+ @ "anonymous" that will automatically fill in the CAPTCHA password.
817
+ @ This is less secure that forcing the user to do it manually, but is
818
+ @ usually secure enough.</p>
819
+
819820
@ <hr>
820821
onoff_attribute("Sign all commits with GPG",
821822
"clearsign", "clearsign", 1);
822823
@ <p>When enabled (the default), fossil will attempt to
823824
@ sign all commits with GPG. When disabled, commits will
824825
--- src/setup.c
+++ src/setup.c
@@ -269,11 +269,10 @@
269 ** modified user record. After writing the user record, redirect
270 ** to the page that displays a list of users.
271 */
272 doWrite = cgi_all("login","info","pw") && !higherUser;
273 if( doWrite ){
274 char const * anonLoginCheckedbox = PD("anonymousEnableAutofill",0);
275 char zCap[50];
276 int i = 0;
277 int aa = P("aa")!=0;
278 int ad = P("ad")!=0;
279 int ae = P("ae")!=0;
@@ -338,16 +337,10 @@
338 db_multi_exec(
339 "REPLACE INTO user(uid,login,info,pw,cap) "
340 "VALUES(nullif(%d,0),%Q,%Q,%Q,'%s')",
341 uid, P("login"), P("info"), zPw, zCap
342 );
343 if( anonLoginCheckedbox && (*anonLoginCheckedbox) ){
344 db_set( "anon-login-enable-captcha-filler", "on", 0 );
345 }
346 else{
347 db_set( "anon-login-enable-captcha-filler", "off", 0 );
348 }
349 cgi_redirect("setup_ulist");
350 return;
351 }
352
353 /* Load the existing information about the user, if any
@@ -814,10 +807,18 @@
814 @ <hr>
815 onoff_attribute("Automatically synchronize with repository",
816 "autosync", "autosync", 1);
817 @ <p>Automatically keeps your work in sync with a centralized server.</p>
818
 
 
 
 
 
 
 
 
819 @ <hr>
820 onoff_attribute("Sign all commits with GPG",
821 "clearsign", "clearsign", 1);
822 @ <p>When enabled (the default), fossil will attempt to
823 @ sign all commits with GPG. When disabled, commits will
824
--- src/setup.c
+++ src/setup.c
@@ -269,11 +269,10 @@
269 ** modified user record. After writing the user record, redirect
270 ** to the page that displays a list of users.
271 */
272 doWrite = cgi_all("login","info","pw") && !higherUser;
273 if( doWrite ){
 
274 char zCap[50];
275 int i = 0;
276 int aa = P("aa")!=0;
277 int ad = P("ad")!=0;
278 int ae = P("ae")!=0;
@@ -338,16 +337,10 @@
337 db_multi_exec(
338 "REPLACE INTO user(uid,login,info,pw,cap) "
339 "VALUES(nullif(%d,0),%Q,%Q,%Q,'%s')",
340 uid, P("login"), P("info"), zPw, zCap
341 );
 
 
 
 
 
 
342 cgi_redirect("setup_ulist");
343 return;
344 }
345
346 /* Load the existing information about the user, if any
@@ -814,10 +807,18 @@
807 @ <hr>
808 onoff_attribute("Automatically synchronize with repository",
809 "autosync", "autosync", 1);
810 @ <p>Automatically keeps your work in sync with a centralized server.</p>
811
812 @ <hr>
813 onoff_attribute("Show javascript button to fill in CAPTCHA",
814 "auto-captcha", "auto-captcha", 0);
815 @ <p>When enabled, a button appears on the login screen for user
816 @ "anonymous" that will automatically fill in the CAPTCHA password.
817 @ This is less secure that forcing the user to do it manually, but is
818 @ usually secure enough.</p>
819
820 @ <hr>
821 onoff_attribute("Sign all commits with GPG",
822 "clearsign", "clearsign", 1);
823 @ <p>When enabled (the default), fossil will attempt to
824 @ sign all commits with GPG. When disabled, commits will
825

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button