Fossil SCM

Merge change to fossil ui which first looks for default user if set before falling back to the Setup user.

andybradford 2013-11-12 03:43 trunk merge
Commit 1460b7476ff5e4c35e8dda590fdbca41503d195e
+7 -1
--- src/login.c
+++ src/login.c
@@ -778,10 +778,11 @@
778778
const char *zCookie; /* Text of the login cookie */
779779
const char *zIpAddr; /* Raw IP address of the requestor */
780780
char *zRemoteAddr; /* Abbreviated IP address of the requestor */
781781
const char *zCap = 0; /* Capability string */
782782
const char *zPublicPages = 0; /* GLOB patterns of public pages */
783
+ const char *zLogin = 0; /* Login user for credentials */
783784
784785
/* Only run this check once. */
785786
if( g.userUid!=0 ) return;
786787
787788
sqlite3_create_function(g.db, "constant_time_cmp", 2, SQLITE_UTF8, 0,
@@ -799,11 +800,16 @@
799800
g.fSshClient & CGI_SSH_CLIENT )
800801
&& g.useLocalauth
801802
&& db_get_int("localauth",0)==0
802803
&& P("HTTPS")==0
803804
){
804
- uid = db_int(0, "SELECT uid FROM user WHERE cap LIKE '%%s%%'");
805
+ if( g.localOpen ) zLogin = db_lget("default-user",0);
806
+ if( zLogin!=0 ){
807
+ uid = db_int(0, "SELECT uid FROM user WHERE login=%Q", zLogin);
808
+ }else{
809
+ uid = db_int(0, "SELECT uid FROM user WHERE cap LIKE '%%s%%'");
810
+ }
805811
g.zLogin = db_text("?", "SELECT login FROM user WHERE uid=%d", uid);
806812
zCap = "sx";
807813
g.noPswd = 1;
808814
g.isHuman = 1;
809815
sqlite3_snprintf(sizeof(g.zCsrfToken), g.zCsrfToken, "localhost");
810816
--- src/login.c
+++ src/login.c
@@ -778,10 +778,11 @@
778 const char *zCookie; /* Text of the login cookie */
779 const char *zIpAddr; /* Raw IP address of the requestor */
780 char *zRemoteAddr; /* Abbreviated IP address of the requestor */
781 const char *zCap = 0; /* Capability string */
782 const char *zPublicPages = 0; /* GLOB patterns of public pages */
 
783
784 /* Only run this check once. */
785 if( g.userUid!=0 ) return;
786
787 sqlite3_create_function(g.db, "constant_time_cmp", 2, SQLITE_UTF8, 0,
@@ -799,11 +800,16 @@
799 g.fSshClient & CGI_SSH_CLIENT )
800 && g.useLocalauth
801 && db_get_int("localauth",0)==0
802 && P("HTTPS")==0
803 ){
804 uid = db_int(0, "SELECT uid FROM user WHERE cap LIKE '%%s%%'");
 
 
 
 
 
805 g.zLogin = db_text("?", "SELECT login FROM user WHERE uid=%d", uid);
806 zCap = "sx";
807 g.noPswd = 1;
808 g.isHuman = 1;
809 sqlite3_snprintf(sizeof(g.zCsrfToken), g.zCsrfToken, "localhost");
810
--- src/login.c
+++ src/login.c
@@ -778,10 +778,11 @@
778 const char *zCookie; /* Text of the login cookie */
779 const char *zIpAddr; /* Raw IP address of the requestor */
780 char *zRemoteAddr; /* Abbreviated IP address of the requestor */
781 const char *zCap = 0; /* Capability string */
782 const char *zPublicPages = 0; /* GLOB patterns of public pages */
783 const char *zLogin = 0; /* Login user for credentials */
784
785 /* Only run this check once. */
786 if( g.userUid!=0 ) return;
787
788 sqlite3_create_function(g.db, "constant_time_cmp", 2, SQLITE_UTF8, 0,
@@ -799,11 +800,16 @@
800 g.fSshClient & CGI_SSH_CLIENT )
801 && g.useLocalauth
802 && db_get_int("localauth",0)==0
803 && P("HTTPS")==0
804 ){
805 if( g.localOpen ) zLogin = db_lget("default-user",0);
806 if( zLogin!=0 ){
807 uid = db_int(0, "SELECT uid FROM user WHERE login=%Q", zLogin);
808 }else{
809 uid = db_int(0, "SELECT uid FROM user WHERE cap LIKE '%%s%%'");
810 }
811 g.zLogin = db_text("?", "SELECT login FROM user WHERE uid=%d", uid);
812 zCap = "sx";
813 g.noPswd = 1;
814 g.isHuman = 1;
815 sqlite3_snprintf(sizeof(g.zCsrfToken), g.zCsrfToken, "localhost");
816
--- www/changes.wiki
+++ www/changes.wiki
@@ -29,10 +29,11 @@
2929
Use "-n 0" if no limit is desired, the end of timeline marker will
3030
not be printed then.
3131
* Fix handling of password embedded in Fossil URL.
3232
* New --once option to [/help?cmd=clone | fossil clone] command which does
3333
not store the URL or password when cloning.
34
+ * Modify [/help?cmd=ui | fossil ui] to respect "default user" in open repository.
3435
3536
<h2>Changes For Version 1.27 (2013-09-11)</h2>
3637
* Enhance the [/help?cmd=changes | fossil changes],
3738
[/help?cmd=clean | fossil clean], [/help?cmd=extras | fossil extras],
3839
[/help?cmd=ls | fossil ls] and [/help?cmd=status | fossil status] commands
3940
--- www/changes.wiki
+++ www/changes.wiki
@@ -29,10 +29,11 @@
29 Use "-n 0" if no limit is desired, the end of timeline marker will
30 not be printed then.
31 * Fix handling of password embedded in Fossil URL.
32 * New --once option to [/help?cmd=clone | fossil clone] command which does
33 not store the URL or password when cloning.
 
34
35 <h2>Changes For Version 1.27 (2013-09-11)</h2>
36 * Enhance the [/help?cmd=changes | fossil changes],
37 [/help?cmd=clean | fossil clean], [/help?cmd=extras | fossil extras],
38 [/help?cmd=ls | fossil ls] and [/help?cmd=status | fossil status] commands
39
--- www/changes.wiki
+++ www/changes.wiki
@@ -29,10 +29,11 @@
29 Use "-n 0" if no limit is desired, the end of timeline marker will
30 not be printed then.
31 * Fix handling of password embedded in Fossil URL.
32 * New --once option to [/help?cmd=clone | fossil clone] command which does
33 not store the URL or password when cloning.
34 * Modify [/help?cmd=ui | fossil ui] to respect "default user" in open repository.
35
36 <h2>Changes For Version 1.27 (2013-09-11)</h2>
37 * Enhance the [/help?cmd=changes | fossil changes],
38 [/help?cmd=clean | fossil clean], [/help?cmd=extras | fossil extras],
39 [/help?cmd=ls | fossil ls] and [/help?cmd=status | fossil status] commands
40
--- www/changes.wiki
+++ www/changes.wiki
@@ -29,10 +29,11 @@
2929
Use "-n 0" if no limit is desired, the end of timeline marker will
3030
not be printed then.
3131
* Fix handling of password embedded in Fossil URL.
3232
* New --once option to [/help?cmd=clone | fossil clone] command which does
3333
not store the URL or password when cloning.
34
+ * Modify [/help?cmd=ui | fossil ui] to respect "default user" in open repository.
3435
3536
<h2>Changes For Version 1.27 (2013-09-11)</h2>
3637
* Enhance the [/help?cmd=changes | fossil changes],
3738
[/help?cmd=clean | fossil clean], [/help?cmd=extras | fossil extras],
3839
[/help?cmd=ls | fossil ls] and [/help?cmd=status | fossil status] commands
3940
--- www/changes.wiki
+++ www/changes.wiki
@@ -29,10 +29,11 @@
29 Use "-n 0" if no limit is desired, the end of timeline marker will
30 not be printed then.
31 * Fix handling of password embedded in Fossil URL.
32 * New --once option to [/help?cmd=clone | fossil clone] command which does
33 not store the URL or password when cloning.
 
34
35 <h2>Changes For Version 1.27 (2013-09-11)</h2>
36 * Enhance the [/help?cmd=changes | fossil changes],
37 [/help?cmd=clean | fossil clean], [/help?cmd=extras | fossil extras],
38 [/help?cmd=ls | fossil ls] and [/help?cmd=status | fossil status] commands
39
--- www/changes.wiki
+++ www/changes.wiki
@@ -29,10 +29,11 @@
29 Use "-n 0" if no limit is desired, the end of timeline marker will
30 not be printed then.
31 * Fix handling of password embedded in Fossil URL.
32 * New --once option to [/help?cmd=clone | fossil clone] command which does
33 not store the URL or password when cloning.
34 * Modify [/help?cmd=ui | fossil ui] to respect "default user" in open repository.
35
36 <h2>Changes For Version 1.27 (2013-09-11)</h2>
37 * Enhance the [/help?cmd=changes | fossil changes],
38 [/help?cmd=clean | fossil clean], [/help?cmd=extras | fossil extras],
39 [/help?cmd=ls | fossil ls] and [/help?cmd=status | fossil status] commands
40

Keyboard Shortcuts

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