Fossil SCM

Change default headers to show menu-bar items that would be available to user "anonymous" even if the current user is not logged in.

drh 2015-02-14 14:05 login-enhancements
Commit 72cddddbcc2e4b19ae173ff568ded585b82d393f
--- skins/black_and_white/header.txt
+++ skins/black_and_white/header.txt
@@ -26,21 +26,21 @@
2626
<th1>
2727
html "<a href='$home$index_page'>Home</a>\n"
2828
if {[anycap jor]} {
2929
html "<a href='$home/timeline'>Timeline</a>\n"
3030
}
31
-if {[hascap oh]} {
31
+if {[anoncap oh]} {
3232
html "<a href='$home/tree?ci=tip'>Files</a>\n"
3333
}
34
-if {[hascap o]} {
34
+if {[anoncap o]} {
3535
html "<a href='$home/brlist'>Branches</a>\n"
3636
html "<a href='$home/taglist'>Tags</a>\n"
3737
}
38
-if {[hascap r]} {
38
+if {[anoncap r]} {
3939
html "<a href='$home/ticket'>Tickets</a>\n"
4040
}
41
-if {[hascap j]} {
41
+if {[anoncap j]} {
4242
html "<a href='$home/wiki'>Wiki</a>\n"
4343
}
4444
if {[hascap s]} {
4545
html "<a href='$home/setup'>Admin</a>\n"
4646
} elseif {[hascap a]} {
4747
--- skins/black_and_white/header.txt
+++ skins/black_and_white/header.txt
@@ -26,21 +26,21 @@
26 <th1>
27 html "<a href='$home$index_page'>Home</a>\n"
28 if {[anycap jor]} {
29 html "<a href='$home/timeline'>Timeline</a>\n"
30 }
31 if {[hascap oh]} {
32 html "<a href='$home/tree?ci=tip'>Files</a>\n"
33 }
34 if {[hascap o]} {
35 html "<a href='$home/brlist'>Branches</a>\n"
36 html "<a href='$home/taglist'>Tags</a>\n"
37 }
38 if {[hascap r]} {
39 html "<a href='$home/ticket'>Tickets</a>\n"
40 }
41 if {[hascap j]} {
42 html "<a href='$home/wiki'>Wiki</a>\n"
43 }
44 if {[hascap s]} {
45 html "<a href='$home/setup'>Admin</a>\n"
46 } elseif {[hascap a]} {
47
--- skins/black_and_white/header.txt
+++ skins/black_and_white/header.txt
@@ -26,21 +26,21 @@
26 <th1>
27 html "<a href='$home$index_page'>Home</a>\n"
28 if {[anycap jor]} {
29 html "<a href='$home/timeline'>Timeline</a>\n"
30 }
31 if {[anoncap oh]} {
32 html "<a href='$home/tree?ci=tip'>Files</a>\n"
33 }
34 if {[anoncap o]} {
35 html "<a href='$home/brlist'>Branches</a>\n"
36 html "<a href='$home/taglist'>Tags</a>\n"
37 }
38 if {[anoncap r]} {
39 html "<a href='$home/ticket'>Tickets</a>\n"
40 }
41 if {[anoncap j]} {
42 html "<a href='$home/wiki'>Wiki</a>\n"
43 }
44 if {[hascap s]} {
45 html "<a href='$home/setup'>Admin</a>\n"
46 } elseif {[hascap a]} {
47
--- skins/default/header.txt
+++ skins/default/header.txt
@@ -25,21 +25,21 @@
2525
<th1>
2626
html "<a href='$home$index_page'>Home</a>\n"
2727
if {[anycap jor]} {
2828
html "<a href='$home/timeline'>Timeline</a>\n"
2929
}
30
-if {[hascap oh]} {
30
+if {[anoncap oh]} {
3131
html "<a href='$home/tree?ci=tip'>Files</a>\n"
3232
}
33
-if {[hascap o]} {
33
+if {[anoncap o]} {
3434
html "<a href='$home/brlist'>Branches</a>\n"
3535
html "<a href='$home/taglist'>Tags</a>\n"
3636
}
37
-if {[hascap r]} {
37
+if {[anoncap r]} {
3838
html "<a href='$home/ticket'>Tickets</a>\n"
3939
}
40
-if {[hascap j]} {
40
+if {[anoncap j]} {
4141
html "<a href='$home/wiki'>Wiki</a>\n"
4242
}
4343
if {[hascap s]} {
4444
html "<a href='$home/setup'>Admin</a>\n"
4545
} elseif {[hascap a]} {
4646
--- skins/default/header.txt
+++ skins/default/header.txt
@@ -25,21 +25,21 @@
25 <th1>
26 html "<a href='$home$index_page'>Home</a>\n"
27 if {[anycap jor]} {
28 html "<a href='$home/timeline'>Timeline</a>\n"
29 }
30 if {[hascap oh]} {
31 html "<a href='$home/tree?ci=tip'>Files</a>\n"
32 }
33 if {[hascap o]} {
34 html "<a href='$home/brlist'>Branches</a>\n"
35 html "<a href='$home/taglist'>Tags</a>\n"
36 }
37 if {[hascap r]} {
38 html "<a href='$home/ticket'>Tickets</a>\n"
39 }
40 if {[hascap j]} {
41 html "<a href='$home/wiki'>Wiki</a>\n"
42 }
43 if {[hascap s]} {
44 html "<a href='$home/setup'>Admin</a>\n"
45 } elseif {[hascap a]} {
46
--- skins/default/header.txt
+++ skins/default/header.txt
@@ -25,21 +25,21 @@
25 <th1>
26 html "<a href='$home$index_page'>Home</a>\n"
27 if {[anycap jor]} {
28 html "<a href='$home/timeline'>Timeline</a>\n"
29 }
30 if {[anoncap oh]} {
31 html "<a href='$home/tree?ci=tip'>Files</a>\n"
32 }
33 if {[anoncap o]} {
34 html "<a href='$home/brlist'>Branches</a>\n"
35 html "<a href='$home/taglist'>Tags</a>\n"
36 }
37 if {[anoncap r]} {
38 html "<a href='$home/ticket'>Tickets</a>\n"
39 }
40 if {[anoncap j]} {
41 html "<a href='$home/wiki'>Wiki</a>\n"
42 }
43 if {[hascap s]} {
44 html "<a href='$home/setup'>Admin</a>\n"
45 } elseif {[hascap a]} {
46
--- skins/eagle/header.txt
+++ skins/eagle/header.txt
@@ -106,21 +106,21 @@
106106
html "<a href='$home$index_page'>Home</a>\n"
107107
html "<a href='$home/help'>Help</a>\n"
108108
if {[anycap jor]} {
109109
html "<a href='$home/timeline'>Timeline</a>\n"
110110
}
111
-if {[hascap oh]} {
111
+if {[anoncap oh]} {
112112
html "<a href='$home/tree?ci=tip'>Files</a>\n"
113113
}
114
-if {[hascap o]} {
114
+if {[anoncap o]} {
115115
html "<a href='$home/brlist'>Branches</a>\n"
116116
html "<a href='$home/taglist'>Tags</a>\n"
117117
}
118
-if {[hascap r]} {
118
+if {[anoncap r]} {
119119
html "<a href='$home/ticket'>Tickets</a>\n"
120120
}
121
-if {[hascap j]} {
121
+if {[anoncap j]} {
122122
html "<a href='$home/wiki'>Wiki</a>\n"
123123
}
124124
if {[hascap s]} {
125125
html "<a href='$home/setup'>Admin</a>\n"
126126
} elseif {[hascap a]} {
127127
--- skins/eagle/header.txt
+++ skins/eagle/header.txt
@@ -106,21 +106,21 @@
106 html "<a href='$home$index_page'>Home</a>\n"
107 html "<a href='$home/help'>Help</a>\n"
108 if {[anycap jor]} {
109 html "<a href='$home/timeline'>Timeline</a>\n"
110 }
111 if {[hascap oh]} {
112 html "<a href='$home/tree?ci=tip'>Files</a>\n"
113 }
114 if {[hascap o]} {
115 html "<a href='$home/brlist'>Branches</a>\n"
116 html "<a href='$home/taglist'>Tags</a>\n"
117 }
118 if {[hascap r]} {
119 html "<a href='$home/ticket'>Tickets</a>\n"
120 }
121 if {[hascap j]} {
122 html "<a href='$home/wiki'>Wiki</a>\n"
123 }
124 if {[hascap s]} {
125 html "<a href='$home/setup'>Admin</a>\n"
126 } elseif {[hascap a]} {
127
--- skins/eagle/header.txt
+++ skins/eagle/header.txt
@@ -106,21 +106,21 @@
106 html "<a href='$home$index_page'>Home</a>\n"
107 html "<a href='$home/help'>Help</a>\n"
108 if {[anycap jor]} {
109 html "<a href='$home/timeline'>Timeline</a>\n"
110 }
111 if {[anoncap oh]} {
112 html "<a href='$home/tree?ci=tip'>Files</a>\n"
113 }
114 if {[anoncap o]} {
115 html "<a href='$home/brlist'>Branches</a>\n"
116 html "<a href='$home/taglist'>Tags</a>\n"
117 }
118 if {[anoncap r]} {
119 html "<a href='$home/ticket'>Tickets</a>\n"
120 }
121 if {[anoncap j]} {
122 html "<a href='$home/wiki'>Wiki</a>\n"
123 }
124 if {[hascap s]} {
125 html "<a href='$home/setup'>Admin</a>\n"
126 } elseif {[hascap a]} {
127
--- skins/enhanced1/header.txt
+++ skins/enhanced1/header.txt
@@ -106,21 +106,21 @@
106106
html "<a href='$home$index_page'>Home</a>\n"
107107
html "<a href='$home/help'>Help</a>\n"
108108
if {[anycap jor]} {
109109
html "<a href='$home/timeline'>Timeline</a>\n"
110110
}
111
-if {[hascap oh]} {
111
+if {[anoncap oh]} {
112112
html "<a href='$home/tree?ci=tip'>Files</a>\n"
113113
}
114
-if {[hascap o]} {
114
+if {[anoncap o]} {
115115
html "<a href='$home/brlist'>Branches</a>\n"
116116
html "<a href='$home/taglist'>Tags</a>\n"
117117
}
118
-if {[hascap r]} {
118
+if {[anoncap r]} {
119119
html "<a href='$home/ticket'>Tickets</a>\n"
120120
}
121
-if {[hascap j]} {
121
+if {[anoncap j]} {
122122
html "<a href='$home/wiki'>Wiki</a>\n"
123123
}
124124
if {[hascap s]} {
125125
html "<a href='$home/setup'>Admin</a>\n"
126126
} elseif {[hascap a]} {
127127
--- skins/enhanced1/header.txt
+++ skins/enhanced1/header.txt
@@ -106,21 +106,21 @@
106 html "<a href='$home$index_page'>Home</a>\n"
107 html "<a href='$home/help'>Help</a>\n"
108 if {[anycap jor]} {
109 html "<a href='$home/timeline'>Timeline</a>\n"
110 }
111 if {[hascap oh]} {
112 html "<a href='$home/tree?ci=tip'>Files</a>\n"
113 }
114 if {[hascap o]} {
115 html "<a href='$home/brlist'>Branches</a>\n"
116 html "<a href='$home/taglist'>Tags</a>\n"
117 }
118 if {[hascap r]} {
119 html "<a href='$home/ticket'>Tickets</a>\n"
120 }
121 if {[hascap j]} {
122 html "<a href='$home/wiki'>Wiki</a>\n"
123 }
124 if {[hascap s]} {
125 html "<a href='$home/setup'>Admin</a>\n"
126 } elseif {[hascap a]} {
127
--- skins/enhanced1/header.txt
+++ skins/enhanced1/header.txt
@@ -106,21 +106,21 @@
106 html "<a href='$home$index_page'>Home</a>\n"
107 html "<a href='$home/help'>Help</a>\n"
108 if {[anycap jor]} {
109 html "<a href='$home/timeline'>Timeline</a>\n"
110 }
111 if {[anoncap oh]} {
112 html "<a href='$home/tree?ci=tip'>Files</a>\n"
113 }
114 if {[anoncap o]} {
115 html "<a href='$home/brlist'>Branches</a>\n"
116 html "<a href='$home/taglist'>Tags</a>\n"
117 }
118 if {[anoncap r]} {
119 html "<a href='$home/ticket'>Tickets</a>\n"
120 }
121 if {[anoncap j]} {
122 html "<a href='$home/wiki'>Wiki</a>\n"
123 }
124 if {[hascap s]} {
125 html "<a href='$home/setup'>Admin</a>\n"
126 } elseif {[hascap a]} {
127
--- skins/etienne1/header.txt
+++ skins/etienne1/header.txt
@@ -65,21 +65,21 @@
6565
menulink "home" $index_page Home
6666
6767
if {[anycap jor]} {
6868
menulink "timeline" "/timeline" Timeline
6969
}
70
-if {[hascap oh]} {
70
+if {[anoncap oh]} {
7171
menulink "dir" "/dir?ci=tip" Files
7272
}
73
-if {[hascap o]} {
73
+if {[anoncap o]} {
7474
menulink "brlist" "/brlist" Branches
7575
menulink "taglist" "/taglist" Tags
7676
}
77
-if {[hascap r]} {
77
+if {[anoncap r]} {
7878
menulink "ticket" "/ticket" Tickets
7979
}
80
-if {[hascap j]} {
80
+if {[anoncap j]} {
8181
menulink "wiki" "/wiki" Wiki
8282
}
8383
if {[hascap s]} {
8484
menulink "setup" "/setup" Admin
8585
} elseif {[hascap a]} {
8686
--- skins/etienne1/header.txt
+++ skins/etienne1/header.txt
@@ -65,21 +65,21 @@
65 menulink "home" $index_page Home
66
67 if {[anycap jor]} {
68 menulink "timeline" "/timeline" Timeline
69 }
70 if {[hascap oh]} {
71 menulink "dir" "/dir?ci=tip" Files
72 }
73 if {[hascap o]} {
74 menulink "brlist" "/brlist" Branches
75 menulink "taglist" "/taglist" Tags
76 }
77 if {[hascap r]} {
78 menulink "ticket" "/ticket" Tickets
79 }
80 if {[hascap j]} {
81 menulink "wiki" "/wiki" Wiki
82 }
83 if {[hascap s]} {
84 menulink "setup" "/setup" Admin
85 } elseif {[hascap a]} {
86
--- skins/etienne1/header.txt
+++ skins/etienne1/header.txt
@@ -65,21 +65,21 @@
65 menulink "home" $index_page Home
66
67 if {[anycap jor]} {
68 menulink "timeline" "/timeline" Timeline
69 }
70 if {[anoncap oh]} {
71 menulink "dir" "/dir?ci=tip" Files
72 }
73 if {[anoncap o]} {
74 menulink "brlist" "/brlist" Branches
75 menulink "taglist" "/taglist" Tags
76 }
77 if {[anoncap r]} {
78 menulink "ticket" "/ticket" Tickets
79 }
80 if {[anoncap j]} {
81 menulink "wiki" "/wiki" Wiki
82 }
83 if {[hascap s]} {
84 menulink "setup" "/setup" Admin
85 } elseif {[hascap a]} {
86
--- skins/khaki/header.txt
+++ skins/khaki/header.txt
@@ -24,21 +24,21 @@
2424
<th1>
2525
html "<a href='$home$index_page'>Home</a>\n"
2626
if {[anycap jor]} {
2727
html "<a href='$home/timeline'>Timeline</a>\n"
2828
}
29
-if {[hascap oh]} {
29
+if {[anoncap oh]} {
3030
html "<a href='$home/tree?ci=tip'>Files</a>\n"
3131
}
32
-if {[hascap o]} {
32
+if {[anoncap o]} {
3333
html "<a href='$home/brlist'>Branches</a>\n"
3434
html "<a href='$home/taglist'>Tags</a>\n"
3535
}
36
-if {[hascap r]} {
36
+if {[anoncap r]} {
3737
html "<a href='$home/ticket'>Tickets</a>\n"
3838
}
39
-if {[hascap j]} {
39
+if {[anoncap j]} {
4040
html "<a href='$home/wiki'>Wiki</a>\n"
4141
}
4242
if {[hascap s]} {
4343
html "<a href='$home/setup'>Admin</a>\n"
4444
} elseif {[hascap a]} {
4545
--- skins/khaki/header.txt
+++ skins/khaki/header.txt
@@ -24,21 +24,21 @@
24 <th1>
25 html "<a href='$home$index_page'>Home</a>\n"
26 if {[anycap jor]} {
27 html "<a href='$home/timeline'>Timeline</a>\n"
28 }
29 if {[hascap oh]} {
30 html "<a href='$home/tree?ci=tip'>Files</a>\n"
31 }
32 if {[hascap o]} {
33 html "<a href='$home/brlist'>Branches</a>\n"
34 html "<a href='$home/taglist'>Tags</a>\n"
35 }
36 if {[hascap r]} {
37 html "<a href='$home/ticket'>Tickets</a>\n"
38 }
39 if {[hascap j]} {
40 html "<a href='$home/wiki'>Wiki</a>\n"
41 }
42 if {[hascap s]} {
43 html "<a href='$home/setup'>Admin</a>\n"
44 } elseif {[hascap a]} {
45
--- skins/khaki/header.txt
+++ skins/khaki/header.txt
@@ -24,21 +24,21 @@
24 <th1>
25 html "<a href='$home$index_page'>Home</a>\n"
26 if {[anycap jor]} {
27 html "<a href='$home/timeline'>Timeline</a>\n"
28 }
29 if {[anoncap oh]} {
30 html "<a href='$home/tree?ci=tip'>Files</a>\n"
31 }
32 if {[anoncap o]} {
33 html "<a href='$home/brlist'>Branches</a>\n"
34 html "<a href='$home/taglist'>Tags</a>\n"
35 }
36 if {[anoncap r]} {
37 html "<a href='$home/ticket'>Tickets</a>\n"
38 }
39 if {[anoncap j]} {
40 html "<a href='$home/wiki'>Wiki</a>\n"
41 }
42 if {[hascap s]} {
43 html "<a href='$home/setup'>Admin</a>\n"
44 } elseif {[hascap a]} {
45
--- skins/plain_gray/header.txt
+++ skins/plain_gray/header.txt
@@ -22,21 +22,21 @@
2222
<th1>
2323
html "<a href='$home$index_page'>Home</a>\n"
2424
if {[anycap jor]} {
2525
html "<a href='$home/timeline'>Timeline</a>\n"
2626
}
27
-if {[hascap oh]} {
27
+if {[anoncap oh]} {
2828
html "<a href='$home/tree?ci=tip'>Files</a>\n"
2929
}
30
-if {[hascap o]} {
30
+if {[anoncap o]} {
3131
html "<a href='$home/brlist'>Branches</a>\n"
3232
html "<a href='$home/taglist'>Tags</a>\n"
3333
}
34
-if {[hascap r]} {
34
+if {[anoncap r]} {
3535
html "<a href='$home/ticket'>Tickets</a>\n"
3636
}
37
-if {[hascap j]} {
37
+if {[anoncap j]} {
3838
html "<a href='$home/wiki'>Wiki</a>\n"
3939
}
4040
if {[hascap s]} {
4141
html "<a href='$home/setup'>Admin</a>\n"
4242
} elseif {[hascap a]} {
4343
--- skins/plain_gray/header.txt
+++ skins/plain_gray/header.txt
@@ -22,21 +22,21 @@
22 <th1>
23 html "<a href='$home$index_page'>Home</a>\n"
24 if {[anycap jor]} {
25 html "<a href='$home/timeline'>Timeline</a>\n"
26 }
27 if {[hascap oh]} {
28 html "<a href='$home/tree?ci=tip'>Files</a>\n"
29 }
30 if {[hascap o]} {
31 html "<a href='$home/brlist'>Branches</a>\n"
32 html "<a href='$home/taglist'>Tags</a>\n"
33 }
34 if {[hascap r]} {
35 html "<a href='$home/ticket'>Tickets</a>\n"
36 }
37 if {[hascap j]} {
38 html "<a href='$home/wiki'>Wiki</a>\n"
39 }
40 if {[hascap s]} {
41 html "<a href='$home/setup'>Admin</a>\n"
42 } elseif {[hascap a]} {
43
--- skins/plain_gray/header.txt
+++ skins/plain_gray/header.txt
@@ -22,21 +22,21 @@
22 <th1>
23 html "<a href='$home$index_page'>Home</a>\n"
24 if {[anycap jor]} {
25 html "<a href='$home/timeline'>Timeline</a>\n"
26 }
27 if {[anoncap oh]} {
28 html "<a href='$home/tree?ci=tip'>Files</a>\n"
29 }
30 if {[anoncap o]} {
31 html "<a href='$home/brlist'>Branches</a>\n"
32 html "<a href='$home/taglist'>Tags</a>\n"
33 }
34 if {[anoncap r]} {
35 html "<a href='$home/ticket'>Tickets</a>\n"
36 }
37 if {[anoncap j]} {
38 html "<a href='$home/wiki'>Wiki</a>\n"
39 }
40 if {[hascap s]} {
41 html "<a href='$home/setup'>Admin</a>\n"
42 } elseif {[hascap a]} {
43
--- skins/rounded1/header.txt
+++ skins/rounded1/header.txt
@@ -26,21 +26,21 @@
2626
<th1>
2727
html "<a href='$home$index_page'>Home</a>\n"
2828
if {[anycap jor]} {
2929
html "<a href='$home/timeline'>Timeline</a>\n"
3030
}
31
-if {[hascap oh]} {
31
+if {[anoncap oh]} {
3232
html "<a href='$home/tree?ci=tip'>Files</a>\n"
3333
}
34
-if {[hascap o]} {
34
+if {[anoncap o]} {
3535
html "<a href='$home/brlist'>Branches</a>\n"
3636
html "<a href='$home/taglist'>Tags</a>\n"
3737
}
38
-if {[hascap r]} {
38
+if {[anoncap r]} {
3939
html "<a href='$home/ticket'>Tickets</a>\n"
4040
}
41
-if {[hascap j]} {
41
+if {[anoncap j]} {
4242
html "<a href='$home/wiki'>Wiki</a>\n"
4343
}
4444
if {[hascap s]} {
4545
html "<a href='$home/setup'>Admin</a>\n"
4646
} elseif {[hascap a]} {
4747
--- skins/rounded1/header.txt
+++ skins/rounded1/header.txt
@@ -26,21 +26,21 @@
26 <th1>
27 html "<a href='$home$index_page'>Home</a>\n"
28 if {[anycap jor]} {
29 html "<a href='$home/timeline'>Timeline</a>\n"
30 }
31 if {[hascap oh]} {
32 html "<a href='$home/tree?ci=tip'>Files</a>\n"
33 }
34 if {[hascap o]} {
35 html "<a href='$home/brlist'>Branches</a>\n"
36 html "<a href='$home/taglist'>Tags</a>\n"
37 }
38 if {[hascap r]} {
39 html "<a href='$home/ticket'>Tickets</a>\n"
40 }
41 if {[hascap j]} {
42 html "<a href='$home/wiki'>Wiki</a>\n"
43 }
44 if {[hascap s]} {
45 html "<a href='$home/setup'>Admin</a>\n"
46 } elseif {[hascap a]} {
47
--- skins/rounded1/header.txt
+++ skins/rounded1/header.txt
@@ -26,21 +26,21 @@
26 <th1>
27 html "<a href='$home$index_page'>Home</a>\n"
28 if {[anycap jor]} {
29 html "<a href='$home/timeline'>Timeline</a>\n"
30 }
31 if {[anoncap oh]} {
32 html "<a href='$home/tree?ci=tip'>Files</a>\n"
33 }
34 if {[anoncap o]} {
35 html "<a href='$home/brlist'>Branches</a>\n"
36 html "<a href='$home/taglist'>Tags</a>\n"
37 }
38 if {[anoncap r]} {
39 html "<a href='$home/ticket'>Tickets</a>\n"
40 }
41 if {[anoncap j]} {
42 html "<a href='$home/wiki'>Wiki</a>\n"
43 }
44 if {[hascap s]} {
45 html "<a href='$home/setup'>Admin</a>\n"
46 } elseif {[hascap a]} {
47
+4 -4
--- src/info.c
+++ src/info.c
@@ -657,11 +657,11 @@
657657
}
658658
db_finalize(&q2);
659659
660660
661661
/* The Download: line */
662
- if( g.perm.Zip || g.anon.Zip ){
662
+ if( g.anon.Zip ){
663663
char *zUrl = mprintf("%R/tarball/%t-%S.tar.gz?uuid=%s",
664664
zPJ, zUuid, zUuid);
665665
@ </td></tr>
666666
@ <tr><th>Downloads:</th><td>
667667
@ %z(href("%s",zUrl))Tarball</a>
@@ -674,11 +674,11 @@
674674
@ <td>
675675
@ %z(href("%R/tree?ci=%!S",zUuid))files</a>
676676
@ | %z(href("%R/fileage?name=%!S",zUuid))file ages</a>
677677
@ | %z(href("%R/tree?nofiles&type=tree&ci=%!S",zUuid))folders</a>
678678
@ | %z(href("%R/artifact/%!S",zUuid))manifest</a>
679
- if( g.perm.Write || g.anon.Write ){
679
+ if( g.anon.Write ){
680680
@ | %z(href("%R/ci_edit?r=%!S",zUuid))edit</a>
681681
}
682682
@ </td>
683683
@ </tr>
684684
blob_reset(&projName);
@@ -1363,17 +1363,17 @@
13631363
}else{
13641364
@ Attachment "%h(zFilename)" to
13651365
}
13661366
objType |= OBJTYPE_ATTACHMENT;
13671367
if( strlen(zTarget)==UUID_SIZE && validate16(zTarget,UUID_SIZE) ){
1368
- if( g.perm.Hyperlink && (g.perm.RdTkt || g.anon.RdTkt) ){
1368
+ if( g.perm.Hyperlink && g.anon.RdTkt ){
13691369
@ ticket [%z(href("%R/tktview?name=%!S",zTarget))%S(zTarget)</a>]
13701370
}else{
13711371
@ ticket [%S(zTarget)]
13721372
}
13731373
}else{
1374
- if( g.perm.Hyperlink && (g.perm.RdWiki || g.anon.RdWiki) ){
1374
+ if( g.perm.Hyperlink && g.anon.RdWiki ){
13751375
@ wiki page [%z(href("%R/wiki?name=%t",zTarget))%h(zTarget)</a>]
13761376
}else{
13771377
@ wiki page [%h(zTarget)]
13781378
}
13791379
}
13801380
--- src/info.c
+++ src/info.c
@@ -657,11 +657,11 @@
657 }
658 db_finalize(&q2);
659
660
661 /* The Download: line */
662 if( g.perm.Zip || g.anon.Zip ){
663 char *zUrl = mprintf("%R/tarball/%t-%S.tar.gz?uuid=%s",
664 zPJ, zUuid, zUuid);
665 @ </td></tr>
666 @ <tr><th>Downloads:</th><td>
667 @ %z(href("%s",zUrl))Tarball</a>
@@ -674,11 +674,11 @@
674 @ <td>
675 @ %z(href("%R/tree?ci=%!S",zUuid))files</a>
676 @ | %z(href("%R/fileage?name=%!S",zUuid))file ages</a>
677 @ | %z(href("%R/tree?nofiles&type=tree&ci=%!S",zUuid))folders</a>
678 @ | %z(href("%R/artifact/%!S",zUuid))manifest</a>
679 if( g.perm.Write || g.anon.Write ){
680 @ | %z(href("%R/ci_edit?r=%!S",zUuid))edit</a>
681 }
682 @ </td>
683 @ </tr>
684 blob_reset(&projName);
@@ -1363,17 +1363,17 @@
1363 }else{
1364 @ Attachment "%h(zFilename)" to
1365 }
1366 objType |= OBJTYPE_ATTACHMENT;
1367 if( strlen(zTarget)==UUID_SIZE && validate16(zTarget,UUID_SIZE) ){
1368 if( g.perm.Hyperlink && (g.perm.RdTkt || g.anon.RdTkt) ){
1369 @ ticket [%z(href("%R/tktview?name=%!S",zTarget))%S(zTarget)</a>]
1370 }else{
1371 @ ticket [%S(zTarget)]
1372 }
1373 }else{
1374 if( g.perm.Hyperlink && (g.perm.RdWiki || g.anon.RdWiki) ){
1375 @ wiki page [%z(href("%R/wiki?name=%t",zTarget))%h(zTarget)</a>]
1376 }else{
1377 @ wiki page [%h(zTarget)]
1378 }
1379 }
1380
--- src/info.c
+++ src/info.c
@@ -657,11 +657,11 @@
657 }
658 db_finalize(&q2);
659
660
661 /* The Download: line */
662 if( g.anon.Zip ){
663 char *zUrl = mprintf("%R/tarball/%t-%S.tar.gz?uuid=%s",
664 zPJ, zUuid, zUuid);
665 @ </td></tr>
666 @ <tr><th>Downloads:</th><td>
667 @ %z(href("%s",zUrl))Tarball</a>
@@ -674,11 +674,11 @@
674 @ <td>
675 @ %z(href("%R/tree?ci=%!S",zUuid))files</a>
676 @ | %z(href("%R/fileage?name=%!S",zUuid))file ages</a>
677 @ | %z(href("%R/tree?nofiles&type=tree&ci=%!S",zUuid))folders</a>
678 @ | %z(href("%R/artifact/%!S",zUuid))manifest</a>
679 if( g.anon.Write ){
680 @ | %z(href("%R/ci_edit?r=%!S",zUuid))edit</a>
681 }
682 @ </td>
683 @ </tr>
684 blob_reset(&projName);
@@ -1363,17 +1363,17 @@
1363 }else{
1364 @ Attachment "%h(zFilename)" to
1365 }
1366 objType |= OBJTYPE_ATTACHMENT;
1367 if( strlen(zTarget)==UUID_SIZE && validate16(zTarget,UUID_SIZE) ){
1368 if( g.perm.Hyperlink && g.anon.RdTkt ){
1369 @ ticket [%z(href("%R/tktview?name=%!S",zTarget))%S(zTarget)</a>]
1370 }else{
1371 @ ticket [%S(zTarget)]
1372 }
1373 }else{
1374 if( g.perm.Hyperlink && g.anon.RdWiki ){
1375 @ wiki page [%z(href("%R/wiki?name=%t",zTarget))%h(zTarget)</a>]
1376 }else{
1377 @ wiki page [%h(zTarget)]
1378 }
1379 }
1380
+36 -24
--- src/login.c
+++ src/login.c
@@ -447,27 +447,31 @@
447447
}
448448
sqlite3_result_int(context, rc);
449449
}
450450
451451
/*
452
+** There used to be a page named "my" that was designed to show information
453
+** about a specific user. The "my" page was linked from the "Logged in as USER"
454
+** line on the title bar. The "my" page was never completed so it is now
455
+** removed. Use this page as a placeholder in older installations.
456
+**
452457
** WEBPAGE: login
453458
** WEBPAGE: logout
454459
** WEBPAGE: my
455460
**
456
-** Generate the login page.
461
+** The login/logout page. Parameters:
457462
**
458
-** There used to be a page named "my" that was designed to show information
459
-** about a specific user. The "my" page was linked from the "Logged in as USER"
460
-** line on the title bar. The "my" page was never completed so it is now
461
-** removed. Use this page as a placeholder in older installations.
463
+** g=URL Jump back to this URL after login completes
464
+** anon The g=URL is not accessible by "nobody" but is
465
+** accessible by "anonymous"
462466
*/
463467
void login_page(void){
464468
const char *zUsername, *zPasswd;
465469
const char *zNew1, *zNew2;
466470
const char *zAnonPw = 0;
467471
const char *zGoto = P("g");
468
- int anonFlag = PB("anon");
472
+ int anonFlag; /* Login as "anonymous" would be useful */
469473
char *zErrMsg = "";
470474
int uid; /* User id logged in user */
471475
char *zSha1Pw;
472476
const char *zIpAddr; /* IP address of requestor */
473477
const char *zReferer;
@@ -485,15 +489,20 @@
485489
}
486490
sqlite3_create_function(g.db, "constant_time_cmp", 2, SQLITE_UTF8, 0,
487491
constant_time_cmp_function, 0, 0);
488492
zUsername = P("u");
489493
zPasswd = P("p");
494
+ anonFlag = g.zLogin==0 && PB("anon");
495
+
496
+ /* Handle log-out requests */
490497
if( P("out") ){
491498
login_clear_login_data();
492499
redirect_to_g();
493500
return;
494501
}
502
+
503
+ /* Deal with password-change requests */
495504
if( g.perm.Password && zPasswd
496505
&& (zNew1 = P("n1"))!=0 && (zNew2 = P("n2"))!=0
497506
){
498507
/* The user requests a password change */
499508
zSha1Pw = sha1_shared_secret(zPasswd, g.zLogin, 0);
@@ -594,10 +603,19 @@
594603
if( zGoto ){
595604
@ <input type="hidden" name="g" value="%h(zGoto)" />
596605
}else if( zReferer && strncmp(g.zBaseURL, zReferer, strlen(g.zBaseURL))==0 ){
597606
@ <input type="hidden" name="g" value="%h(zReferer)" />
598607
}
608
+ if( anonFlag ){
609
+ @ <input type="hidden" name="anon" value="1" />
610
+ }
611
+ if( g.zLogin ){
612
+ @ <p>Currently logged in as <b>%h(g.zLogin)</b>.
613
+ @ <input type="submit" name="out" value="Logout"></p>
614
+ @ <hr />
615
+ @ <p>Change user:
616
+ }
599617
@ <table class="login_out">
600618
@ <tr>
601619
@ <td class="login_out_label">User ID:</td>
602620
if( anonFlag ){
603621
@ <td><input type="text" id="u" name="u" value="anonymous" size="30" /></td>
@@ -607,11 +625,11 @@
607625
@ </tr>
608626
@ <tr>
609627
@ <td class="login_out_label">Password:</td>
610628
@ <td><input type="password" id="p" name="p" value="" size="30" /></td>
611629
@ </tr>
612
- if( g.zLogin==0 ){
630
+ if( g.zLogin==0 && (anonFlag || zGoto==0) ){
613631
zAnonPw = db_text(0, "SELECT pw FROM user"
614632
" WHERE login='anonymous'"
615633
" AND cap!=''");
616634
}
617635
@ <tr>
@@ -632,15 +650,11 @@
632650
@ form.action = "%h(zSSL)/login";
633651
@ }
634652
}
635653
@ }
636654
@ </script>
637
- if( g.zLogin ){
638
- @ <p>You are currently logged in as <b>%h(g.zLogin)</b></p>
639
- }
640
- @ <p>By pressing the Login button, you grant permission to store an
641
- @ access token for this site in a cookie.</p>
655
+ @ <p>Pressing the Login button grants permission to store a cookie.</p>
642656
if( db_get_boolean("self-register", 0) ){
643657
@ <p>If you do not have an account, you can
644658
@ <a href="%R/register?g=%T(P("G"))">create one</a>.
645659
}
646660
if( zAnonPw ){
@@ -660,22 +674,14 @@
660674
@ onclick="gebi('u').value='anonymous'; gebi('p').value='%s(zDecoded)';" />
661675
}
662676
@ </div>
663677
free(zCaptcha);
664678
}
665
- if( g.zLogin ){
666
- @ <hr />
667
- @ <p>To log off the system (and delete your login cookie)
668
- @ press the following button:<br />
669
- @ <input type="submit" name="out" value="Logout" /></p>
670
- }
671679
@ </form>
672680
if( g.perm.Password ){
673681
@ <hr />
674
- @ <p>To change your password, enter your old password and your
675
- @ new password twice below then press the "Change Password"
676
- @ button.</p>
682
+ @ <p>Change Password for user <b>%h(g.zLogin)</b>:</p>
677683
form_begin(0, "%R/login");
678684
@ <table>
679685
@ <tr><td class="login_out_label">Old Password:</td>
680686
@ <td><input type="password" name="p" size="30" /></td></tr>
681687
@ <tr><td class="login_out_label">New Password:</td>
@@ -1006,12 +1012,16 @@
10061012
** Memory of settings
10071013
*/
10081014
static int login_anon_once = 1;
10091015
10101016
/*
1011
-** Add the default privileges of users "nobody" and "anonymous" as appropriate
1012
-** for the user g.zLogin.
1017
+** Add to g.perm the default privileges of users "nobody" and/or "anonymous"
1018
+** as appropriate for the user g.zLogin.
1019
+**
1020
+** This routine also sets up g.anon to be either a copy of g.perm for
1021
+** all logged in uses, or the privileges that would be available to "anonymous"
1022
+** if g.zLogin==0 (meaning that the user is "nobody").
10131023
*/
10141024
void login_set_anon_nobody_capabilities(void){
10151025
if( login_anon_once ){
10161026
const char *zCap;
10171027
/* All users get privileges from "nobody" */
@@ -1019,12 +1029,14 @@
10191029
login_set_capabilities(zCap, 0);
10201030
zCap = db_text("", "SELECT cap FROM user WHERE login = 'anonymous'");
10211031
if( g.zLogin && fossil_strcmp(g.zLogin, "nobody")!=0 ){
10221032
/* All logged-in users inherit privileges from "anonymous" */
10231033
login_set_capabilities(zCap, 0);
1034
+ g.anon = g.perm;
10241035
}else{
10251036
/* Record the privileges of anonymous in g.anon */
1037
+ g.anon = g.perm;
10261038
login_set_capabilities(zCap, LOGIN_ANON);
10271039
}
10281040
login_anon_once = 0;
10291041
}
10301042
}
@@ -1225,11 +1237,11 @@
12251237
blob_appendf(&redir, "%s/login?g=%T", g.zHttpsURL, zUrl);
12261238
}else{
12271239
blob_appendf(&redir, "%R/login?g=%T", zUrl);
12281240
}
12291241
if( anonOk ) blob_append(&redir, "&anon", 5);
1230
- if( zQS ){
1242
+ if( zQS && zQS[0] ){
12311243
blob_appendf(&redir, "&%s", zQS);
12321244
}
12331245
cgi_redirect(blob_str(&redir));
12341246
/* NOTREACHED */
12351247
assert(0);
12361248
--- src/login.c
+++ src/login.c
@@ -447,27 +447,31 @@
447 }
448 sqlite3_result_int(context, rc);
449 }
450
451 /*
 
 
 
 
 
452 ** WEBPAGE: login
453 ** WEBPAGE: logout
454 ** WEBPAGE: my
455 **
456 ** Generate the login page.
457 **
458 ** There used to be a page named "my" that was designed to show information
459 ** about a specific user. The "my" page was linked from the "Logged in as USER"
460 ** line on the title bar. The "my" page was never completed so it is now
461 ** removed. Use this page as a placeholder in older installations.
462 */
463 void login_page(void){
464 const char *zUsername, *zPasswd;
465 const char *zNew1, *zNew2;
466 const char *zAnonPw = 0;
467 const char *zGoto = P("g");
468 int anonFlag = PB("anon");
469 char *zErrMsg = "";
470 int uid; /* User id logged in user */
471 char *zSha1Pw;
472 const char *zIpAddr; /* IP address of requestor */
473 const char *zReferer;
@@ -485,15 +489,20 @@
485 }
486 sqlite3_create_function(g.db, "constant_time_cmp", 2, SQLITE_UTF8, 0,
487 constant_time_cmp_function, 0, 0);
488 zUsername = P("u");
489 zPasswd = P("p");
 
 
 
490 if( P("out") ){
491 login_clear_login_data();
492 redirect_to_g();
493 return;
494 }
 
 
495 if( g.perm.Password && zPasswd
496 && (zNew1 = P("n1"))!=0 && (zNew2 = P("n2"))!=0
497 ){
498 /* The user requests a password change */
499 zSha1Pw = sha1_shared_secret(zPasswd, g.zLogin, 0);
@@ -594,10 +603,19 @@
594 if( zGoto ){
595 @ <input type="hidden" name="g" value="%h(zGoto)" />
596 }else if( zReferer && strncmp(g.zBaseURL, zReferer, strlen(g.zBaseURL))==0 ){
597 @ <input type="hidden" name="g" value="%h(zReferer)" />
598 }
 
 
 
 
 
 
 
 
 
599 @ <table class="login_out">
600 @ <tr>
601 @ <td class="login_out_label">User ID:</td>
602 if( anonFlag ){
603 @ <td><input type="text" id="u" name="u" value="anonymous" size="30" /></td>
@@ -607,11 +625,11 @@
607 @ </tr>
608 @ <tr>
609 @ <td class="login_out_label">Password:</td>
610 @ <td><input type="password" id="p" name="p" value="" size="30" /></td>
611 @ </tr>
612 if( g.zLogin==0 ){
613 zAnonPw = db_text(0, "SELECT pw FROM user"
614 " WHERE login='anonymous'"
615 " AND cap!=''");
616 }
617 @ <tr>
@@ -632,15 +650,11 @@
632 @ form.action = "%h(zSSL)/login";
633 @ }
634 }
635 @ }
636 @ </script>
637 if( g.zLogin ){
638 @ <p>You are currently logged in as <b>%h(g.zLogin)</b></p>
639 }
640 @ <p>By pressing the Login button, you grant permission to store an
641 @ access token for this site in a cookie.</p>
642 if( db_get_boolean("self-register", 0) ){
643 @ <p>If you do not have an account, you can
644 @ <a href="%R/register?g=%T(P("G"))">create one</a>.
645 }
646 if( zAnonPw ){
@@ -660,22 +674,14 @@
660 @ onclick="gebi('u').value='anonymous'; gebi('p').value='%s(zDecoded)';" />
661 }
662 @ </div>
663 free(zCaptcha);
664 }
665 if( g.zLogin ){
666 @ <hr />
667 @ <p>To log off the system (and delete your login cookie)
668 @ press the following button:<br />
669 @ <input type="submit" name="out" value="Logout" /></p>
670 }
671 @ </form>
672 if( g.perm.Password ){
673 @ <hr />
674 @ <p>To change your password, enter your old password and your
675 @ new password twice below then press the "Change Password"
676 @ button.</p>
677 form_begin(0, "%R/login");
678 @ <table>
679 @ <tr><td class="login_out_label">Old Password:</td>
680 @ <td><input type="password" name="p" size="30" /></td></tr>
681 @ <tr><td class="login_out_label">New Password:</td>
@@ -1006,12 +1012,16 @@
1006 ** Memory of settings
1007 */
1008 static int login_anon_once = 1;
1009
1010 /*
1011 ** Add the default privileges of users "nobody" and "anonymous" as appropriate
1012 ** for the user g.zLogin.
 
 
 
 
1013 */
1014 void login_set_anon_nobody_capabilities(void){
1015 if( login_anon_once ){
1016 const char *zCap;
1017 /* All users get privileges from "nobody" */
@@ -1019,12 +1029,14 @@
1019 login_set_capabilities(zCap, 0);
1020 zCap = db_text("", "SELECT cap FROM user WHERE login = 'anonymous'");
1021 if( g.zLogin && fossil_strcmp(g.zLogin, "nobody")!=0 ){
1022 /* All logged-in users inherit privileges from "anonymous" */
1023 login_set_capabilities(zCap, 0);
 
1024 }else{
1025 /* Record the privileges of anonymous in g.anon */
 
1026 login_set_capabilities(zCap, LOGIN_ANON);
1027 }
1028 login_anon_once = 0;
1029 }
1030 }
@@ -1225,11 +1237,11 @@
1225 blob_appendf(&redir, "%s/login?g=%T", g.zHttpsURL, zUrl);
1226 }else{
1227 blob_appendf(&redir, "%R/login?g=%T", zUrl);
1228 }
1229 if( anonOk ) blob_append(&redir, "&anon", 5);
1230 if( zQS ){
1231 blob_appendf(&redir, "&%s", zQS);
1232 }
1233 cgi_redirect(blob_str(&redir));
1234 /* NOTREACHED */
1235 assert(0);
1236
--- src/login.c
+++ src/login.c
@@ -447,27 +447,31 @@
447 }
448 sqlite3_result_int(context, rc);
449 }
450
451 /*
452 ** There used to be a page named "my" that was designed to show information
453 ** about a specific user. The "my" page was linked from the "Logged in as USER"
454 ** line on the title bar. The "my" page was never completed so it is now
455 ** removed. Use this page as a placeholder in older installations.
456 **
457 ** WEBPAGE: login
458 ** WEBPAGE: logout
459 ** WEBPAGE: my
460 **
461 ** The login/logout page. Parameters:
462 **
463 ** g=URL Jump back to this URL after login completes
464 ** anon The g=URL is not accessible by "nobody" but is
465 ** accessible by "anonymous"
 
466 */
467 void login_page(void){
468 const char *zUsername, *zPasswd;
469 const char *zNew1, *zNew2;
470 const char *zAnonPw = 0;
471 const char *zGoto = P("g");
472 int anonFlag; /* Login as "anonymous" would be useful */
473 char *zErrMsg = "";
474 int uid; /* User id logged in user */
475 char *zSha1Pw;
476 const char *zIpAddr; /* IP address of requestor */
477 const char *zReferer;
@@ -485,15 +489,20 @@
489 }
490 sqlite3_create_function(g.db, "constant_time_cmp", 2, SQLITE_UTF8, 0,
491 constant_time_cmp_function, 0, 0);
492 zUsername = P("u");
493 zPasswd = P("p");
494 anonFlag = g.zLogin==0 && PB("anon");
495
496 /* Handle log-out requests */
497 if( P("out") ){
498 login_clear_login_data();
499 redirect_to_g();
500 return;
501 }
502
503 /* Deal with password-change requests */
504 if( g.perm.Password && zPasswd
505 && (zNew1 = P("n1"))!=0 && (zNew2 = P("n2"))!=0
506 ){
507 /* The user requests a password change */
508 zSha1Pw = sha1_shared_secret(zPasswd, g.zLogin, 0);
@@ -594,10 +603,19 @@
603 if( zGoto ){
604 @ <input type="hidden" name="g" value="%h(zGoto)" />
605 }else if( zReferer && strncmp(g.zBaseURL, zReferer, strlen(g.zBaseURL))==0 ){
606 @ <input type="hidden" name="g" value="%h(zReferer)" />
607 }
608 if( anonFlag ){
609 @ <input type="hidden" name="anon" value="1" />
610 }
611 if( g.zLogin ){
612 @ <p>Currently logged in as <b>%h(g.zLogin)</b>.
613 @ <input type="submit" name="out" value="Logout"></p>
614 @ <hr />
615 @ <p>Change user:
616 }
617 @ <table class="login_out">
618 @ <tr>
619 @ <td class="login_out_label">User ID:</td>
620 if( anonFlag ){
621 @ <td><input type="text" id="u" name="u" value="anonymous" size="30" /></td>
@@ -607,11 +625,11 @@
625 @ </tr>
626 @ <tr>
627 @ <td class="login_out_label">Password:</td>
628 @ <td><input type="password" id="p" name="p" value="" size="30" /></td>
629 @ </tr>
630 if( g.zLogin==0 && (anonFlag || zGoto==0) ){
631 zAnonPw = db_text(0, "SELECT pw FROM user"
632 " WHERE login='anonymous'"
633 " AND cap!=''");
634 }
635 @ <tr>
@@ -632,15 +650,11 @@
650 @ form.action = "%h(zSSL)/login";
651 @ }
652 }
653 @ }
654 @ </script>
655 @ <p>Pressing the Login button grants permission to store a cookie.</p>
 
 
 
 
656 if( db_get_boolean("self-register", 0) ){
657 @ <p>If you do not have an account, you can
658 @ <a href="%R/register?g=%T(P("G"))">create one</a>.
659 }
660 if( zAnonPw ){
@@ -660,22 +674,14 @@
674 @ onclick="gebi('u').value='anonymous'; gebi('p').value='%s(zDecoded)';" />
675 }
676 @ </div>
677 free(zCaptcha);
678 }
 
 
 
 
 
 
679 @ </form>
680 if( g.perm.Password ){
681 @ <hr />
682 @ <p>Change Password for user <b>%h(g.zLogin)</b>:</p>
 
 
683 form_begin(0, "%R/login");
684 @ <table>
685 @ <tr><td class="login_out_label">Old Password:</td>
686 @ <td><input type="password" name="p" size="30" /></td></tr>
687 @ <tr><td class="login_out_label">New Password:</td>
@@ -1006,12 +1012,16 @@
1012 ** Memory of settings
1013 */
1014 static int login_anon_once = 1;
1015
1016 /*
1017 ** Add to g.perm the default privileges of users "nobody" and/or "anonymous"
1018 ** as appropriate for the user g.zLogin.
1019 **
1020 ** This routine also sets up g.anon to be either a copy of g.perm for
1021 ** all logged in uses, or the privileges that would be available to "anonymous"
1022 ** if g.zLogin==0 (meaning that the user is "nobody").
1023 */
1024 void login_set_anon_nobody_capabilities(void){
1025 if( login_anon_once ){
1026 const char *zCap;
1027 /* All users get privileges from "nobody" */
@@ -1019,12 +1029,14 @@
1029 login_set_capabilities(zCap, 0);
1030 zCap = db_text("", "SELECT cap FROM user WHERE login = 'anonymous'");
1031 if( g.zLogin && fossil_strcmp(g.zLogin, "nobody")!=0 ){
1032 /* All logged-in users inherit privileges from "anonymous" */
1033 login_set_capabilities(zCap, 0);
1034 g.anon = g.perm;
1035 }else{
1036 /* Record the privileges of anonymous in g.anon */
1037 g.anon = g.perm;
1038 login_set_capabilities(zCap, LOGIN_ANON);
1039 }
1040 login_anon_once = 0;
1041 }
1042 }
@@ -1225,11 +1237,11 @@
1237 blob_appendf(&redir, "%s/login?g=%T", g.zHttpsURL, zUrl);
1238 }else{
1239 blob_appendf(&redir, "%R/login?g=%T", zUrl);
1240 }
1241 if( anonOk ) blob_append(&redir, "&anon", 5);
1242 if( zQS && zQS[0] ){
1243 blob_appendf(&redir, "&%s", zQS);
1244 }
1245 cgi_redirect(blob_str(&redir));
1246 /* NOTREACHED */
1247 assert(0);
1248
+3 -1
--- src/main.c
+++ src/main.c
@@ -196,11 +196,13 @@
196196
char *zNonce; /* The nonce used for login */
197197
198198
/* permissions available to current user */
199199
struct FossilUserPerms perm;
200200
201
- /* permissions available to user "anonymous" */
201
+ /* permissions available to current user or to "anonymous".
202
+ ** This is the logical union of perm permissions above with
203
+ ** the value that perm would take if g.zLogin were "anonymous". */
202204
struct FossilUserPerms anon;
203205
204206
#ifdef FOSSIL_ENABLE_TCL
205207
/* all Tcl related context necessary for integration */
206208
struct TclContext tcl;
207209
--- src/main.c
+++ src/main.c
@@ -196,11 +196,13 @@
196 char *zNonce; /* The nonce used for login */
197
198 /* permissions available to current user */
199 struct FossilUserPerms perm;
200
201 /* permissions available to user "anonymous" */
 
 
202 struct FossilUserPerms anon;
203
204 #ifdef FOSSIL_ENABLE_TCL
205 /* all Tcl related context necessary for integration */
206 struct TclContext tcl;
207
--- src/main.c
+++ src/main.c
@@ -196,11 +196,13 @@
196 char *zNonce; /* The nonce used for login */
197
198 /* permissions available to current user */
199 struct FossilUserPerms perm;
200
201 /* permissions available to current user or to "anonymous".
202 ** This is the logical union of perm permissions above with
203 ** the value that perm would take if g.zLogin were "anonymous". */
204 struct FossilUserPerms anon;
205
206 #ifdef FOSSIL_ENABLE_TCL
207 /* all Tcl related context necessary for integration */
208 struct TclContext tcl;
209
+4 -4
--- src/tkt.c
+++ src/tkt.c
@@ -450,11 +450,11 @@
450450
char *zFullName;
451451
const char *zUuid = PD("name","");
452452
453453
login_check_credentials();
454454
if( !g.perm.RdTkt ){ login_needed(g.anon.RdTkt); return; }
455
- if( g.perm.WrTkt || g.perm.ApndTkt ){
455
+ if( g.anon.WrTkt || g.anon.ApndTkt ){
456456
style_submenu_element("Edit", "Edit The Ticket", "%s/tktedit?name=%T",
457457
g.zTop, PD("name",""));
458458
}
459459
if( g.perm.Hyperlink ){
460460
style_submenu_element("History", "History Of This Ticket",
@@ -462,15 +462,15 @@
462462
style_submenu_element("Timeline", "Timeline Of This Ticket",
463463
"%s/tkttimeline/%T", g.zTop, zUuid);
464464
style_submenu_element("Check-ins", "Check-ins Of This Ticket",
465465
"%s/tkttimeline/%T?y=ci", g.zTop, zUuid);
466466
}
467
- if( g.perm.NewTkt ){
467
+ if( g.anon.NewTkt ){
468468
style_submenu_element("New Ticket", "Create a new ticket",
469469
"%s/tktnew", g.zTop);
470470
}
471
- if( g.perm.ApndTkt && g.perm.Attach ){
471
+ if( g.anon.ApndTkt && g.anon.Attach ){
472472
style_submenu_element("Attach", "Add An Attachment",
473473
"%s/attachadd?tkt=%T&from=%s/tktview/%t",
474474
g.zTop, zUuid, g.zTop, zUuid);
475475
}
476476
if( P("plaintext") ){
@@ -1412,11 +1412,11 @@
14121412
style_submenu_element("Search","Search","%R/tktsrch");
14131413
}
14141414
if( (ok & T_REPLIST)!=0 ){
14151415
style_submenu_element("Reports","Reports","%R/reportlist");
14161416
}
1417
- if( (ok & T_NEW)!=0 && g.perm.NewTkt ){
1417
+ if( (ok & T_NEW)!=0 && g.anon.NewTkt ){
14181418
style_submenu_element("New","New","%R/tktnew");
14191419
}
14201420
}
14211421
14221422
/*
14231423
--- src/tkt.c
+++ src/tkt.c
@@ -450,11 +450,11 @@
450 char *zFullName;
451 const char *zUuid = PD("name","");
452
453 login_check_credentials();
454 if( !g.perm.RdTkt ){ login_needed(g.anon.RdTkt); return; }
455 if( g.perm.WrTkt || g.perm.ApndTkt ){
456 style_submenu_element("Edit", "Edit The Ticket", "%s/tktedit?name=%T",
457 g.zTop, PD("name",""));
458 }
459 if( g.perm.Hyperlink ){
460 style_submenu_element("History", "History Of This Ticket",
@@ -462,15 +462,15 @@
462 style_submenu_element("Timeline", "Timeline Of This Ticket",
463 "%s/tkttimeline/%T", g.zTop, zUuid);
464 style_submenu_element("Check-ins", "Check-ins Of This Ticket",
465 "%s/tkttimeline/%T?y=ci", g.zTop, zUuid);
466 }
467 if( g.perm.NewTkt ){
468 style_submenu_element("New Ticket", "Create a new ticket",
469 "%s/tktnew", g.zTop);
470 }
471 if( g.perm.ApndTkt && g.perm.Attach ){
472 style_submenu_element("Attach", "Add An Attachment",
473 "%s/attachadd?tkt=%T&from=%s/tktview/%t",
474 g.zTop, zUuid, g.zTop, zUuid);
475 }
476 if( P("plaintext") ){
@@ -1412,11 +1412,11 @@
1412 style_submenu_element("Search","Search","%R/tktsrch");
1413 }
1414 if( (ok & T_REPLIST)!=0 ){
1415 style_submenu_element("Reports","Reports","%R/reportlist");
1416 }
1417 if( (ok & T_NEW)!=0 && g.perm.NewTkt ){
1418 style_submenu_element("New","New","%R/tktnew");
1419 }
1420 }
1421
1422 /*
1423
--- src/tkt.c
+++ src/tkt.c
@@ -450,11 +450,11 @@
450 char *zFullName;
451 const char *zUuid = PD("name","");
452
453 login_check_credentials();
454 if( !g.perm.RdTkt ){ login_needed(g.anon.RdTkt); return; }
455 if( g.anon.WrTkt || g.anon.ApndTkt ){
456 style_submenu_element("Edit", "Edit The Ticket", "%s/tktedit?name=%T",
457 g.zTop, PD("name",""));
458 }
459 if( g.perm.Hyperlink ){
460 style_submenu_element("History", "History Of This Ticket",
@@ -462,15 +462,15 @@
462 style_submenu_element("Timeline", "Timeline Of This Ticket",
463 "%s/tkttimeline/%T", g.zTop, zUuid);
464 style_submenu_element("Check-ins", "Check-ins Of This Ticket",
465 "%s/tkttimeline/%T?y=ci", g.zTop, zUuid);
466 }
467 if( g.anon.NewTkt ){
468 style_submenu_element("New Ticket", "Create a new ticket",
469 "%s/tktnew", g.zTop);
470 }
471 if( g.anon.ApndTkt && g.anon.Attach ){
472 style_submenu_element("Attach", "Add An Attachment",
473 "%s/attachadd?tkt=%T&from=%s/tktview/%t",
474 g.zTop, zUuid, g.zTop, zUuid);
475 }
476 if( P("plaintext") ){
@@ -1412,11 +1412,11 @@
1412 style_submenu_element("Search","Search","%R/tktsrch");
1413 }
1414 if( (ok & T_REPLIST)!=0 ){
1415 style_submenu_element("Reports","Reports","%R/reportlist");
1416 }
1417 if( (ok & T_NEW)!=0 && g.anon.NewTkt ){
1418 style_submenu_element("New","New","%R/tktnew");
1419 }
1420 }
1421
1422 /*
1423
+4 -4
--- src/tktsetup.c
+++ src/tktsetup.c
@@ -715,11 +715,11 @@
715715
/*
716716
** The default report list page
717717
*/
718718
static const char zDefaultReportList[] =
719719
@ <th1>
720
-@ if {[hascap n]} {
720
+@ if {[anoncap n]} {
721721
@ html "<p>Enter a new ticket:</p>"
722722
@ html "<ul><li><a href='tktnew'>New ticket</a></li></ul>"
723723
@ }
724724
@ </th1>
725725
@
@@ -727,16 +727,16 @@
727727
@ <ol>
728728
@ <th1>html $report_items</th1>
729729
@ </ol>
730730
@
731731
@ <th1>
732
-@ if {[hascap t q]} {
732
+@ if {[anoncap t q]} {
733733
@ html "<p>Other options:</p>\n<ul>\n"
734
-@ if {[hascap t]} {
734
+@ if {[anoncap t]} {
735735
@ html "<li><a href='rptnew'>New report format</a></li>\n"
736736
@ }
737
-@ if {[hascap q]} {
737
+@ if {[anoncap q]} {
738738
@ html "<li><a href='modreq'>Tend to pending moderation requests</a></li>\n"
739739
@ }
740740
@ }
741741
@ </th1>
742742
;
743743
--- src/tktsetup.c
+++ src/tktsetup.c
@@ -715,11 +715,11 @@
715 /*
716 ** The default report list page
717 */
718 static const char zDefaultReportList[] =
719 @ <th1>
720 @ if {[hascap n]} {
721 @ html "<p>Enter a new ticket:</p>"
722 @ html "<ul><li><a href='tktnew'>New ticket</a></li></ul>"
723 @ }
724 @ </th1>
725 @
@@ -727,16 +727,16 @@
727 @ <ol>
728 @ <th1>html $report_items</th1>
729 @ </ol>
730 @
731 @ <th1>
732 @ if {[hascap t q]} {
733 @ html "<p>Other options:</p>\n<ul>\n"
734 @ if {[hascap t]} {
735 @ html "<li><a href='rptnew'>New report format</a></li>\n"
736 @ }
737 @ if {[hascap q]} {
738 @ html "<li><a href='modreq'>Tend to pending moderation requests</a></li>\n"
739 @ }
740 @ }
741 @ </th1>
742 ;
743
--- src/tktsetup.c
+++ src/tktsetup.c
@@ -715,11 +715,11 @@
715 /*
716 ** The default report list page
717 */
718 static const char zDefaultReportList[] =
719 @ <th1>
720 @ if {[anoncap n]} {
721 @ html "<p>Enter a new ticket:</p>"
722 @ html "<ul><li><a href='tktnew'>New ticket</a></li></ul>"
723 @ }
724 @ </th1>
725 @
@@ -727,16 +727,16 @@
727 @ <ol>
728 @ <th1>html $report_items</th1>
729 @ </ol>
730 @
731 @ <th1>
732 @ if {[anoncap t q]} {
733 @ html "<p>Other options:</p>\n<ul>\n"
734 @ if {[anoncap t]} {
735 @ html "<li><a href='rptnew'>New report format</a></li>\n"
736 @ }
737 @ if {[anoncap q]} {
738 @ html "<li><a href='modreq'>Tend to pending moderation requests</a></li>\n"
739 @ }
740 @ }
741 @ </th1>
742 ;
743
+8 -8
--- src/wiki.c
+++ src/wiki.c
@@ -222,11 +222,11 @@
222222
style_submenu_element("List","List","%R/wcontent");
223223
}
224224
if( (ok & W_HELP)!=0 ){
225225
style_submenu_element("Help","Help","%R/wikihelp");
226226
}
227
- if( (ok & W_NEW)!=0 && g.perm.NewWiki ){
227
+ if( (ok & W_NEW)!=0 && g.anon.NewWiki ){
228228
style_submenu_element("New","New","%R/wikinew");
229229
}
230230
#if 0
231231
if( (ok & W_BLOG)!=0
232232
#endif
@@ -261,19 +261,19 @@
261261
@ <li> %z(href("%R/timeline?y=w"))Recent changes</a> to wiki pages.</li>
262262
@ <li> Formatting rules for %z(href("%R/wiki_rules"))Fossil Wiki</a> and for
263263
@ %z(href("%R/md_rules"))Markdown Wiki</a>.</li>
264264
@ <li> Use the %z(href("%R/wiki?name=Sandbox"))Sandbox</a>
265265
@ to experiment.</li>
266
- if( g.perm.NewWiki ){
266
+ if( g.anon.NewWiki ){
267267
@ <li> Create a %z(href("%R/wikinew"))new wiki page</a>.</li>
268
- if( g.perm.Write ){
269
- @ <li> Create a %z(href("%R/eventedit"))new blog entry</a>.</li>
268
+ if( g.anon.Write ){
269
+ @ <li> Create a %z(href("%R/eventedit"))new tech-note</a>.</li>
270270
}
271271
}
272272
@ <li> %z(href("%R/wcontent"))List of All Wiki Pages</a>
273273
@ available on this server.</li>
274
- if( g.perm.ModWiki ){
274
+ if( g.anon.ModWiki ){
275275
@ <li> %z(href("%R/modreq"))Tend to pending moderation requests</a></li>
276276
}
277277
if( search_restrict(SRCH_WIKI)!=0 ){
278278
@ <li> %z(href("%R/wikisrch"))Search</a> for wiki pages containing key
279279
@ words</li>
@@ -355,11 +355,11 @@
355355
"%R/wdiff?name=%T&a=%d", zPageName, rid);
356356
zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
357357
style_submenu_element("Details", "Details",
358358
"%R/info/%s", zUuid);
359359
}
360
- if( (rid && g.perm.WrWiki) || (!rid && g.perm.NewWiki) ){
360
+ if( (rid && g.anon.WrWiki) || (!rid && g.anon.NewWiki) ){
361361
if( db_get_boolean("wysiwyg-wiki", 0) ){
362362
style_submenu_element("Edit", "Edit Wiki Page",
363363
"%s/wikiedit?name=%T&wysiwyg=1",
364364
g.zTop, zPageName);
365365
}else{
@@ -366,16 +366,16 @@
366366
style_submenu_element("Edit", "Edit Wiki Page",
367367
"%s/wikiedit?name=%T",
368368
g.zTop, zPageName);
369369
}
370370
}
371
- if( rid && g.perm.ApndWiki && g.perm.Attach ){
371
+ if( rid && g.anon.ApndWiki && g.anon.Attach ){
372372
style_submenu_element("Attach", "Add An Attachment",
373373
"%s/attachadd?page=%T&from=%s/wiki%%3fname=%T",
374374
g.zTop, zPageName, g.zTop, zPageName);
375375
}
376
- if( rid && g.perm.ApndWiki ){
376
+ if( rid && g.anon.ApndWiki ){
377377
style_submenu_element("Append", "Add A Comment",
378378
"%s/wikiappend?name=%T&mimetype=%s",
379379
g.zTop, zPageName, zMimetype);
380380
}
381381
if( g.perm.Hyperlink ){
382382
--- src/wiki.c
+++ src/wiki.c
@@ -222,11 +222,11 @@
222 style_submenu_element("List","List","%R/wcontent");
223 }
224 if( (ok & W_HELP)!=0 ){
225 style_submenu_element("Help","Help","%R/wikihelp");
226 }
227 if( (ok & W_NEW)!=0 && g.perm.NewWiki ){
228 style_submenu_element("New","New","%R/wikinew");
229 }
230 #if 0
231 if( (ok & W_BLOG)!=0
232 #endif
@@ -261,19 +261,19 @@
261 @ <li> %z(href("%R/timeline?y=w"))Recent changes</a> to wiki pages.</li>
262 @ <li> Formatting rules for %z(href("%R/wiki_rules"))Fossil Wiki</a> and for
263 @ %z(href("%R/md_rules"))Markdown Wiki</a>.</li>
264 @ <li> Use the %z(href("%R/wiki?name=Sandbox"))Sandbox</a>
265 @ to experiment.</li>
266 if( g.perm.NewWiki ){
267 @ <li> Create a %z(href("%R/wikinew"))new wiki page</a>.</li>
268 if( g.perm.Write ){
269 @ <li> Create a %z(href("%R/eventedit"))new blog entry</a>.</li>
270 }
271 }
272 @ <li> %z(href("%R/wcontent"))List of All Wiki Pages</a>
273 @ available on this server.</li>
274 if( g.perm.ModWiki ){
275 @ <li> %z(href("%R/modreq"))Tend to pending moderation requests</a></li>
276 }
277 if( search_restrict(SRCH_WIKI)!=0 ){
278 @ <li> %z(href("%R/wikisrch"))Search</a> for wiki pages containing key
279 @ words</li>
@@ -355,11 +355,11 @@
355 "%R/wdiff?name=%T&a=%d", zPageName, rid);
356 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
357 style_submenu_element("Details", "Details",
358 "%R/info/%s", zUuid);
359 }
360 if( (rid && g.perm.WrWiki) || (!rid && g.perm.NewWiki) ){
361 if( db_get_boolean("wysiwyg-wiki", 0) ){
362 style_submenu_element("Edit", "Edit Wiki Page",
363 "%s/wikiedit?name=%T&wysiwyg=1",
364 g.zTop, zPageName);
365 }else{
@@ -366,16 +366,16 @@
366 style_submenu_element("Edit", "Edit Wiki Page",
367 "%s/wikiedit?name=%T",
368 g.zTop, zPageName);
369 }
370 }
371 if( rid && g.perm.ApndWiki && g.perm.Attach ){
372 style_submenu_element("Attach", "Add An Attachment",
373 "%s/attachadd?page=%T&from=%s/wiki%%3fname=%T",
374 g.zTop, zPageName, g.zTop, zPageName);
375 }
376 if( rid && g.perm.ApndWiki ){
377 style_submenu_element("Append", "Add A Comment",
378 "%s/wikiappend?name=%T&mimetype=%s",
379 g.zTop, zPageName, zMimetype);
380 }
381 if( g.perm.Hyperlink ){
382
--- src/wiki.c
+++ src/wiki.c
@@ -222,11 +222,11 @@
222 style_submenu_element("List","List","%R/wcontent");
223 }
224 if( (ok & W_HELP)!=0 ){
225 style_submenu_element("Help","Help","%R/wikihelp");
226 }
227 if( (ok & W_NEW)!=0 && g.anon.NewWiki ){
228 style_submenu_element("New","New","%R/wikinew");
229 }
230 #if 0
231 if( (ok & W_BLOG)!=0
232 #endif
@@ -261,19 +261,19 @@
261 @ <li> %z(href("%R/timeline?y=w"))Recent changes</a> to wiki pages.</li>
262 @ <li> Formatting rules for %z(href("%R/wiki_rules"))Fossil Wiki</a> and for
263 @ %z(href("%R/md_rules"))Markdown Wiki</a>.</li>
264 @ <li> Use the %z(href("%R/wiki?name=Sandbox"))Sandbox</a>
265 @ to experiment.</li>
266 if( g.anon.NewWiki ){
267 @ <li> Create a %z(href("%R/wikinew"))new wiki page</a>.</li>
268 if( g.anon.Write ){
269 @ <li> Create a %z(href("%R/eventedit"))new tech-note</a>.</li>
270 }
271 }
272 @ <li> %z(href("%R/wcontent"))List of All Wiki Pages</a>
273 @ available on this server.</li>
274 if( g.anon.ModWiki ){
275 @ <li> %z(href("%R/modreq"))Tend to pending moderation requests</a></li>
276 }
277 if( search_restrict(SRCH_WIKI)!=0 ){
278 @ <li> %z(href("%R/wikisrch"))Search</a> for wiki pages containing key
279 @ words</li>
@@ -355,11 +355,11 @@
355 "%R/wdiff?name=%T&a=%d", zPageName, rid);
356 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
357 style_submenu_element("Details", "Details",
358 "%R/info/%s", zUuid);
359 }
360 if( (rid && g.anon.WrWiki) || (!rid && g.anon.NewWiki) ){
361 if( db_get_boolean("wysiwyg-wiki", 0) ){
362 style_submenu_element("Edit", "Edit Wiki Page",
363 "%s/wikiedit?name=%T&wysiwyg=1",
364 g.zTop, zPageName);
365 }else{
@@ -366,16 +366,16 @@
366 style_submenu_element("Edit", "Edit Wiki Page",
367 "%s/wikiedit?name=%T",
368 g.zTop, zPageName);
369 }
370 }
371 if( rid && g.anon.ApndWiki && g.anon.Attach ){
372 style_submenu_element("Attach", "Add An Attachment",
373 "%s/attachadd?page=%T&from=%s/wiki%%3fname=%T",
374 g.zTop, zPageName, g.zTop, zPageName);
375 }
376 if( rid && g.anon.ApndWiki ){
377 style_submenu_element("Append", "Add A Comment",
378 "%s/wikiappend?name=%T&mimetype=%s",
379 g.zTop, zPageName, zMimetype);
380 }
381 if( g.perm.Hyperlink ){
382

Keyboard Shortcuts

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