Fossil

Check-in [58849c4098]
Login

Check-in [58849c4098]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: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.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 58849c4098eadb17b2083bc98050c8b043699fffcd378a0a5fc49094e837f5e8
User & Date: drh 2024-12-10 18:18:52.463
Context
2024-12-10
18:24
Improved title on the /ckout page. ... (check-in: 842daebb22 user: drh tags: trunk)
18:18
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. ... (check-in: 58849c4098 user: drh tags: trunk)
16:57
Change the default page for the "fossil ui" command to the new /ckout page. ... (check-in: db2f309787 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/info.c.
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
  char *zHostname;
  char *zCwd;
  int diffType;               /* 0: no diff,  1: unified,  2: side-by-side */
  DiffConfig DCfg,*pCfg;      /* Diff details */
  Stmt q;

  if( zName || !db_open_local(0) || !cgi_is_loopback(g.zIpAddr) ){
    webpage_notfound_error(0 /*works-like:""*/);
    return;
  }
  diffType = preferred_diff_type();
  pCfg = construct_diff_flags(diffType, &DCfg);
  vid = db_lget_int("checkout", 0);
  db_unprotect(PROTECT_ALL);
  vfile_check_signature(vid, CKSIG_ENOTFILE);







|







618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
  char *zHostname;
  char *zCwd;
  int diffType;               /* 0: no diff,  1: unified,  2: side-by-side */
  DiffConfig DCfg,*pCfg;      /* Diff details */
  Stmt q;

  if( zName || !db_open_local(0) || !cgi_is_loopback(g.zIpAddr) ){
    cgi_redirect("%R/home");
    return;
  }
  diffType = preferred_diff_type();
  pCfg = construct_diff_flags(diffType, &DCfg);
  vid = db_lget_int("checkout", 0);
  db_unprotect(PROTECT_ALL);
  vfile_check_signature(vid, CKSIG_ENOTFILE);
Changes to src/main.c.
2038
2039
2040
2041
2042
2043
2044
2045

2046

2047

2048
2049
2050
2051
2052
2053



2054

2055
2056
2057
2058
2059
2060
2061
  /* Use the first element of PATH_INFO as the page name
  ** and deliver the appropriate page back to the user.
  */
  set_base_url(0);
  if( fossil_redirect_to_https_if_needed(2) ) return;
  if( zPathInfo==0 || zPathInfo[0]==0
      || (zPathInfo[0]=='/' && zPathInfo[1]==0) ){
    /* Second special case: If the PATH_INFO is blank, issue a redirect to

    ** the home page identified by the "index-page" setting in the repository

    ** CONFIG table, to "/index" if there no "index-page" setting. */

#ifdef FOSSIL_ENABLE_JSON
    if(g.json.isJsonMode){
      json_err(FSL_JSON_E_RESOURCE_NOT_FOUND,NULL,1);
      fossil_exit(0);
    }
#endif



    fossil_redirect_home() /*does not return*/;

  }else{
    zPath = mprintf("%s", zPathInfo);
  }

  /* Make g.zPath point to the first element of the path.  Make
  ** g.zExtra point to everything past that point.
  */







|
>
|
>
|
>






>
>
>
|
>







2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
  /* Use the first element of PATH_INFO as the page name
  ** and deliver the appropriate page back to the user.
  */
  set_base_url(0);
  if( fossil_redirect_to_https_if_needed(2) ) return;
  if( zPathInfo==0 || zPathInfo[0]==0
      || (zPathInfo[0]=='/' && zPathInfo[1]==0) ){
    /* Second special case: If the PATH_INFO is blank, issue a redirect:
    **    (1) to "/ckout" if g.useLocalauth and g.localOpen are both set.
    **    (2) to the home page identified by the "index-page" setting
    **        in the repository CONFIG table
    **    (3) to "/index" if there no "index-page" setting in CONFIG
    */
#ifdef FOSSIL_ENABLE_JSON
    if(g.json.isJsonMode){
      json_err(FSL_JSON_E_RESOURCE_NOT_FOUND,NULL,1);
      fossil_exit(0);
    }
#endif
    if( g.useLocalauth && g.localOpen ){
      cgi_redirectf("%R/ckout");
    }else{
      fossil_redirect_home() /*does not return*/;
    }
  }else{
    zPath = mprintf("%s", zPathInfo);
  }

  /* Make g.zPath point to the first element of the path.  Make
  ** g.zExtra point to everything past that point.
  */
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
    g.useLocalauth = 1;
    allowRepoList = 1;
  }
  if( !zRemote ){
    find_server_repository(findServerArg, fCreate);
  }
  if( zInitPage==0 ){
    if( isUiCmd && g.localOpen ){
      zInitPage = "ckout";
    }else{
      zInitPage = "";
    }
  }
  if( zPort ){
    if( strchr(zPort,':') ){
      int i;
      for(i=strlen(zPort)-1; i>=0 && zPort[i]!=':'; i--){}
      if( i>0 ){
        if( zPort[0]=='[' && zPort[i-1]==']' ){







<
<
<
|
<







3389
3390
3391
3392
3393
3394
3395



3396

3397
3398
3399
3400
3401
3402
3403
    g.useLocalauth = 1;
    allowRepoList = 1;
  }
  if( !zRemote ){
    find_server_repository(findServerArg, fCreate);
  }
  if( zInitPage==0 ){



    zInitPage = "";

  }
  if( zPort ){
    if( strchr(zPort,':') ){
      int i;
      for(i=strlen(zPort)-1; i>=0 && zPort[i]!=':'; i--){}
      if( i>0 ){
        if( zPort[0]=='[' && zPort[i-1]==']' ){