Fossil SCM
Merge change to fossil ui which first looks for default user if set before falling back to the Setup user.
Commit
1460b7476ff5e4c35e8dda590fdbca41503d195e
Parent
ff159bfdd76da13…
3 files changed
+7
-1
+1
+1
+7
-1
| --- src/login.c | ||
| +++ src/login.c | ||
| @@ -778,10 +778,11 @@ | ||
| 778 | 778 | const char *zCookie; /* Text of the login cookie */ |
| 779 | 779 | const char *zIpAddr; /* Raw IP address of the requestor */ |
| 780 | 780 | char *zRemoteAddr; /* Abbreviated IP address of the requestor */ |
| 781 | 781 | const char *zCap = 0; /* Capability string */ |
| 782 | 782 | const char *zPublicPages = 0; /* GLOB patterns of public pages */ |
| 783 | + const char *zLogin = 0; /* Login user for credentials */ | |
| 783 | 784 | |
| 784 | 785 | /* Only run this check once. */ |
| 785 | 786 | if( g.userUid!=0 ) return; |
| 786 | 787 | |
| 787 | 788 | sqlite3_create_function(g.db, "constant_time_cmp", 2, SQLITE_UTF8, 0, |
| @@ -799,11 +800,16 @@ | ||
| 799 | 800 | g.fSshClient & CGI_SSH_CLIENT ) |
| 800 | 801 | && g.useLocalauth |
| 801 | 802 | && db_get_int("localauth",0)==0 |
| 802 | 803 | && P("HTTPS")==0 |
| 803 | 804 | ){ |
| 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 | + } | |
| 805 | 811 | g.zLogin = db_text("?", "SELECT login FROM user WHERE uid=%d", uid); |
| 806 | 812 | zCap = "sx"; |
| 807 | 813 | g.noPswd = 1; |
| 808 | 814 | g.isHuman = 1; |
| 809 | 815 | sqlite3_snprintf(sizeof(g.zCsrfToken), g.zCsrfToken, "localhost"); |
| 810 | 816 |
| --- 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 |
+1
| --- www/changes.wiki | ||
| +++ www/changes.wiki | ||
| @@ -29,10 +29,11 @@ | ||
| 29 | 29 | Use "-n 0" if no limit is desired, the end of timeline marker will |
| 30 | 30 | not be printed then. |
| 31 | 31 | * Fix handling of password embedded in Fossil URL. |
| 32 | 32 | * New --once option to [/help?cmd=clone | fossil clone] command which does |
| 33 | 33 | not store the URL or password when cloning. |
| 34 | + * Modify [/help?cmd=ui | fossil ui] to respect "default user" in open repository. | |
| 34 | 35 | |
| 35 | 36 | <h2>Changes For Version 1.27 (2013-09-11)</h2> |
| 36 | 37 | * Enhance the [/help?cmd=changes | fossil changes], |
| 37 | 38 | [/help?cmd=clean | fossil clean], [/help?cmd=extras | fossil extras], |
| 38 | 39 | [/help?cmd=ls | fossil ls] and [/help?cmd=status | fossil status] commands |
| 39 | 40 |
| --- 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 |
+1
| --- www/changes.wiki | ||
| +++ www/changes.wiki | ||
| @@ -29,10 +29,11 @@ | ||
| 29 | 29 | Use "-n 0" if no limit is desired, the end of timeline marker will |
| 30 | 30 | not be printed then. |
| 31 | 31 | * Fix handling of password embedded in Fossil URL. |
| 32 | 32 | * New --once option to [/help?cmd=clone | fossil clone] command which does |
| 33 | 33 | not store the URL or password when cloning. |
| 34 | + * Modify [/help?cmd=ui | fossil ui] to respect "default user" in open repository. | |
| 34 | 35 | |
| 35 | 36 | <h2>Changes For Version 1.27 (2013-09-11)</h2> |
| 36 | 37 | * Enhance the [/help?cmd=changes | fossil changes], |
| 37 | 38 | [/help?cmd=clean | fossil clean], [/help?cmd=extras | fossil extras], |
| 38 | 39 | [/help?cmd=ls | fossil ls] and [/help?cmd=status | fossil status] commands |
| 39 | 40 |
| --- 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 |