Fossil

Check-in [c51dd305]
Login

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

Overview
Comment:Back out the "Home Page" configuration option added by [29374daa0d]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c51dd3058c54e2cd5cdfc57f8f9a77314ec860b9
User & Date: drh 2008-05-16 01:09:08
Context
2008-05-16
01:43
Added new "wiki create" command. Cleaned up the "wiki commit" code and added an option filename argument to both "wiki commit" and "wiki create". check-in: e03d1be5 user: drh tags: trunk
01:09
Back out the "Home Page" configuration option added by [29374daa0d] check-in: c51dd305 user: drh tags: trunk
00:56
Fix bugs in the rendering of HTML markup with multiple attributes. This clears up a problem in displaying the "concepts.wiki" documentation file. check-in: 1bbc5b7e user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/setup.c.

599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
  @ The project name will also be used as the RSS feed title.</p>
  @ <hr />
  textarea_attribute("Project Description", 5, 60,
                     "project-description", "pd", "");
  @ <p>Describe your project. This will be used in page headers for search
  @ engines as well as a short RSS description.</p>
  @ <hr />
  entry_attribute("Home page", 60, "project-home", "phome", "");
  @ <p>This sets the content source for the Home page ([/home]).
  @ Enter a wiki page name (as wiki/PageName) or another URL relative to
  @ this server's root (%s(g.zBaseURL)/).
  @ The default is to use wiki/ProjectName. Make sure to use a valid name,
  @ or your /home link will likely crash! (If that happens, simply come back
  @ to this page and set it to a good (or empty) value.)
  @ To use .wiki or .html files in your source tree as content, use a URL
  @ in the form <tt>doc/VERSION/path/to/doc.wiki</tt>, where VERSION is either
  @ the UUID of a version of that page or the word 'tip' to get the most recent
  @ version.</p>
  @ <hr />
  @ <p><input type="submit"  name="submit" value="Apply Changes"></p>
  @ </form>
  db_end_transaction(0);
  style_footer();
}

/*







<
<
<
<
<
<
<
<
<
<
<
<







599
600
601
602
603
604
605












606
607
608
609
610
611
612
  @ The project name will also be used as the RSS feed title.</p>
  @ <hr />
  textarea_attribute("Project Description", 5, 60,
                     "project-description", "pd", "");
  @ <p>Describe your project. This will be used in page headers for search
  @ engines as well as a short RSS description.</p>
  @ <hr />












  @ <p><input type="submit"  name="submit" value="Apply Changes"></p>
  @ </form>
  db_end_transaction(0);
  style_footer();
}

/*

Changes to src/wiki.c.

75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99

100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120

/*
** WEBPAGE: home
** WEBPAGE: index
** WEBPAGE: not_found
*/
void home_page(void){
  char *zHomePage;        /* name of home page */
  char *zProjName;        /* name of project */
  zProjName = db_get("project-name",0);
  zHomePage = db_get("project-home", zProjName );
  if( zProjName && zProjName[0] ){
    /* beware: this code causes cyclic redirects on a 404 because
       not_found is directed here.
     */
    int lenP;             /* strncmp() bounder */
    int lenH;             /* length of zProjName */
    if(  zHomePage && ! zHomePage[0] ){
        zHomePage = zProjName;
    }
    lenP = strlen(zProjName);
    lenH = strlen(zHomePage);
    if( lenP < lenH ) lenP = lenH;
    if( (zProjName == zHomePage) || (0==strncmp(zProjName,zHomePage,lenP)) ||
      (0==strncmp(zHomePage,"home",lenP)/*avoid endless loop*/) ){

        login_check_credentials();
        g.zExtra = zHomePage;
        cgi_set_parameter_nocopy("name", g.zExtra);
        g.okRdWiki = 1;
        g.okApndWiki = 0;
        g.okWrWiki = 0;
        g.okHistory = 0;
        wiki_page();
    }else{
        cgi_redirect( zHomePage );
    }
    return;
  }

  style_header("Home");
  @ <p>This is a stub home-page for the project.
  @ To fill in this page, first go to
  @ <a href="%s(g.zBaseURL)/setup_config">setup/config</a>
  @ and establish a "Project Name".  Then create a
  @ wiki page with that name.  The content of that wiki page
  @ will be displayed in place of this message.







<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
>
|
|
|
|
|
|
|
|
<
<
<


<







75
76
77
78
79
80
81


82















83
84
85
86
87
88
89
90
91



92
93

94
95
96
97
98
99
100

/*
** WEBPAGE: home
** WEBPAGE: index
** WEBPAGE: not_found
*/
void home_page(void){


  char *zPageName = db_get("project-name",0);















  if( zPageName ){
    login_check_credentials();
    g.zExtra = zPageName;
    cgi_set_parameter_nocopy("name", g.zExtra);
    g.okRdWiki = 1;
    g.okApndWiki = 0;
    g.okWrWiki = 0;
    g.okHistory = 0;
    wiki_page();



    return;
  }

  style_header("Home");
  @ <p>This is a stub home-page for the project.
  @ To fill in this page, first go to
  @ <a href="%s(g.zBaseURL)/setup_config">setup/config</a>
  @ and establish a "Project Name".  Then create a
  @ wiki page with that name.  The content of that wiki page
  @ will be displayed in place of this message.