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.
Commit
72cddddbcc2e4b19ae173ff568ded585b82d393f
Parent
2f50d427a9482d4…
14 files changed
+4
-4
+4
-4
+4
-4
+4
-4
+4
-4
+4
-4
+4
-4
+4
-4
+4
-4
+36
-24
+3
-1
+4
-4
+4
-4
+8
-8
~
skins/black_and_white/header.txt
~
skins/default/header.txt
~
skins/eagle/header.txt
~
skins/enhanced1/header.txt
~
skins/etienne1/header.txt
~
skins/khaki/header.txt
~
skins/plain_gray/header.txt
~
skins/rounded1/header.txt
~
src/info.c
~
src/login.c
~
src/main.c
~
src/tkt.c
~
src/tktsetup.c
~
src/wiki.c
+4
-4
| --- skins/black_and_white/header.txt | ||
| +++ skins/black_and_white/header.txt | ||
| @@ -26,21 +26,21 @@ | ||
| 26 | 26 | <th1> |
| 27 | 27 | html "<a href='$home$index_page'>Home</a>\n" |
| 28 | 28 | if {[anycap jor]} { |
| 29 | 29 | html "<a href='$home/timeline'>Timeline</a>\n" |
| 30 | 30 | } |
| 31 | -if {[hascap oh]} { | |
| 31 | +if {[anoncap oh]} { | |
| 32 | 32 | html "<a href='$home/tree?ci=tip'>Files</a>\n" |
| 33 | 33 | } |
| 34 | -if {[hascap o]} { | |
| 34 | +if {[anoncap o]} { | |
| 35 | 35 | html "<a href='$home/brlist'>Branches</a>\n" |
| 36 | 36 | html "<a href='$home/taglist'>Tags</a>\n" |
| 37 | 37 | } |
| 38 | -if {[hascap r]} { | |
| 38 | +if {[anoncap r]} { | |
| 39 | 39 | html "<a href='$home/ticket'>Tickets</a>\n" |
| 40 | 40 | } |
| 41 | -if {[hascap j]} { | |
| 41 | +if {[anoncap j]} { | |
| 42 | 42 | html "<a href='$home/wiki'>Wiki</a>\n" |
| 43 | 43 | } |
| 44 | 44 | if {[hascap s]} { |
| 45 | 45 | html "<a href='$home/setup'>Admin</a>\n" |
| 46 | 46 | } elseif {[hascap a]} { |
| 47 | 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 {[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 |
+4
-4
| --- skins/default/header.txt | ||
| +++ skins/default/header.txt | ||
| @@ -25,21 +25,21 @@ | ||
| 25 | 25 | <th1> |
| 26 | 26 | html "<a href='$home$index_page'>Home</a>\n" |
| 27 | 27 | if {[anycap jor]} { |
| 28 | 28 | html "<a href='$home/timeline'>Timeline</a>\n" |
| 29 | 29 | } |
| 30 | -if {[hascap oh]} { | |
| 30 | +if {[anoncap oh]} { | |
| 31 | 31 | html "<a href='$home/tree?ci=tip'>Files</a>\n" |
| 32 | 32 | } |
| 33 | -if {[hascap o]} { | |
| 33 | +if {[anoncap o]} { | |
| 34 | 34 | html "<a href='$home/brlist'>Branches</a>\n" |
| 35 | 35 | html "<a href='$home/taglist'>Tags</a>\n" |
| 36 | 36 | } |
| 37 | -if {[hascap r]} { | |
| 37 | +if {[anoncap r]} { | |
| 38 | 38 | html "<a href='$home/ticket'>Tickets</a>\n" |
| 39 | 39 | } |
| 40 | -if {[hascap j]} { | |
| 40 | +if {[anoncap j]} { | |
| 41 | 41 | html "<a href='$home/wiki'>Wiki</a>\n" |
| 42 | 42 | } |
| 43 | 43 | if {[hascap s]} { |
| 44 | 44 | html "<a href='$home/setup'>Admin</a>\n" |
| 45 | 45 | } elseif {[hascap a]} { |
| 46 | 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 {[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 |
+4
-4
| --- skins/eagle/header.txt | ||
| +++ skins/eagle/header.txt | ||
| @@ -106,21 +106,21 @@ | ||
| 106 | 106 | html "<a href='$home$index_page'>Home</a>\n" |
| 107 | 107 | html "<a href='$home/help'>Help</a>\n" |
| 108 | 108 | if {[anycap jor]} { |
| 109 | 109 | html "<a href='$home/timeline'>Timeline</a>\n" |
| 110 | 110 | } |
| 111 | -if {[hascap oh]} { | |
| 111 | +if {[anoncap oh]} { | |
| 112 | 112 | html "<a href='$home/tree?ci=tip'>Files</a>\n" |
| 113 | 113 | } |
| 114 | -if {[hascap o]} { | |
| 114 | +if {[anoncap o]} { | |
| 115 | 115 | html "<a href='$home/brlist'>Branches</a>\n" |
| 116 | 116 | html "<a href='$home/taglist'>Tags</a>\n" |
| 117 | 117 | } |
| 118 | -if {[hascap r]} { | |
| 118 | +if {[anoncap r]} { | |
| 119 | 119 | html "<a href='$home/ticket'>Tickets</a>\n" |
| 120 | 120 | } |
| 121 | -if {[hascap j]} { | |
| 121 | +if {[anoncap j]} { | |
| 122 | 122 | html "<a href='$home/wiki'>Wiki</a>\n" |
| 123 | 123 | } |
| 124 | 124 | if {[hascap s]} { |
| 125 | 125 | html "<a href='$home/setup'>Admin</a>\n" |
| 126 | 126 | } elseif {[hascap a]} { |
| 127 | 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 {[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 |
+4
-4
| --- skins/enhanced1/header.txt | ||
| +++ skins/enhanced1/header.txt | ||
| @@ -106,21 +106,21 @@ | ||
| 106 | 106 | html "<a href='$home$index_page'>Home</a>\n" |
| 107 | 107 | html "<a href='$home/help'>Help</a>\n" |
| 108 | 108 | if {[anycap jor]} { |
| 109 | 109 | html "<a href='$home/timeline'>Timeline</a>\n" |
| 110 | 110 | } |
| 111 | -if {[hascap oh]} { | |
| 111 | +if {[anoncap oh]} { | |
| 112 | 112 | html "<a href='$home/tree?ci=tip'>Files</a>\n" |
| 113 | 113 | } |
| 114 | -if {[hascap o]} { | |
| 114 | +if {[anoncap o]} { | |
| 115 | 115 | html "<a href='$home/brlist'>Branches</a>\n" |
| 116 | 116 | html "<a href='$home/taglist'>Tags</a>\n" |
| 117 | 117 | } |
| 118 | -if {[hascap r]} { | |
| 118 | +if {[anoncap r]} { | |
| 119 | 119 | html "<a href='$home/ticket'>Tickets</a>\n" |
| 120 | 120 | } |
| 121 | -if {[hascap j]} { | |
| 121 | +if {[anoncap j]} { | |
| 122 | 122 | html "<a href='$home/wiki'>Wiki</a>\n" |
| 123 | 123 | } |
| 124 | 124 | if {[hascap s]} { |
| 125 | 125 | html "<a href='$home/setup'>Admin</a>\n" |
| 126 | 126 | } elseif {[hascap a]} { |
| 127 | 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 {[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 |
+4
-4
| --- skins/etienne1/header.txt | ||
| +++ skins/etienne1/header.txt | ||
| @@ -65,21 +65,21 @@ | ||
| 65 | 65 | menulink "home" $index_page Home |
| 66 | 66 | |
| 67 | 67 | if {[anycap jor]} { |
| 68 | 68 | menulink "timeline" "/timeline" Timeline |
| 69 | 69 | } |
| 70 | -if {[hascap oh]} { | |
| 70 | +if {[anoncap oh]} { | |
| 71 | 71 | menulink "dir" "/dir?ci=tip" Files |
| 72 | 72 | } |
| 73 | -if {[hascap o]} { | |
| 73 | +if {[anoncap o]} { | |
| 74 | 74 | menulink "brlist" "/brlist" Branches |
| 75 | 75 | menulink "taglist" "/taglist" Tags |
| 76 | 76 | } |
| 77 | -if {[hascap r]} { | |
| 77 | +if {[anoncap r]} { | |
| 78 | 78 | menulink "ticket" "/ticket" Tickets |
| 79 | 79 | } |
| 80 | -if {[hascap j]} { | |
| 80 | +if {[anoncap j]} { | |
| 81 | 81 | menulink "wiki" "/wiki" Wiki |
| 82 | 82 | } |
| 83 | 83 | if {[hascap s]} { |
| 84 | 84 | menulink "setup" "/setup" Admin |
| 85 | 85 | } elseif {[hascap a]} { |
| 86 | 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 {[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 |
+4
-4
| --- skins/khaki/header.txt | ||
| +++ skins/khaki/header.txt | ||
| @@ -24,21 +24,21 @@ | ||
| 24 | 24 | <th1> |
| 25 | 25 | html "<a href='$home$index_page'>Home</a>\n" |
| 26 | 26 | if {[anycap jor]} { |
| 27 | 27 | html "<a href='$home/timeline'>Timeline</a>\n" |
| 28 | 28 | } |
| 29 | -if {[hascap oh]} { | |
| 29 | +if {[anoncap oh]} { | |
| 30 | 30 | html "<a href='$home/tree?ci=tip'>Files</a>\n" |
| 31 | 31 | } |
| 32 | -if {[hascap o]} { | |
| 32 | +if {[anoncap o]} { | |
| 33 | 33 | html "<a href='$home/brlist'>Branches</a>\n" |
| 34 | 34 | html "<a href='$home/taglist'>Tags</a>\n" |
| 35 | 35 | } |
| 36 | -if {[hascap r]} { | |
| 36 | +if {[anoncap r]} { | |
| 37 | 37 | html "<a href='$home/ticket'>Tickets</a>\n" |
| 38 | 38 | } |
| 39 | -if {[hascap j]} { | |
| 39 | +if {[anoncap j]} { | |
| 40 | 40 | html "<a href='$home/wiki'>Wiki</a>\n" |
| 41 | 41 | } |
| 42 | 42 | if {[hascap s]} { |
| 43 | 43 | html "<a href='$home/setup'>Admin</a>\n" |
| 44 | 44 | } elseif {[hascap a]} { |
| 45 | 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 {[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 |
+4
-4
| --- skins/plain_gray/header.txt | ||
| +++ skins/plain_gray/header.txt | ||
| @@ -22,21 +22,21 @@ | ||
| 22 | 22 | <th1> |
| 23 | 23 | html "<a href='$home$index_page'>Home</a>\n" |
| 24 | 24 | if {[anycap jor]} { |
| 25 | 25 | html "<a href='$home/timeline'>Timeline</a>\n" |
| 26 | 26 | } |
| 27 | -if {[hascap oh]} { | |
| 27 | +if {[anoncap oh]} { | |
| 28 | 28 | html "<a href='$home/tree?ci=tip'>Files</a>\n" |
| 29 | 29 | } |
| 30 | -if {[hascap o]} { | |
| 30 | +if {[anoncap o]} { | |
| 31 | 31 | html "<a href='$home/brlist'>Branches</a>\n" |
| 32 | 32 | html "<a href='$home/taglist'>Tags</a>\n" |
| 33 | 33 | } |
| 34 | -if {[hascap r]} { | |
| 34 | +if {[anoncap r]} { | |
| 35 | 35 | html "<a href='$home/ticket'>Tickets</a>\n" |
| 36 | 36 | } |
| 37 | -if {[hascap j]} { | |
| 37 | +if {[anoncap j]} { | |
| 38 | 38 | html "<a href='$home/wiki'>Wiki</a>\n" |
| 39 | 39 | } |
| 40 | 40 | if {[hascap s]} { |
| 41 | 41 | html "<a href='$home/setup'>Admin</a>\n" |
| 42 | 42 | } elseif {[hascap a]} { |
| 43 | 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 {[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 |
+4
-4
| --- skins/rounded1/header.txt | ||
| +++ skins/rounded1/header.txt | ||
| @@ -26,21 +26,21 @@ | ||
| 26 | 26 | <th1> |
| 27 | 27 | html "<a href='$home$index_page'>Home</a>\n" |
| 28 | 28 | if {[anycap jor]} { |
| 29 | 29 | html "<a href='$home/timeline'>Timeline</a>\n" |
| 30 | 30 | } |
| 31 | -if {[hascap oh]} { | |
| 31 | +if {[anoncap oh]} { | |
| 32 | 32 | html "<a href='$home/tree?ci=tip'>Files</a>\n" |
| 33 | 33 | } |
| 34 | -if {[hascap o]} { | |
| 34 | +if {[anoncap o]} { | |
| 35 | 35 | html "<a href='$home/brlist'>Branches</a>\n" |
| 36 | 36 | html "<a href='$home/taglist'>Tags</a>\n" |
| 37 | 37 | } |
| 38 | -if {[hascap r]} { | |
| 38 | +if {[anoncap r]} { | |
| 39 | 39 | html "<a href='$home/ticket'>Tickets</a>\n" |
| 40 | 40 | } |
| 41 | -if {[hascap j]} { | |
| 41 | +if {[anoncap j]} { | |
| 42 | 42 | html "<a href='$home/wiki'>Wiki</a>\n" |
| 43 | 43 | } |
| 44 | 44 | if {[hascap s]} { |
| 45 | 45 | html "<a href='$home/setup'>Admin</a>\n" |
| 46 | 46 | } elseif {[hascap a]} { |
| 47 | 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 {[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 @@ | ||
| 657 | 657 | } |
| 658 | 658 | db_finalize(&q2); |
| 659 | 659 | |
| 660 | 660 | |
| 661 | 661 | /* The Download: line */ |
| 662 | - if( g.perm.Zip || g.anon.Zip ){ | |
| 662 | + if( g.anon.Zip ){ | |
| 663 | 663 | char *zUrl = mprintf("%R/tarball/%t-%S.tar.gz?uuid=%s", |
| 664 | 664 | zPJ, zUuid, zUuid); |
| 665 | 665 | @ </td></tr> |
| 666 | 666 | @ <tr><th>Downloads:</th><td> |
| 667 | 667 | @ %z(href("%s",zUrl))Tarball</a> |
| @@ -674,11 +674,11 @@ | ||
| 674 | 674 | @ <td> |
| 675 | 675 | @ %z(href("%R/tree?ci=%!S",zUuid))files</a> |
| 676 | 676 | @ | %z(href("%R/fileage?name=%!S",zUuid))file ages</a> |
| 677 | 677 | @ | %z(href("%R/tree?nofiles&type=tree&ci=%!S",zUuid))folders</a> |
| 678 | 678 | @ | %z(href("%R/artifact/%!S",zUuid))manifest</a> |
| 679 | - if( g.perm.Write || g.anon.Write ){ | |
| 679 | + if( g.anon.Write ){ | |
| 680 | 680 | @ | %z(href("%R/ci_edit?r=%!S",zUuid))edit</a> |
| 681 | 681 | } |
| 682 | 682 | @ </td> |
| 683 | 683 | @ </tr> |
| 684 | 684 | blob_reset(&projName); |
| @@ -1363,17 +1363,17 @@ | ||
| 1363 | 1363 | }else{ |
| 1364 | 1364 | @ Attachment "%h(zFilename)" to |
| 1365 | 1365 | } |
| 1366 | 1366 | objType |= OBJTYPE_ATTACHMENT; |
| 1367 | 1367 | 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 ){ | |
| 1369 | 1369 | @ ticket [%z(href("%R/tktview?name=%!S",zTarget))%S(zTarget)</a>] |
| 1370 | 1370 | }else{ |
| 1371 | 1371 | @ ticket [%S(zTarget)] |
| 1372 | 1372 | } |
| 1373 | 1373 | }else{ |
| 1374 | - if( g.perm.Hyperlink && (g.perm.RdWiki || g.anon.RdWiki) ){ | |
| 1374 | + if( g.perm.Hyperlink && g.anon.RdWiki ){ | |
| 1375 | 1375 | @ wiki page [%z(href("%R/wiki?name=%t",zTarget))%h(zTarget)</a>] |
| 1376 | 1376 | }else{ |
| 1377 | 1377 | @ wiki page [%h(zTarget)] |
| 1378 | 1378 | } |
| 1379 | 1379 | } |
| 1380 | 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.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 @@ | ||
| 447 | 447 | } |
| 448 | 448 | sqlite3_result_int(context, rc); |
| 449 | 449 | } |
| 450 | 450 | |
| 451 | 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 | +** | |
| 452 | 457 | ** WEBPAGE: login |
| 453 | 458 | ** WEBPAGE: logout |
| 454 | 459 | ** WEBPAGE: my |
| 455 | 460 | ** |
| 456 | -** Generate the login page. | |
| 461 | +** The login/logout page. Parameters: | |
| 457 | 462 | ** |
| 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" | |
| 462 | 466 | */ |
| 463 | 467 | void login_page(void){ |
| 464 | 468 | const char *zUsername, *zPasswd; |
| 465 | 469 | const char *zNew1, *zNew2; |
| 466 | 470 | const char *zAnonPw = 0; |
| 467 | 471 | const char *zGoto = P("g"); |
| 468 | - int anonFlag = PB("anon"); | |
| 472 | + int anonFlag; /* Login as "anonymous" would be useful */ | |
| 469 | 473 | char *zErrMsg = ""; |
| 470 | 474 | int uid; /* User id logged in user */ |
| 471 | 475 | char *zSha1Pw; |
| 472 | 476 | const char *zIpAddr; /* IP address of requestor */ |
| 473 | 477 | const char *zReferer; |
| @@ -485,15 +489,20 @@ | ||
| 485 | 489 | } |
| 486 | 490 | sqlite3_create_function(g.db, "constant_time_cmp", 2, SQLITE_UTF8, 0, |
| 487 | 491 | constant_time_cmp_function, 0, 0); |
| 488 | 492 | zUsername = P("u"); |
| 489 | 493 | zPasswd = P("p"); |
| 494 | + anonFlag = g.zLogin==0 && PB("anon"); | |
| 495 | + | |
| 496 | + /* Handle log-out requests */ | |
| 490 | 497 | if( P("out") ){ |
| 491 | 498 | login_clear_login_data(); |
| 492 | 499 | redirect_to_g(); |
| 493 | 500 | return; |
| 494 | 501 | } |
| 502 | + | |
| 503 | + /* Deal with password-change requests */ | |
| 495 | 504 | if( g.perm.Password && zPasswd |
| 496 | 505 | && (zNew1 = P("n1"))!=0 && (zNew2 = P("n2"))!=0 |
| 497 | 506 | ){ |
| 498 | 507 | /* The user requests a password change */ |
| 499 | 508 | zSha1Pw = sha1_shared_secret(zPasswd, g.zLogin, 0); |
| @@ -594,10 +603,19 @@ | ||
| 594 | 603 | if( zGoto ){ |
| 595 | 604 | @ <input type="hidden" name="g" value="%h(zGoto)" /> |
| 596 | 605 | }else if( zReferer && strncmp(g.zBaseURL, zReferer, strlen(g.zBaseURL))==0 ){ |
| 597 | 606 | @ <input type="hidden" name="g" value="%h(zReferer)" /> |
| 598 | 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 | + } | |
| 599 | 617 | @ <table class="login_out"> |
| 600 | 618 | @ <tr> |
| 601 | 619 | @ <td class="login_out_label">User ID:</td> |
| 602 | 620 | if( anonFlag ){ |
| 603 | 621 | @ <td><input type="text" id="u" name="u" value="anonymous" size="30" /></td> |
| @@ -607,11 +625,11 @@ | ||
| 607 | 625 | @ </tr> |
| 608 | 626 | @ <tr> |
| 609 | 627 | @ <td class="login_out_label">Password:</td> |
| 610 | 628 | @ <td><input type="password" id="p" name="p" value="" size="30" /></td> |
| 611 | 629 | @ </tr> |
| 612 | - if( g.zLogin==0 ){ | |
| 630 | + if( g.zLogin==0 && (anonFlag || zGoto==0) ){ | |
| 613 | 631 | zAnonPw = db_text(0, "SELECT pw FROM user" |
| 614 | 632 | " WHERE login='anonymous'" |
| 615 | 633 | " AND cap!=''"); |
| 616 | 634 | } |
| 617 | 635 | @ <tr> |
| @@ -632,15 +650,11 @@ | ||
| 632 | 650 | @ form.action = "%h(zSSL)/login"; |
| 633 | 651 | @ } |
| 634 | 652 | } |
| 635 | 653 | @ } |
| 636 | 654 | @ </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> | |
| 642 | 656 | if( db_get_boolean("self-register", 0) ){ |
| 643 | 657 | @ <p>If you do not have an account, you can |
| 644 | 658 | @ <a href="%R/register?g=%T(P("G"))">create one</a>. |
| 645 | 659 | } |
| 646 | 660 | if( zAnonPw ){ |
| @@ -660,22 +674,14 @@ | ||
| 660 | 674 | @ onclick="gebi('u').value='anonymous'; gebi('p').value='%s(zDecoded)';" /> |
| 661 | 675 | } |
| 662 | 676 | @ </div> |
| 663 | 677 | free(zCaptcha); |
| 664 | 678 | } |
| 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 | 679 | @ </form> |
| 672 | 680 | if( g.perm.Password ){ |
| 673 | 681 | @ <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> | |
| 677 | 683 | form_begin(0, "%R/login"); |
| 678 | 684 | @ <table> |
| 679 | 685 | @ <tr><td class="login_out_label">Old Password:</td> |
| 680 | 686 | @ <td><input type="password" name="p" size="30" /></td></tr> |
| 681 | 687 | @ <tr><td class="login_out_label">New Password:</td> |
| @@ -1006,12 +1012,16 @@ | ||
| 1006 | 1012 | ** Memory of settings |
| 1007 | 1013 | */ |
| 1008 | 1014 | static int login_anon_once = 1; |
| 1009 | 1015 | |
| 1010 | 1016 | /* |
| 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"). | |
| 1013 | 1023 | */ |
| 1014 | 1024 | void login_set_anon_nobody_capabilities(void){ |
| 1015 | 1025 | if( login_anon_once ){ |
| 1016 | 1026 | const char *zCap; |
| 1017 | 1027 | /* All users get privileges from "nobody" */ |
| @@ -1019,12 +1029,14 @@ | ||
| 1019 | 1029 | login_set_capabilities(zCap, 0); |
| 1020 | 1030 | zCap = db_text("", "SELECT cap FROM user WHERE login = 'anonymous'"); |
| 1021 | 1031 | if( g.zLogin && fossil_strcmp(g.zLogin, "nobody")!=0 ){ |
| 1022 | 1032 | /* All logged-in users inherit privileges from "anonymous" */ |
| 1023 | 1033 | login_set_capabilities(zCap, 0); |
| 1034 | + g.anon = g.perm; | |
| 1024 | 1035 | }else{ |
| 1025 | 1036 | /* Record the privileges of anonymous in g.anon */ |
| 1037 | + g.anon = g.perm; | |
| 1026 | 1038 | login_set_capabilities(zCap, LOGIN_ANON); |
| 1027 | 1039 | } |
| 1028 | 1040 | login_anon_once = 0; |
| 1029 | 1041 | } |
| 1030 | 1042 | } |
| @@ -1225,11 +1237,11 @@ | ||
| 1225 | 1237 | blob_appendf(&redir, "%s/login?g=%T", g.zHttpsURL, zUrl); |
| 1226 | 1238 | }else{ |
| 1227 | 1239 | blob_appendf(&redir, "%R/login?g=%T", zUrl); |
| 1228 | 1240 | } |
| 1229 | 1241 | if( anonOk ) blob_append(&redir, "&anon", 5); |
| 1230 | - if( zQS ){ | |
| 1242 | + if( zQS && zQS[0] ){ | |
| 1231 | 1243 | blob_appendf(&redir, "&%s", zQS); |
| 1232 | 1244 | } |
| 1233 | 1245 | cgi_redirect(blob_str(&redir)); |
| 1234 | 1246 | /* NOTREACHED */ |
| 1235 | 1247 | assert(0); |
| 1236 | 1248 |
| --- 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 @@ | ||
| 196 | 196 | char *zNonce; /* The nonce used for login */ |
| 197 | 197 | |
| 198 | 198 | /* permissions available to current user */ |
| 199 | 199 | struct FossilUserPerms perm; |
| 200 | 200 | |
| 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". */ | |
| 202 | 204 | struct FossilUserPerms anon; |
| 203 | 205 | |
| 204 | 206 | #ifdef FOSSIL_ENABLE_TCL |
| 205 | 207 | /* all Tcl related context necessary for integration */ |
| 206 | 208 | struct TclContext tcl; |
| 207 | 209 |
| --- 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 @@ | ||
| 450 | 450 | char *zFullName; |
| 451 | 451 | const char *zUuid = PD("name",""); |
| 452 | 452 | |
| 453 | 453 | login_check_credentials(); |
| 454 | 454 | 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 ){ | |
| 456 | 456 | style_submenu_element("Edit", "Edit The Ticket", "%s/tktedit?name=%T", |
| 457 | 457 | g.zTop, PD("name","")); |
| 458 | 458 | } |
| 459 | 459 | if( g.perm.Hyperlink ){ |
| 460 | 460 | style_submenu_element("History", "History Of This Ticket", |
| @@ -462,15 +462,15 @@ | ||
| 462 | 462 | style_submenu_element("Timeline", "Timeline Of This Ticket", |
| 463 | 463 | "%s/tkttimeline/%T", g.zTop, zUuid); |
| 464 | 464 | style_submenu_element("Check-ins", "Check-ins Of This Ticket", |
| 465 | 465 | "%s/tkttimeline/%T?y=ci", g.zTop, zUuid); |
| 466 | 466 | } |
| 467 | - if( g.perm.NewTkt ){ | |
| 467 | + if( g.anon.NewTkt ){ | |
| 468 | 468 | style_submenu_element("New Ticket", "Create a new ticket", |
| 469 | 469 | "%s/tktnew", g.zTop); |
| 470 | 470 | } |
| 471 | - if( g.perm.ApndTkt && g.perm.Attach ){ | |
| 471 | + if( g.anon.ApndTkt && g.anon.Attach ){ | |
| 472 | 472 | style_submenu_element("Attach", "Add An Attachment", |
| 473 | 473 | "%s/attachadd?tkt=%T&from=%s/tktview/%t", |
| 474 | 474 | g.zTop, zUuid, g.zTop, zUuid); |
| 475 | 475 | } |
| 476 | 476 | if( P("plaintext") ){ |
| @@ -1412,11 +1412,11 @@ | ||
| 1412 | 1412 | style_submenu_element("Search","Search","%R/tktsrch"); |
| 1413 | 1413 | } |
| 1414 | 1414 | if( (ok & T_REPLIST)!=0 ){ |
| 1415 | 1415 | style_submenu_element("Reports","Reports","%R/reportlist"); |
| 1416 | 1416 | } |
| 1417 | - if( (ok & T_NEW)!=0 && g.perm.NewTkt ){ | |
| 1417 | + if( (ok & T_NEW)!=0 && g.anon.NewTkt ){ | |
| 1418 | 1418 | style_submenu_element("New","New","%R/tktnew"); |
| 1419 | 1419 | } |
| 1420 | 1420 | } |
| 1421 | 1421 | |
| 1422 | 1422 | /* |
| 1423 | 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.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 @@ | ||
| 715 | 715 | /* |
| 716 | 716 | ** The default report list page |
| 717 | 717 | */ |
| 718 | 718 | static const char zDefaultReportList[] = |
| 719 | 719 | @ <th1> |
| 720 | -@ if {[hascap n]} { | |
| 720 | +@ if {[anoncap n]} { | |
| 721 | 721 | @ html "<p>Enter a new ticket:</p>" |
| 722 | 722 | @ html "<ul><li><a href='tktnew'>New ticket</a></li></ul>" |
| 723 | 723 | @ } |
| 724 | 724 | @ </th1> |
| 725 | 725 | @ |
| @@ -727,16 +727,16 @@ | ||
| 727 | 727 | @ <ol> |
| 728 | 728 | @ <th1>html $report_items</th1> |
| 729 | 729 | @ </ol> |
| 730 | 730 | @ |
| 731 | 731 | @ <th1> |
| 732 | -@ if {[hascap t q]} { | |
| 732 | +@ if {[anoncap t q]} { | |
| 733 | 733 | @ html "<p>Other options:</p>\n<ul>\n" |
| 734 | -@ if {[hascap t]} { | |
| 734 | +@ if {[anoncap t]} { | |
| 735 | 735 | @ html "<li><a href='rptnew'>New report format</a></li>\n" |
| 736 | 736 | @ } |
| 737 | -@ if {[hascap q]} { | |
| 737 | +@ if {[anoncap q]} { | |
| 738 | 738 | @ html "<li><a href='modreq'>Tend to pending moderation requests</a></li>\n" |
| 739 | 739 | @ } |
| 740 | 740 | @ } |
| 741 | 741 | @ </th1> |
| 742 | 742 | ; |
| 743 | 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 {[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 @@ | ||
| 222 | 222 | style_submenu_element("List","List","%R/wcontent"); |
| 223 | 223 | } |
| 224 | 224 | if( (ok & W_HELP)!=0 ){ |
| 225 | 225 | style_submenu_element("Help","Help","%R/wikihelp"); |
| 226 | 226 | } |
| 227 | - if( (ok & W_NEW)!=0 && g.perm.NewWiki ){ | |
| 227 | + if( (ok & W_NEW)!=0 && g.anon.NewWiki ){ | |
| 228 | 228 | style_submenu_element("New","New","%R/wikinew"); |
| 229 | 229 | } |
| 230 | 230 | #if 0 |
| 231 | 231 | if( (ok & W_BLOG)!=0 |
| 232 | 232 | #endif |
| @@ -261,19 +261,19 @@ | ||
| 261 | 261 | @ <li> %z(href("%R/timeline?y=w"))Recent changes</a> to wiki pages.</li> |
| 262 | 262 | @ <li> Formatting rules for %z(href("%R/wiki_rules"))Fossil Wiki</a> and for |
| 263 | 263 | @ %z(href("%R/md_rules"))Markdown Wiki</a>.</li> |
| 264 | 264 | @ <li> Use the %z(href("%R/wiki?name=Sandbox"))Sandbox</a> |
| 265 | 265 | @ to experiment.</li> |
| 266 | - if( g.perm.NewWiki ){ | |
| 266 | + if( g.anon.NewWiki ){ | |
| 267 | 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> | |
| 268 | + if( g.anon.Write ){ | |
| 269 | + @ <li> Create a %z(href("%R/eventedit"))new tech-note</a>.</li> | |
| 270 | 270 | } |
| 271 | 271 | } |
| 272 | 272 | @ <li> %z(href("%R/wcontent"))List of All Wiki Pages</a> |
| 273 | 273 | @ available on this server.</li> |
| 274 | - if( g.perm.ModWiki ){ | |
| 274 | + if( g.anon.ModWiki ){ | |
| 275 | 275 | @ <li> %z(href("%R/modreq"))Tend to pending moderation requests</a></li> |
| 276 | 276 | } |
| 277 | 277 | if( search_restrict(SRCH_WIKI)!=0 ){ |
| 278 | 278 | @ <li> %z(href("%R/wikisrch"))Search</a> for wiki pages containing key |
| 279 | 279 | @ words</li> |
| @@ -355,11 +355,11 @@ | ||
| 355 | 355 | "%R/wdiff?name=%T&a=%d", zPageName, rid); |
| 356 | 356 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 357 | 357 | style_submenu_element("Details", "Details", |
| 358 | 358 | "%R/info/%s", zUuid); |
| 359 | 359 | } |
| 360 | - if( (rid && g.perm.WrWiki) || (!rid && g.perm.NewWiki) ){ | |
| 360 | + if( (rid && g.anon.WrWiki) || (!rid && g.anon.NewWiki) ){ | |
| 361 | 361 | if( db_get_boolean("wysiwyg-wiki", 0) ){ |
| 362 | 362 | style_submenu_element("Edit", "Edit Wiki Page", |
| 363 | 363 | "%s/wikiedit?name=%T&wysiwyg=1", |
| 364 | 364 | g.zTop, zPageName); |
| 365 | 365 | }else{ |
| @@ -366,16 +366,16 @@ | ||
| 366 | 366 | style_submenu_element("Edit", "Edit Wiki Page", |
| 367 | 367 | "%s/wikiedit?name=%T", |
| 368 | 368 | g.zTop, zPageName); |
| 369 | 369 | } |
| 370 | 370 | } |
| 371 | - if( rid && g.perm.ApndWiki && g.perm.Attach ){ | |
| 371 | + if( rid && g.anon.ApndWiki && g.anon.Attach ){ | |
| 372 | 372 | style_submenu_element("Attach", "Add An Attachment", |
| 373 | 373 | "%s/attachadd?page=%T&from=%s/wiki%%3fname=%T", |
| 374 | 374 | g.zTop, zPageName, g.zTop, zPageName); |
| 375 | 375 | } |
| 376 | - if( rid && g.perm.ApndWiki ){ | |
| 376 | + if( rid && g.anon.ApndWiki ){ | |
| 377 | 377 | style_submenu_element("Append", "Add A Comment", |
| 378 | 378 | "%s/wikiappend?name=%T&mimetype=%s", |
| 379 | 379 | g.zTop, zPageName, zMimetype); |
| 380 | 380 | } |
| 381 | 381 | if( g.perm.Hyperlink ){ |
| 382 | 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.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 |