| | @@ -58,12 +58,11 @@ |
| 58 | 58 | /* Step 1: Determine if the repository is public or private. "Public" |
| 59 | 59 | ** means that any anonymous user on the internet can access all content. |
| 60 | 60 | ** "Private" repos require (non-anonymous) login to access all content, |
| 61 | 61 | ** though some content may be accessible anonymously. |
| 62 | 62 | */ |
| 63 | | - zAnonCap = db_text("", "SELECT capunion(cap) FROM user" |
| 64 | | - " WHERE login IN ('anonymous','nobody')"); |
| 63 | + zAnonCap = db_text("", "SELECT fullcap(NULL)"); |
| 65 | 64 | zPubPages = db_get("public-pages",0); |
| 66 | 65 | if( hasAnyCap(zAnonCap,"as") ){ |
| 67 | 66 | @ <li><p>This repository is <big><b>Wildly INSECURE</b></big> because |
| 68 | 67 | @ it grants administrator privileges to anonymous users. You |
| 69 | 68 | @ should <a href="takeitprivate">take this repository private</a> |
| | @@ -131,11 +130,11 @@ |
| 131 | 130 | if( hasAnyCap(zAnonCap, "e") ){ |
| 132 | 131 | @ <li><p><b>WARNING:</b> |
| 133 | 132 | @ Anonymous users can view email addresses and other personally |
| 134 | 133 | @ identifiable information on tickets. |
| 135 | 134 | @ <p>Fix this by removing the "Email" privilege |
| 136 | | - @ (<a href="setup_ucap_list">capability "e") from users |
| 135 | + @ (<a href="setup_ucap_list">capability "e"</a>) from users |
| 137 | 136 | @ "anonymous" and "nobody" on the |
| 138 | 137 | @ <a href="setup_ulist">User Configuration</a> page. |
| 139 | 138 | } |
| 140 | 139 | |
| 141 | 140 | /* Anonymous users probably should not be allowed to push content |
| | @@ -223,36 +222,42 @@ |
| 223 | 222 | |
| 224 | 223 | /* Administrative privilege should only be provided to |
| 225 | 224 | ** specific individuals, not to entire classes of people. |
| 226 | 225 | ** And not too many people should have administrator privilege. |
| 227 | 226 | */ |
| 228 | | - z = db_text(0, "SELECT group_concat(login,' AND ') FROM user" |
| 229 | | - " WHERE cap GLOB '*[as]*'" |
| 230 | | - " AND login in ('anonymous','nobody','reader','developer')"); |
| 227 | + z = db_text(0, |
| 228 | + "SELECT group_concat(" |
| 229 | + "printf('<a href=''setup_uedit?id=%%d''>%%s</a>',uid,login)," |
| 230 | + "' and ')" |
| 231 | + " FROM user" |
| 232 | + " WHERE cap GLOB '*[as]*'" |
| 233 | + " AND login in ('anonymous','nobody','reader','developer')" |
| 234 | + ); |
| 231 | 235 | if( z && z[0] ){ |
| 232 | | - @ <li><p> |
| 233 | | - @ Administrative privilege is granted to an entire class of users |
| 234 | | - @ (%h(z)). Ideally, the Write-Unver privilege should only be |
| 236 | + @ <li><p><b>WARNING:</b> |
| 237 | + @ Administrative privilege ('a' or 's') |
| 238 | + @ is granted to an entire class of users: %s(z). |
| 239 | + @ Administrative privilege should only be |
| 235 | 240 | @ granted to specific individuals. |
| 236 | 241 | } |
| 237 | | - n = db_int(0,"SELECT count(*) FROM user WHERE cap GLOB '*[as]*'"); |
| 242 | + n = db_int(0,"SELECT count(*) FROM user WHERE fullcap(cap) GLOB '*[as]*'"); |
| 238 | 243 | if( n==0 ){ |
| 239 | 244 | @ <li><p> |
| 240 | 245 | @ No users have administrator privilege. |
| 241 | 246 | }else{ |
| 242 | 247 | z = db_text(0, |
| 243 | 248 | "SELECT group_concat(" |
| 244 | 249 | "printf('<a href=''setup_uedit?id=%%d''>%%s</a>',uid,login)," |
| 245 | 250 | "', ')" |
| 246 | 251 | " FROM user" |
| 247 | | - " WHERE cap GLOB '*[as]*'" |
| 252 | + " WHERE fullcap(cap) GLOB '*[as]*'" |
| 248 | 253 | ); |
| 249 | 254 | @ <li><p> |
| 250 | 255 | @ Users with administrator privilege are: %s(z) |
| 251 | 256 | fossil_free(z); |
| 252 | 257 | if( n>3 ){ |
| 253 | | - @ <p><b>Caution</b>: |
| 258 | + @ <li><p><b>WARNING:</b> |
| 254 | 259 | @ Administrator privilege is granted to |
| 255 | 260 | @ <a href='setup_ulist?with=as'>%d(n) users</a>. |
| 256 | 261 | @ Ideally, administator privilege ('s' or 'a') should only |
| 257 | 262 | @ be granted to one or two users. |
| 258 | 263 | } |
| | @@ -269,22 +274,21 @@ |
| 269 | 274 | " FROM user" |
| 270 | 275 | " WHERE cap GLOB '*y*'" |
| 271 | 276 | " AND login in ('anonymous','nobody','reader','developer')" |
| 272 | 277 | ); |
| 273 | 278 | if( z && z[0] ){ |
| 274 | | - @ <li><p> |
| 275 | | - @ The "Write-Unver" privilege is granted to an entire class of users |
| 276 | | - @ (%s(z)). Ideally, the Write-Unver privilege should only be |
| 277 | | - @ granted to specific individuals. |
| 279 | + @ <li><p><b>WARNING:</b> |
| 280 | + @ The "Write-Unver" privilege is granted to an entire class of users: %s(z). |
| 281 | + @ The Write-Unver privilege should only be granted to specific individuals. |
| 278 | 282 | fossil_free(z); |
| 279 | 283 | } |
| 280 | 284 | n = db_int(0,"SELECT count(*) FROM user WHERE cap GLOB '*y*'"); |
| 281 | 285 | if( n>0 ){ |
| 282 | 286 | z = db_text(0, |
| 283 | 287 | "SELECT group_concat(" |
| 284 | 288 | "printf('<a href=''setup_uedit?id=%%d''>%%s</a>',uid,login),', ')" |
| 285 | | - " FROM user WHERE cap GLOB '*y*'" |
| 289 | + " FROM user WHERE fullcap(cap) GLOB '*y*'" |
| 286 | 290 | ); |
| 287 | 291 | @ <li><p> |
| 288 | 292 | @ Users with "Write-Unver" privilege: %s(z) |
| 289 | 293 | fossil_free(z); |
| 290 | 294 | if( n>3 ){ |
| 291 | 295 | |