Fossil SCM

Honor the "Index Page" setting from the "Admin/Configuration" setup page.

drh 2010-09-04 15:24 trunk
Commit baa6df0650e6c41ac9464ec95a01e96ee41e9a4d
1 file changed +8
+8
--- src/wiki.c
+++ src/wiki.c
@@ -79,14 +79,22 @@
7979
** WEBPAGE: index
8080
** WEBPAGE: not_found
8181
*/
8282
void home_page(void){
8383
char *zPageName = db_get("project-name",0);
84
+ char *zIndexPage = db_get("index-page",0);
8485
login_check_credentials();
8586
if( !g.okRdWiki ){
8687
cgi_redirectf("%s/login?g=%s/home", g.zBaseURL, g.zBaseURL);
8788
}
89
+ if( zIndexPage ){
90
+ while( zIndexPage[0]=='/' ) zIndexPage++;
91
+ if( strcmp(zIndexPage, P("PATH_INFO"))==0 ) zIndexPage = 0;
92
+ }
93
+ if( zIndexPage ){
94
+ cgi_redirectf("%s/%s", g.zBaseURL, zIndexPage);
95
+ }
8896
if( zPageName ){
8997
login_check_credentials();
9098
g.zExtra = zPageName;
9199
cgi_set_parameter_nocopy("name", g.zExtra);
92100
g.isHome = 1;
93101
--- src/wiki.c
+++ src/wiki.c
@@ -79,14 +79,22 @@
79 ** WEBPAGE: index
80 ** WEBPAGE: not_found
81 */
82 void home_page(void){
83 char *zPageName = db_get("project-name",0);
 
84 login_check_credentials();
85 if( !g.okRdWiki ){
86 cgi_redirectf("%s/login?g=%s/home", g.zBaseURL, g.zBaseURL);
87 }
 
 
 
 
 
 
 
88 if( zPageName ){
89 login_check_credentials();
90 g.zExtra = zPageName;
91 cgi_set_parameter_nocopy("name", g.zExtra);
92 g.isHome = 1;
93
--- src/wiki.c
+++ src/wiki.c
@@ -79,14 +79,22 @@
79 ** WEBPAGE: index
80 ** WEBPAGE: not_found
81 */
82 void home_page(void){
83 char *zPageName = db_get("project-name",0);
84 char *zIndexPage = db_get("index-page",0);
85 login_check_credentials();
86 if( !g.okRdWiki ){
87 cgi_redirectf("%s/login?g=%s/home", g.zBaseURL, g.zBaseURL);
88 }
89 if( zIndexPage ){
90 while( zIndexPage[0]=='/' ) zIndexPage++;
91 if( strcmp(zIndexPage, P("PATH_INFO"))==0 ) zIndexPage = 0;
92 }
93 if( zIndexPage ){
94 cgi_redirectf("%s/%s", g.zBaseURL, zIndexPage);
95 }
96 if( zPageName ){
97 login_check_credentials();
98 g.zExtra = zPageName;
99 cgi_set_parameter_nocopy("name", g.zExtra);
100 g.isHome = 1;
101

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button