Fossil SCM
Try to always use /ckout as the start page for "fossil ui" invocations, even on remote hosts, unless something else is specified by the user.
Commit
58849c4098eadb17b2083bc98050c8b043699fffcd378a0a5fc49094e837f5e8
Parent
db2f309787b18b1…
2 files changed
+1
-1
+12
-9
+1
-1
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -620,11 +620,11 @@ | ||
| 620 | 620 | int diffType; /* 0: no diff, 1: unified, 2: side-by-side */ |
| 621 | 621 | DiffConfig DCfg,*pCfg; /* Diff details */ |
| 622 | 622 | Stmt q; |
| 623 | 623 | |
| 624 | 624 | if( zName || !db_open_local(0) || !cgi_is_loopback(g.zIpAddr) ){ |
| 625 | - webpage_notfound_error(0 /*works-like:""*/); | |
| 625 | + cgi_redirect("%R/home"); | |
| 626 | 626 | return; |
| 627 | 627 | } |
| 628 | 628 | diffType = preferred_diff_type(); |
| 629 | 629 | pCfg = construct_diff_flags(diffType, &DCfg); |
| 630 | 630 | vid = db_lget_int("checkout", 0); |
| 631 | 631 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -620,11 +620,11 @@ | |
| 620 | int diffType; /* 0: no diff, 1: unified, 2: side-by-side */ |
| 621 | DiffConfig DCfg,*pCfg; /* Diff details */ |
| 622 | Stmt q; |
| 623 | |
| 624 | if( zName || !db_open_local(0) || !cgi_is_loopback(g.zIpAddr) ){ |
| 625 | webpage_notfound_error(0 /*works-like:""*/); |
| 626 | return; |
| 627 | } |
| 628 | diffType = preferred_diff_type(); |
| 629 | pCfg = construct_diff_flags(diffType, &DCfg); |
| 630 | vid = db_lget_int("checkout", 0); |
| 631 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -620,11 +620,11 @@ | |
| 620 | int diffType; /* 0: no diff, 1: unified, 2: side-by-side */ |
| 621 | DiffConfig DCfg,*pCfg; /* Diff details */ |
| 622 | Stmt q; |
| 623 | |
| 624 | if( zName || !db_open_local(0) || !cgi_is_loopback(g.zIpAddr) ){ |
| 625 | cgi_redirect("%R/home"); |
| 626 | return; |
| 627 | } |
| 628 | diffType = preferred_diff_type(); |
| 629 | pCfg = construct_diff_flags(diffType, &DCfg); |
| 630 | vid = db_lget_int("checkout", 0); |
| 631 |
+12
-9
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -2040,20 +2040,27 @@ | ||
| 2040 | 2040 | */ |
| 2041 | 2041 | set_base_url(0); |
| 2042 | 2042 | if( fossil_redirect_to_https_if_needed(2) ) return; |
| 2043 | 2043 | if( zPathInfo==0 || zPathInfo[0]==0 |
| 2044 | 2044 | || (zPathInfo[0]=='/' && zPathInfo[1]==0) ){ |
| 2045 | - /* Second special case: If the PATH_INFO is blank, issue a redirect to | |
| 2046 | - ** the home page identified by the "index-page" setting in the repository | |
| 2047 | - ** CONFIG table, to "/index" if there no "index-page" setting. */ | |
| 2045 | + /* Second special case: If the PATH_INFO is blank, issue a redirect: | |
| 2046 | + ** (1) to "/ckout" if g.useLocalauth and g.localOpen are both set. | |
| 2047 | + ** (2) to the home page identified by the "index-page" setting | |
| 2048 | + ** in the repository CONFIG table | |
| 2049 | + ** (3) to "/index" if there no "index-page" setting in CONFIG | |
| 2050 | + */ | |
| 2048 | 2051 | #ifdef FOSSIL_ENABLE_JSON |
| 2049 | 2052 | if(g.json.isJsonMode){ |
| 2050 | 2053 | json_err(FSL_JSON_E_RESOURCE_NOT_FOUND,NULL,1); |
| 2051 | 2054 | fossil_exit(0); |
| 2052 | 2055 | } |
| 2053 | 2056 | #endif |
| 2054 | - fossil_redirect_home() /*does not return*/; | |
| 2057 | + if( g.useLocalauth && g.localOpen ){ | |
| 2058 | + cgi_redirectf("%R/ckout"); | |
| 2059 | + }else{ | |
| 2060 | + fossil_redirect_home() /*does not return*/; | |
| 2061 | + } | |
| 2055 | 2062 | }else{ |
| 2056 | 2063 | zPath = mprintf("%s", zPathInfo); |
| 2057 | 2064 | } |
| 2058 | 2065 | |
| 2059 | 2066 | /* Make g.zPath point to the first element of the path. Make |
| @@ -3384,15 +3391,11 @@ | ||
| 3384 | 3391 | } |
| 3385 | 3392 | if( !zRemote ){ |
| 3386 | 3393 | find_server_repository(findServerArg, fCreate); |
| 3387 | 3394 | } |
| 3388 | 3395 | if( zInitPage==0 ){ |
| 3389 | - if( isUiCmd && g.localOpen ){ | |
| 3390 | - zInitPage = "ckout"; | |
| 3391 | - }else{ | |
| 3392 | - zInitPage = ""; | |
| 3393 | - } | |
| 3396 | + zInitPage = ""; | |
| 3394 | 3397 | } |
| 3395 | 3398 | if( zPort ){ |
| 3396 | 3399 | if( strchr(zPort,':') ){ |
| 3397 | 3400 | int i; |
| 3398 | 3401 | for(i=strlen(zPort)-1; i>=0 && zPort[i]!=':'; i--){} |
| 3399 | 3402 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2040,20 +2040,27 @@ | |
| 2040 | */ |
| 2041 | set_base_url(0); |
| 2042 | if( fossil_redirect_to_https_if_needed(2) ) return; |
| 2043 | if( zPathInfo==0 || zPathInfo[0]==0 |
| 2044 | || (zPathInfo[0]=='/' && zPathInfo[1]==0) ){ |
| 2045 | /* Second special case: If the PATH_INFO is blank, issue a redirect to |
| 2046 | ** the home page identified by the "index-page" setting in the repository |
| 2047 | ** CONFIG table, to "/index" if there no "index-page" setting. */ |
| 2048 | #ifdef FOSSIL_ENABLE_JSON |
| 2049 | if(g.json.isJsonMode){ |
| 2050 | json_err(FSL_JSON_E_RESOURCE_NOT_FOUND,NULL,1); |
| 2051 | fossil_exit(0); |
| 2052 | } |
| 2053 | #endif |
| 2054 | fossil_redirect_home() /*does not return*/; |
| 2055 | }else{ |
| 2056 | zPath = mprintf("%s", zPathInfo); |
| 2057 | } |
| 2058 | |
| 2059 | /* Make g.zPath point to the first element of the path. Make |
| @@ -3384,15 +3391,11 @@ | |
| 3384 | } |
| 3385 | if( !zRemote ){ |
| 3386 | find_server_repository(findServerArg, fCreate); |
| 3387 | } |
| 3388 | if( zInitPage==0 ){ |
| 3389 | if( isUiCmd && g.localOpen ){ |
| 3390 | zInitPage = "ckout"; |
| 3391 | }else{ |
| 3392 | zInitPage = ""; |
| 3393 | } |
| 3394 | } |
| 3395 | if( zPort ){ |
| 3396 | if( strchr(zPort,':') ){ |
| 3397 | int i; |
| 3398 | for(i=strlen(zPort)-1; i>=0 && zPort[i]!=':'; i--){} |
| 3399 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2040,20 +2040,27 @@ | |
| 2040 | */ |
| 2041 | set_base_url(0); |
| 2042 | if( fossil_redirect_to_https_if_needed(2) ) return; |
| 2043 | if( zPathInfo==0 || zPathInfo[0]==0 |
| 2044 | || (zPathInfo[0]=='/' && zPathInfo[1]==0) ){ |
| 2045 | /* Second special case: If the PATH_INFO is blank, issue a redirect: |
| 2046 | ** (1) to "/ckout" if g.useLocalauth and g.localOpen are both set. |
| 2047 | ** (2) to the home page identified by the "index-page" setting |
| 2048 | ** in the repository CONFIG table |
| 2049 | ** (3) to "/index" if there no "index-page" setting in CONFIG |
| 2050 | */ |
| 2051 | #ifdef FOSSIL_ENABLE_JSON |
| 2052 | if(g.json.isJsonMode){ |
| 2053 | json_err(FSL_JSON_E_RESOURCE_NOT_FOUND,NULL,1); |
| 2054 | fossil_exit(0); |
| 2055 | } |
| 2056 | #endif |
| 2057 | if( g.useLocalauth && g.localOpen ){ |
| 2058 | cgi_redirectf("%R/ckout"); |
| 2059 | }else{ |
| 2060 | fossil_redirect_home() /*does not return*/; |
| 2061 | } |
| 2062 | }else{ |
| 2063 | zPath = mprintf("%s", zPathInfo); |
| 2064 | } |
| 2065 | |
| 2066 | /* Make g.zPath point to the first element of the path. Make |
| @@ -3384,15 +3391,11 @@ | |
| 3391 | } |
| 3392 | if( !zRemote ){ |
| 3393 | find_server_repository(findServerArg, fCreate); |
| 3394 | } |
| 3395 | if( zInitPage==0 ){ |
| 3396 | zInitPage = ""; |
| 3397 | } |
| 3398 | if( zPort ){ |
| 3399 | if( strchr(zPort,':') ){ |
| 3400 | int i; |
| 3401 | for(i=strlen(zPort)-1; i>=0 && zPort[i]!=':'; i--){} |
| 3402 |