Fossil SCM

Enhance the webpage_error() routine to show the complete calling environment to authorized users. Also, continuing work on forum.

drh 2018-07-25 11:25 forum-v2
Commit 5fcf49f104496abf290eeaf14c58be6bd4569e25a03b99b2447e434cdc2cf67a
3 files changed +43 -4 -15 +87 -35
+43 -4
--- src/forum.c
+++ src/forum.c
@@ -47,11 +47,12 @@
4747
int fprev = db_column_int(&q, 1);
4848
int firt = db_column_int(&q, 2);
4949
const char *zUuid = db_column_text(&q, 3);
5050
const char *zDate = db_column_text(&q, 4);
5151
Manifest *pPost = manifest_get(fpid, CFTYPE_FORUM, 0);
52
- if( i==0 ){
52
+ if( pPost==0 ) continue;
53
+ if( i>0 ){
5354
@ <hr>
5455
}
5556
i++;
5657
@ <p>%d(fpid) %h(zUuid)<br>
5758
@ By %h(pPost->zUser) on %h(zDate)
@@ -63,11 +64,23 @@
6364
}
6465
if( pPost->zThreadTitle ){
6566
@ <h1>%h(pPost->zThreadTitle)</h1>
6667
}
6768
forum_render(pPost->zMimetype, pPost->zWiki);
68
- if( pPost==0 ) continue;
69
+ if( g.perm.WrForum ){
70
+ @ <p><form action="%R/forumedit" method="POST">
71
+ @ <input type="hidden" name="fpid" value="%s(zUuid)">
72
+ @ <input type="submit" name="reply" value="Reply">
73
+ if( g.perm.Admin || fossil_strcmp(pPost->zUser,g.zLogin)==0 ){
74
+ @ <input type="submit" name="edit" value="Edit">
75
+ }
76
+ if( g.perm.ModForum && content_is_private(fpid) ){
77
+ @ <input type="submit" name="approve" value="Approve">
78
+ @ <input type="submit" name="reject" value="Reject">
79
+ }
80
+ @ </form></p>
81
+ }
6982
manifest_destroy(pPost);
7083
}
7184
db_finalize(&q);
7285
}
7386
@@ -260,9 +273,35 @@
260273
** Query parameters:
261274
**
262275
** name=X Hash of the post to be editted. REQUIRED
263276
*/
264277
void forumedit_page(void){
265
- style_header("Pending");
266
- @ TBD...
278
+ int fpid;
279
+ Manifest *pPost;
280
+
281
+ fpid = symbolic_name_to_rid(PD("fpid",""), "f");
282
+ login_check_credentials();
283
+ if( !g.perm.WrForum ){
284
+ login_needed(g.anon.WrForum);
285
+ return;
286
+ }
287
+ if( fpid<=0 || (pPost = manifest_get(fpid, CFTYPE_FORUM, 0))==0 ){
288
+ webpage_error("Missing or invalid fpid query parameter");
289
+ return;
290
+ }
291
+#if 0
292
+ if( g.perm.ModForum ){
293
+ if( P("approve") ){
294
+ }
295
+ if( P("reject") ){
296
+ }
297
+ }
298
+ if( P("submit") ){
299
+ }
300
+ if( P("edit") ){
301
+ }
302
+ if( P("reply") ){
303
+ }
267304
style_footer();
305
+#endif
306
+ webpage_error("Not yet implemented");
268307
}
269308
--- src/forum.c
+++ src/forum.c
@@ -47,11 +47,12 @@
47 int fprev = db_column_int(&q, 1);
48 int firt = db_column_int(&q, 2);
49 const char *zUuid = db_column_text(&q, 3);
50 const char *zDate = db_column_text(&q, 4);
51 Manifest *pPost = manifest_get(fpid, CFTYPE_FORUM, 0);
52 if( i==0 ){
 
53 @ <hr>
54 }
55 i++;
56 @ <p>%d(fpid) %h(zUuid)<br>
57 @ By %h(pPost->zUser) on %h(zDate)
@@ -63,11 +64,23 @@
63 }
64 if( pPost->zThreadTitle ){
65 @ <h1>%h(pPost->zThreadTitle)</h1>
66 }
67 forum_render(pPost->zMimetype, pPost->zWiki);
68 if( pPost==0 ) continue;
 
 
 
 
 
 
 
 
 
 
 
 
69 manifest_destroy(pPost);
70 }
71 db_finalize(&q);
72 }
73
@@ -260,9 +273,35 @@
260 ** Query parameters:
261 **
262 ** name=X Hash of the post to be editted. REQUIRED
263 */
264 void forumedit_page(void){
265 style_header("Pending");
266 @ TBD...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
267 style_footer();
 
 
268 }
269
--- src/forum.c
+++ src/forum.c
@@ -47,11 +47,12 @@
47 int fprev = db_column_int(&q, 1);
48 int firt = db_column_int(&q, 2);
49 const char *zUuid = db_column_text(&q, 3);
50 const char *zDate = db_column_text(&q, 4);
51 Manifest *pPost = manifest_get(fpid, CFTYPE_FORUM, 0);
52 if( pPost==0 ) continue;
53 if( i>0 ){
54 @ <hr>
55 }
56 i++;
57 @ <p>%d(fpid) %h(zUuid)<br>
58 @ By %h(pPost->zUser) on %h(zDate)
@@ -63,11 +64,23 @@
64 }
65 if( pPost->zThreadTitle ){
66 @ <h1>%h(pPost->zThreadTitle)</h1>
67 }
68 forum_render(pPost->zMimetype, pPost->zWiki);
69 if( g.perm.WrForum ){
70 @ <p><form action="%R/forumedit" method="POST">
71 @ <input type="hidden" name="fpid" value="%s(zUuid)">
72 @ <input type="submit" name="reply" value="Reply">
73 if( g.perm.Admin || fossil_strcmp(pPost->zUser,g.zLogin)==0 ){
74 @ <input type="submit" name="edit" value="Edit">
75 }
76 if( g.perm.ModForum && content_is_private(fpid) ){
77 @ <input type="submit" name="approve" value="Approve">
78 @ <input type="submit" name="reject" value="Reject">
79 }
80 @ </form></p>
81 }
82 manifest_destroy(pPost);
83 }
84 db_finalize(&q);
85 }
86
@@ -260,9 +273,35 @@
273 ** Query parameters:
274 **
275 ** name=X Hash of the post to be editted. REQUIRED
276 */
277 void forumedit_page(void){
278 int fpid;
279 Manifest *pPost;
280
281 fpid = symbolic_name_to_rid(PD("fpid",""), "f");
282 login_check_credentials();
283 if( !g.perm.WrForum ){
284 login_needed(g.anon.WrForum);
285 return;
286 }
287 if( fpid<=0 || (pPost = manifest_get(fpid, CFTYPE_FORUM, 0))==0 ){
288 webpage_error("Missing or invalid fpid query parameter");
289 return;
290 }
291 #if 0
292 if( g.perm.ModForum ){
293 if( P("approve") ){
294 }
295 if( P("reject") ){
296 }
297 }
298 if( P("submit") ){
299 }
300 if( P("edit") ){
301 }
302 if( P("reply") ){
303 }
304 style_footer();
305 #endif
306 webpage_error("Not yet implemented");
307 }
308
-15
--- src/info.c
+++ src/info.c
@@ -978,25 +978,10 @@
978978
@ <div class="section">Content</div>
979979
blob_init(&wiki, pWiki->zWiki, -1);
980980
wiki_render_by_mimetype(&wiki, pWiki->zMimetype);
981981
blob_reset(&wiki);
982982
manifest_destroy(pWiki);
983
- style_footer();
984
-}
985
-
986
-/*
987
-** Show a webpage error message
988
-*/
989
-void webpage_error(const char *zFormat, ...){
990
- va_list ap;
991
- const char *z;
992
- va_start(ap, zFormat);
993
- z = vmprintf(zFormat, ap);
994
- va_end(ap);
995
- style_header("URL Error");
996
- @ <h1>Error</h1>
997
- @ <p>%h(z)</p>
998983
style_footer();
999984
}
1000985
1001986
/*
1002987
** Find an check-in based on query parameter zParam and parse its
1003988
--- src/info.c
+++ src/info.c
@@ -978,25 +978,10 @@
978 @ <div class="section">Content</div>
979 blob_init(&wiki, pWiki->zWiki, -1);
980 wiki_render_by_mimetype(&wiki, pWiki->zMimetype);
981 blob_reset(&wiki);
982 manifest_destroy(pWiki);
983 style_footer();
984 }
985
986 /*
987 ** Show a webpage error message
988 */
989 void webpage_error(const char *zFormat, ...){
990 va_list ap;
991 const char *z;
992 va_start(ap, zFormat);
993 z = vmprintf(zFormat, ap);
994 va_end(ap);
995 style_header("URL Error");
996 @ <h1>Error</h1>
997 @ <p>%h(z)</p>
998 style_footer();
999 }
1000
1001 /*
1002 ** Find an check-in based on query parameter zParam and parse its
1003
--- src/info.c
+++ src/info.c
@@ -978,25 +978,10 @@
978 @ <div class="section">Content</div>
979 blob_init(&wiki, pWiki->zWiki, -1);
980 wiki_render_by_mimetype(&wiki, pWiki->zMimetype);
981 blob_reset(&wiki);
982 manifest_destroy(pWiki);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
983 style_footer();
984 }
985
986 /*
987 ** Find an check-in based on query parameter zParam and parse its
988
+87 -35
--- src/style.c
+++ src/style.c
@@ -864,22 +864,80 @@
864864
}
865865
blob_init(&out, zTxt, -1);
866866
cgi_set_content(&out);
867867
}
868868
869
+/*
870
+** All possible capabilities
871
+*/
872
+static const char allCap[] =
873
+ "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKL";
874
+
875
+/*
876
+** Compute the current login capabilities
877
+*/
878
+static char *find_capabilities(char *zCap){
879
+ int i, j;
880
+ char c;
881
+ for(i=j=0; (c = allCap[j])!=0; j++){
882
+ if( login_has_capability(&c, 1, 0) ) zCap[i++] = c;
883
+ }
884
+ zCap[i] = 0;
885
+ return zCap;
886
+}
887
+
888
+/*
889
+** Compute the current login capabilities that were
890
+** contributed by Anonymous
891
+*/
892
+static char *find_anon_capabilities(char *zCap){
893
+ int i, j;
894
+ char c;
895
+ for(i=j=0; (c = allCap[j])!=0; j++){
896
+ if( login_has_capability(&c, 1, LOGIN_ANON)
897
+ && !login_has_capability(&c, 1, 0) ) zCap[i++] = c;
898
+ }
899
+ zCap[i] = 0;
900
+ return zCap;
901
+}
869902
870903
/*
871904
** WEBPAGE: test_env
872905
**
873906
** Display CGI-variables and other aspects of the run-time
874907
** environment, for debugging and trouble-shooting purposes.
875908
*/
876909
void page_test_env(void){
877
- char c;
910
+ webpage_error("");
911
+}
912
+
913
+/*
914
+** WEBPAGE: honeypot
915
+** This page is a honeypot for spiders and bots.
916
+*/
917
+void honeypot_page(void){
918
+ cgi_set_status(403, "Forbidden");
919
+ @ <p>Please enable javascript or log in to see this content</p>
920
+}
921
+
922
+/*
923
+** Webpages that encounter an error due to missing or incorrect
924
+** query parameters can jump to this routine to render an error
925
+** message screen.
926
+**
927
+** For administators, or if the test_env_enable setting is true, then
928
+** details of the request environment are displayed. Otherwise, just
929
+** the error message is shown.
930
+**
931
+** If zFormat is an empty string, then this is the /test_env page.
932
+*/
933
+void webpage_error(const char *zFormat, ...){
878934
int i;
879935
int showAll;
880
- char zCap[30];
936
+ char *zErr;
937
+ int isAuth = 0;
938
+ char zCap[100];
881939
static const char *const azCgiVars[] = {
882940
"COMSPEC", "DOCUMENT_ROOT", "GATEWAY_INTERFACE",
883941
"HTTP_ACCEPT", "HTTP_ACCEPT_CHARSET", "HTTP_ACCEPT_ENCODING",
884942
"HTTP_ACCEPT_LANGUAGE", "HTTP_AUTHENICATION",
885943
"HTTP_CONNECTION", "HTTP_HOST",
@@ -895,48 +953,56 @@
895953
"FOSSIL_TCL_PATH", "TH1_DELETE_INTERP", "TH1_ENABLE_DOCS",
896954
"TH1_ENABLE_HOOKS", "TH1_ENABLE_TCL", "REMOTE_HOST"
897955
};
898956
899957
login_check_credentials();
900
- if( !g.perm.Admin && !g.perm.Setup && !db_get_boolean("test_env_enable",0) ){
901
- login_needed(0);
902
- return;
958
+ if( g.perm.Admin || g.perm.Setup || db_get_boolean("test_env_enable",0) ){
959
+ isAuth = 1;
903960
}
904961
for(i=0; i<count(azCgiVars); i++) (void)P(azCgiVars[i]);
905
- style_header("Environment Test");
906
- showAll = PB("showall");
907
- style_submenu_checkbox("showall", "Cookies", 0, 0);
908
- style_submenu_element("Stats", "%R/stat");
962
+ if( zFormat[0] ){
963
+ va_list ap;
964
+ va_start(ap, zFormat);
965
+ zErr = vmprintf(zFormat, ap);
966
+ va_end(ap);
967
+ style_header("Bad Request");
968
+ @ <h1>/%h(g.zPath): %h(zErr)</h1>
969
+ fossil_free(zErr);
970
+ showAll = 0;
971
+ if( !isAuth ){
972
+ style_footer();
973
+ return;
974
+ }
975
+ }else if( !isAuth ){
976
+ login_needed(0);
977
+ return;
978
+ }else{
979
+ style_header("Environment Test");
980
+ showAll = PB("showall");
981
+ style_submenu_checkbox("showall", "Cookies", 0, 0);
982
+ style_submenu_element("Stats", "%R/stat");
983
+ }
909984
910985
#if !defined(_WIN32)
911986
@ uid=%d(getuid()), gid=%d(getgid())<br />
912987
#endif
913988
@ g.zBaseURL = %h(g.zBaseURL)<br />
914989
@ g.zHttpsURL = %h(g.zHttpsURL)<br />
915990
@ g.zTop = %h(g.zTop)<br />
916991
@ g.zPath = %h(g.zPath)<br />
917
- for(i=0, c='a'; c<='z'; c++){
918
- if( login_has_capability(&c, 1, 0) ) zCap[i++] = c;
919
- }
920
- zCap[i] = 0;
921992
@ g.userUid = %d(g.userUid)<br />
922993
@ g.zLogin = %h(g.zLogin)<br />
923994
@ g.isHuman = %d(g.isHuman)<br />
924995
if( g.nRequest ){
925996
@ g.nRequest = %d(g.nRequest)<br />
926997
}
927998
if( g.nPendingRequest>1 ){
928999
@ g.nPendingRequest = %d(g.nPendingRequest)<br />
9291000
}
930
- @ capabilities = %s(zCap)<br />
931
- for(i=0, c='a'; c<='z'; c++){
932
- if( login_has_capability(&c, 1, LOGIN_ANON)
933
- && !login_has_capability(&c, 1, 0) ) zCap[i++] = c;
934
- }
935
- zCap[i] = 0;
936
- if( i>0 ){
937
- @ anonymous-adds = %s(zCap)<br />
1001
+ @ capabilities = %s(find_capabilities(zCap))<br />
1002
+ if( zCap[0] ){
1003
+ @ anonymous-adds = %s(find_anon_capabilities(zCap))<br />
9381004
}
9391005
@ g.zRepositoryName = %h(g.zRepositoryName)<br />
9401006
@ load_average() = %f(load_average())<br />
9411007
@ cgi_csrf_safe(0) = %d(cgi_csrf_safe(0))<br />
9421008
@ <hr />
@@ -946,21 +1012,7 @@
9461012
@ <hr />
9471013
@ <pre>
9481014
@ %h(blob_str(&g.httpHeader))
9491015
@ </pre>
9501016
}
951
- if( g.perm.Setup ){
952
- const char *zRedir = P("redirect");
953
- if( zRedir ) cgi_redirect(zRedir);
954
- }
9551017
style_footer();
956
- if( g.perm.Admin && P("err") ) fossil_fatal("%s", P("err"));
957
-}
958
-
959
-/*
960
-** WEBPAGE: honeypot
961
-** This page is a honeypot for spiders and bots.
962
-*/
963
-void honeypot_page(void){
964
- cgi_set_status(403, "Forbidden");
965
- @ <p>Please enable javascript or log in to see this content</p>
9661018
}
9671019
--- src/style.c
+++ src/style.c
@@ -864,22 +864,80 @@
864 }
865 blob_init(&out, zTxt, -1);
866 cgi_set_content(&out);
867 }
868
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
869
870 /*
871 ** WEBPAGE: test_env
872 **
873 ** Display CGI-variables and other aspects of the run-time
874 ** environment, for debugging and trouble-shooting purposes.
875 */
876 void page_test_env(void){
877 char c;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
878 int i;
879 int showAll;
880 char zCap[30];
 
 
881 static const char *const azCgiVars[] = {
882 "COMSPEC", "DOCUMENT_ROOT", "GATEWAY_INTERFACE",
883 "HTTP_ACCEPT", "HTTP_ACCEPT_CHARSET", "HTTP_ACCEPT_ENCODING",
884 "HTTP_ACCEPT_LANGUAGE", "HTTP_AUTHENICATION",
885 "HTTP_CONNECTION", "HTTP_HOST",
@@ -895,48 +953,56 @@
895 "FOSSIL_TCL_PATH", "TH1_DELETE_INTERP", "TH1_ENABLE_DOCS",
896 "TH1_ENABLE_HOOKS", "TH1_ENABLE_TCL", "REMOTE_HOST"
897 };
898
899 login_check_credentials();
900 if( !g.perm.Admin && !g.perm.Setup && !db_get_boolean("test_env_enable",0) ){
901 login_needed(0);
902 return;
903 }
904 for(i=0; i<count(azCgiVars); i++) (void)P(azCgiVars[i]);
905 style_header("Environment Test");
906 showAll = PB("showall");
907 style_submenu_checkbox("showall", "Cookies", 0, 0);
908 style_submenu_element("Stats", "%R/stat");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
909
910 #if !defined(_WIN32)
911 @ uid=%d(getuid()), gid=%d(getgid())<br />
912 #endif
913 @ g.zBaseURL = %h(g.zBaseURL)<br />
914 @ g.zHttpsURL = %h(g.zHttpsURL)<br />
915 @ g.zTop = %h(g.zTop)<br />
916 @ g.zPath = %h(g.zPath)<br />
917 for(i=0, c='a'; c<='z'; c++){
918 if( login_has_capability(&c, 1, 0) ) zCap[i++] = c;
919 }
920 zCap[i] = 0;
921 @ g.userUid = %d(g.userUid)<br />
922 @ g.zLogin = %h(g.zLogin)<br />
923 @ g.isHuman = %d(g.isHuman)<br />
924 if( g.nRequest ){
925 @ g.nRequest = %d(g.nRequest)<br />
926 }
927 if( g.nPendingRequest>1 ){
928 @ g.nPendingRequest = %d(g.nPendingRequest)<br />
929 }
930 @ capabilities = %s(zCap)<br />
931 for(i=0, c='a'; c<='z'; c++){
932 if( login_has_capability(&c, 1, LOGIN_ANON)
933 && !login_has_capability(&c, 1, 0) ) zCap[i++] = c;
934 }
935 zCap[i] = 0;
936 if( i>0 ){
937 @ anonymous-adds = %s(zCap)<br />
938 }
939 @ g.zRepositoryName = %h(g.zRepositoryName)<br />
940 @ load_average() = %f(load_average())<br />
941 @ cgi_csrf_safe(0) = %d(cgi_csrf_safe(0))<br />
942 @ <hr />
@@ -946,21 +1012,7 @@
946 @ <hr />
947 @ <pre>
948 @ %h(blob_str(&g.httpHeader))
949 @ </pre>
950 }
951 if( g.perm.Setup ){
952 const char *zRedir = P("redirect");
953 if( zRedir ) cgi_redirect(zRedir);
954 }
955 style_footer();
956 if( g.perm.Admin && P("err") ) fossil_fatal("%s", P("err"));
957 }
958
959 /*
960 ** WEBPAGE: honeypot
961 ** This page is a honeypot for spiders and bots.
962 */
963 void honeypot_page(void){
964 cgi_set_status(403, "Forbidden");
965 @ <p>Please enable javascript or log in to see this content</p>
966 }
967
--- src/style.c
+++ src/style.c
@@ -864,22 +864,80 @@
864 }
865 blob_init(&out, zTxt, -1);
866 cgi_set_content(&out);
867 }
868
869 /*
870 ** All possible capabilities
871 */
872 static const char allCap[] =
873 "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKL";
874
875 /*
876 ** Compute the current login capabilities
877 */
878 static char *find_capabilities(char *zCap){
879 int i, j;
880 char c;
881 for(i=j=0; (c = allCap[j])!=0; j++){
882 if( login_has_capability(&c, 1, 0) ) zCap[i++] = c;
883 }
884 zCap[i] = 0;
885 return zCap;
886 }
887
888 /*
889 ** Compute the current login capabilities that were
890 ** contributed by Anonymous
891 */
892 static char *find_anon_capabilities(char *zCap){
893 int i, j;
894 char c;
895 for(i=j=0; (c = allCap[j])!=0; j++){
896 if( login_has_capability(&c, 1, LOGIN_ANON)
897 && !login_has_capability(&c, 1, 0) ) zCap[i++] = c;
898 }
899 zCap[i] = 0;
900 return zCap;
901 }
902
903 /*
904 ** WEBPAGE: test_env
905 **
906 ** Display CGI-variables and other aspects of the run-time
907 ** environment, for debugging and trouble-shooting purposes.
908 */
909 void page_test_env(void){
910 webpage_error("");
911 }
912
913 /*
914 ** WEBPAGE: honeypot
915 ** This page is a honeypot for spiders and bots.
916 */
917 void honeypot_page(void){
918 cgi_set_status(403, "Forbidden");
919 @ <p>Please enable javascript or log in to see this content</p>
920 }
921
922 /*
923 ** Webpages that encounter an error due to missing or incorrect
924 ** query parameters can jump to this routine to render an error
925 ** message screen.
926 **
927 ** For administators, or if the test_env_enable setting is true, then
928 ** details of the request environment are displayed. Otherwise, just
929 ** the error message is shown.
930 **
931 ** If zFormat is an empty string, then this is the /test_env page.
932 */
933 void webpage_error(const char *zFormat, ...){
934 int i;
935 int showAll;
936 char *zErr;
937 int isAuth = 0;
938 char zCap[100];
939 static const char *const azCgiVars[] = {
940 "COMSPEC", "DOCUMENT_ROOT", "GATEWAY_INTERFACE",
941 "HTTP_ACCEPT", "HTTP_ACCEPT_CHARSET", "HTTP_ACCEPT_ENCODING",
942 "HTTP_ACCEPT_LANGUAGE", "HTTP_AUTHENICATION",
943 "HTTP_CONNECTION", "HTTP_HOST",
@@ -895,48 +953,56 @@
953 "FOSSIL_TCL_PATH", "TH1_DELETE_INTERP", "TH1_ENABLE_DOCS",
954 "TH1_ENABLE_HOOKS", "TH1_ENABLE_TCL", "REMOTE_HOST"
955 };
956
957 login_check_credentials();
958 if( g.perm.Admin || g.perm.Setup || db_get_boolean("test_env_enable",0) ){
959 isAuth = 1;
 
960 }
961 for(i=0; i<count(azCgiVars); i++) (void)P(azCgiVars[i]);
962 if( zFormat[0] ){
963 va_list ap;
964 va_start(ap, zFormat);
965 zErr = vmprintf(zFormat, ap);
966 va_end(ap);
967 style_header("Bad Request");
968 @ <h1>/%h(g.zPath): %h(zErr)</h1>
969 fossil_free(zErr);
970 showAll = 0;
971 if( !isAuth ){
972 style_footer();
973 return;
974 }
975 }else if( !isAuth ){
976 login_needed(0);
977 return;
978 }else{
979 style_header("Environment Test");
980 showAll = PB("showall");
981 style_submenu_checkbox("showall", "Cookies", 0, 0);
982 style_submenu_element("Stats", "%R/stat");
983 }
984
985 #if !defined(_WIN32)
986 @ uid=%d(getuid()), gid=%d(getgid())<br />
987 #endif
988 @ g.zBaseURL = %h(g.zBaseURL)<br />
989 @ g.zHttpsURL = %h(g.zHttpsURL)<br />
990 @ g.zTop = %h(g.zTop)<br />
991 @ g.zPath = %h(g.zPath)<br />
 
 
 
 
992 @ g.userUid = %d(g.userUid)<br />
993 @ g.zLogin = %h(g.zLogin)<br />
994 @ g.isHuman = %d(g.isHuman)<br />
995 if( g.nRequest ){
996 @ g.nRequest = %d(g.nRequest)<br />
997 }
998 if( g.nPendingRequest>1 ){
999 @ g.nPendingRequest = %d(g.nPendingRequest)<br />
1000 }
1001 @ capabilities = %s(find_capabilities(zCap))<br />
1002 if( zCap[0] ){
1003 @ anonymous-adds = %s(find_anon_capabilities(zCap))<br />
 
 
 
 
 
1004 }
1005 @ g.zRepositoryName = %h(g.zRepositoryName)<br />
1006 @ load_average() = %f(load_average())<br />
1007 @ cgi_csrf_safe(0) = %d(cgi_csrf_safe(0))<br />
1008 @ <hr />
@@ -946,21 +1012,7 @@
1012 @ <hr />
1013 @ <pre>
1014 @ %h(blob_str(&g.httpHeader))
1015 @ </pre>
1016 }
 
 
 
 
1017 style_footer();
 
 
 
 
 
 
 
 
 
 
1018 }
1019

Keyboard Shortcuts

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