Fossil SCM
Back out the "Home Page" configuration option added by [29374daa0d]
Commit
c51dd3058c54e2cd5cdfc57f8f9a77314ec860b9
Parent
1bbc5b7e6cb0e64…
2 files changed
-12
+10
-30
-12
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -601,22 +601,10 @@ | ||
| 601 | 601 | textarea_attribute("Project Description", 5, 60, |
| 602 | 602 | "project-description", "pd", ""); |
| 603 | 603 | @ <p>Describe your project. This will be used in page headers for search |
| 604 | 604 | @ engines as well as a short RSS description.</p> |
| 605 | 605 | @ <hr /> |
| 606 | - entry_attribute("Home page", 60, "project-home", "phome", ""); | |
| 607 | - @ <p>This sets the content source for the Home page ([/home]). | |
| 608 | - @ Enter a wiki page name (as wiki/PageName) or another URL relative to | |
| 609 | - @ this server's root (%s(g.zBaseURL)/). | |
| 610 | - @ The default is to use wiki/ProjectName. Make sure to use a valid name, | |
| 611 | - @ or your /home link will likely crash! (If that happens, simply come back | |
| 612 | - @ to this page and set it to a good (or empty) value.) | |
| 613 | - @ To use .wiki or .html files in your source tree as content, use a URL | |
| 614 | - @ in the form <tt>doc/VERSION/path/to/doc.wiki</tt>, where VERSION is either | |
| 615 | - @ the UUID of a version of that page or the word 'tip' to get the most recent | |
| 616 | - @ version.</p> | |
| 617 | - @ <hr /> | |
| 618 | 606 | @ <p><input type="submit" name="submit" value="Apply Changes"></p> |
| 619 | 607 | @ </form> |
| 620 | 608 | db_end_transaction(0); |
| 621 | 609 | style_footer(); |
| 622 | 610 | } |
| 623 | 611 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -601,22 +601,10 @@ | |
| 601 | textarea_attribute("Project Description", 5, 60, |
| 602 | "project-description", "pd", ""); |
| 603 | @ <p>Describe your project. This will be used in page headers for search |
| 604 | @ engines as well as a short RSS description.</p> |
| 605 | @ <hr /> |
| 606 | entry_attribute("Home page", 60, "project-home", "phome", ""); |
| 607 | @ <p>This sets the content source for the Home page ([/home]). |
| 608 | @ Enter a wiki page name (as wiki/PageName) or another URL relative to |
| 609 | @ this server's root (%s(g.zBaseURL)/). |
| 610 | @ The default is to use wiki/ProjectName. Make sure to use a valid name, |
| 611 | @ or your /home link will likely crash! (If that happens, simply come back |
| 612 | @ to this page and set it to a good (or empty) value.) |
| 613 | @ To use .wiki or .html files in your source tree as content, use a URL |
| 614 | @ in the form <tt>doc/VERSION/path/to/doc.wiki</tt>, where VERSION is either |
| 615 | @ the UUID of a version of that page or the word 'tip' to get the most recent |
| 616 | @ version.</p> |
| 617 | @ <hr /> |
| 618 | @ <p><input type="submit" name="submit" value="Apply Changes"></p> |
| 619 | @ </form> |
| 620 | db_end_transaction(0); |
| 621 | style_footer(); |
| 622 | } |
| 623 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -601,22 +601,10 @@ | |
| 601 | textarea_attribute("Project Description", 5, 60, |
| 602 | "project-description", "pd", ""); |
| 603 | @ <p>Describe your project. This will be used in page headers for search |
| 604 | @ engines as well as a short RSS description.</p> |
| 605 | @ <hr /> |
| 606 | @ <p><input type="submit" name="submit" value="Apply Changes"></p> |
| 607 | @ </form> |
| 608 | db_end_transaction(0); |
| 609 | style_footer(); |
| 610 | } |
| 611 |
+10
-30
| --- src/wiki.c | ||
| +++ src/wiki.c | ||
| @@ -77,42 +77,22 @@ | ||
| 77 | 77 | ** WEBPAGE: home |
| 78 | 78 | ** WEBPAGE: index |
| 79 | 79 | ** WEBPAGE: not_found |
| 80 | 80 | */ |
| 81 | 81 | void home_page(void){ |
| 82 | - char *zHomePage; /* name of home page */ | |
| 83 | - char *zProjName; /* name of project */ | |
| 84 | - zProjName = db_get("project-name",0); | |
| 85 | - zHomePage = db_get("project-home", zProjName ); | |
| 86 | - if( zProjName && zProjName[0] ){ | |
| 87 | - /* beware: this code causes cyclic redirects on a 404 because | |
| 88 | - not_found is directed here. | |
| 89 | - */ | |
| 90 | - int lenP; /* strncmp() bounder */ | |
| 91 | - int lenH; /* length of zProjName */ | |
| 92 | - if( zHomePage && ! zHomePage[0] ){ | |
| 93 | - zHomePage = zProjName; | |
| 94 | - } | |
| 95 | - lenP = strlen(zProjName); | |
| 96 | - lenH = strlen(zHomePage); | |
| 97 | - if( lenP < lenH ) lenP = lenH; | |
| 98 | - if( (zProjName == zHomePage) || (0==strncmp(zProjName,zHomePage,lenP)) || | |
| 99 | - (0==strncmp(zHomePage,"home",lenP)/*avoid endless loop*/) ){ | |
| 100 | - login_check_credentials(); | |
| 101 | - g.zExtra = zHomePage; | |
| 102 | - cgi_set_parameter_nocopy("name", g.zExtra); | |
| 103 | - g.okRdWiki = 1; | |
| 104 | - g.okApndWiki = 0; | |
| 105 | - g.okWrWiki = 0; | |
| 106 | - g.okHistory = 0; | |
| 107 | - wiki_page(); | |
| 108 | - }else{ | |
| 109 | - cgi_redirect( zHomePage ); | |
| 110 | - } | |
| 82 | + char *zPageName = db_get("project-name",0); | |
| 83 | + if( zPageName ){ | |
| 84 | + login_check_credentials(); | |
| 85 | + g.zExtra = zPageName; | |
| 86 | + cgi_set_parameter_nocopy("name", g.zExtra); | |
| 87 | + g.okRdWiki = 1; | |
| 88 | + g.okApndWiki = 0; | |
| 89 | + g.okWrWiki = 0; | |
| 90 | + g.okHistory = 0; | |
| 91 | + wiki_page(); | |
| 111 | 92 | return; |
| 112 | 93 | } |
| 113 | - | |
| 114 | 94 | style_header("Home"); |
| 115 | 95 | @ <p>This is a stub home-page for the project. |
| 116 | 96 | @ To fill in this page, first go to |
| 117 | 97 | @ <a href="%s(g.zBaseURL)/setup_config">setup/config</a> |
| 118 | 98 | @ and establish a "Project Name". Then create a |
| 119 | 99 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -77,42 +77,22 @@ | |
| 77 | ** WEBPAGE: home |
| 78 | ** WEBPAGE: index |
| 79 | ** WEBPAGE: not_found |
| 80 | */ |
| 81 | void home_page(void){ |
| 82 | char *zHomePage; /* name of home page */ |
| 83 | char *zProjName; /* name of project */ |
| 84 | zProjName = db_get("project-name",0); |
| 85 | zHomePage = db_get("project-home", zProjName ); |
| 86 | if( zProjName && zProjName[0] ){ |
| 87 | /* beware: this code causes cyclic redirects on a 404 because |
| 88 | not_found is directed here. |
| 89 | */ |
| 90 | int lenP; /* strncmp() bounder */ |
| 91 | int lenH; /* length of zProjName */ |
| 92 | if( zHomePage && ! zHomePage[0] ){ |
| 93 | zHomePage = zProjName; |
| 94 | } |
| 95 | lenP = strlen(zProjName); |
| 96 | lenH = strlen(zHomePage); |
| 97 | if( lenP < lenH ) lenP = lenH; |
| 98 | if( (zProjName == zHomePage) || (0==strncmp(zProjName,zHomePage,lenP)) || |
| 99 | (0==strncmp(zHomePage,"home",lenP)/*avoid endless loop*/) ){ |
| 100 | login_check_credentials(); |
| 101 | g.zExtra = zHomePage; |
| 102 | cgi_set_parameter_nocopy("name", g.zExtra); |
| 103 | g.okRdWiki = 1; |
| 104 | g.okApndWiki = 0; |
| 105 | g.okWrWiki = 0; |
| 106 | g.okHistory = 0; |
| 107 | wiki_page(); |
| 108 | }else{ |
| 109 | cgi_redirect( zHomePage ); |
| 110 | } |
| 111 | return; |
| 112 | } |
| 113 | |
| 114 | style_header("Home"); |
| 115 | @ <p>This is a stub home-page for the project. |
| 116 | @ To fill in this page, first go to |
| 117 | @ <a href="%s(g.zBaseURL)/setup_config">setup/config</a> |
| 118 | @ and establish a "Project Name". Then create a |
| 119 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -77,42 +77,22 @@ | |
| 77 | ** WEBPAGE: home |
| 78 | ** WEBPAGE: index |
| 79 | ** WEBPAGE: not_found |
| 80 | */ |
| 81 | void home_page(void){ |
| 82 | char *zPageName = db_get("project-name",0); |
| 83 | if( zPageName ){ |
| 84 | login_check_credentials(); |
| 85 | g.zExtra = zPageName; |
| 86 | cgi_set_parameter_nocopy("name", g.zExtra); |
| 87 | g.okRdWiki = 1; |
| 88 | g.okApndWiki = 0; |
| 89 | g.okWrWiki = 0; |
| 90 | g.okHistory = 0; |
| 91 | wiki_page(); |
| 92 | return; |
| 93 | } |
| 94 | style_header("Home"); |
| 95 | @ <p>This is a stub home-page for the project. |
| 96 | @ To fill in this page, first go to |
| 97 | @ <a href="%s(g.zBaseURL)/setup_config">setup/config</a> |
| 98 | @ and establish a "Project Name". Then create a |
| 99 |