Fossil SCM
Add the /setup_ucap_list built-in documentation page. Improvements to the /setup_ulist_notes built-in documentation page.
Commit
70d898fe3cc24eb65497abefde4168e3531ce5d0
Parent
dddc58da657a1a7…
1 file changed
+40
-13
+40
-13
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -160,11 +160,14 @@ | ||
| 160 | 160 | style_submenu_element("Add", "Add User", "setup_uedit"); |
| 161 | 161 | style_submenu_element("Log", "Access Log", "access_log"); |
| 162 | 162 | style_submenu_element("Help", "Help", "setup_ulist_notes"); |
| 163 | 163 | style_header("User List"); |
| 164 | 164 | @ <table border=1 cellpadding=2 cellspacing=0 class='userTable'> |
| 165 | - @ <thead><tr><th>UID <th>Category <th>Capabilities <th>Info <th>Last Change</tr></thead> | |
| 165 | + @ <thead><tr> | |
| 166 | + @ <th>UID <th>Category | |
| 167 | + @ <th>Capabilities (<a href='%R/setup_ucap_list'>key</a>) | |
| 168 | + @ <th>Info <th>Last Change</tr></thead> | |
| 166 | 169 | @ <tbody> |
| 167 | 170 | db_prepare(&s, |
| 168 | 171 | "SELECT uid, login, cap, date(mtime,'unixepoch')" |
| 169 | 172 | " FROM user" |
| 170 | 173 | " WHERE login IN ('anonymous','nobody','developer','reader')" |
| @@ -236,21 +239,13 @@ | ||
| 236 | 239 | output_table_sorting_javascript("userlist","nktxTT",2); |
| 237 | 240 | style_footer(); |
| 238 | 241 | } |
| 239 | 242 | |
| 240 | 243 | /* |
| 241 | -** WEBPAGE: setup_ulist_notes | |
| 242 | -** | |
| 243 | -** A documentation page showing notes about user configuration. This information | |
| 244 | -** used to be a side-bar on the user list page, but has been factored out for | |
| 245 | -** improved presentation. | |
| 244 | +** Render the user-capability table | |
| 246 | 245 | */ |
| 247 | -void setup_ulist_notes(void){ | |
| 248 | - style_header("User Configuration Notes"); | |
| 249 | - @ <h1>User Configuration Notes:</h1> | |
| 250 | - @ <ol> | |
| 251 | - @ <li><p>The permission flags are as follows:</p> | |
| 246 | +static void setup_usercap_table(void){ | |
| 252 | 247 | @ <table> |
| 253 | 248 | @ <tr><th valign="top">a</th> |
| 254 | 249 | @ <td><i>Admin:</i> Create and delete users</td></tr> |
| 255 | 250 | @ <tr><th valign="top">b</th> |
| 256 | 251 | @ <td><i>Attach:</i> Add attachments to wiki or tickets</td></tr> |
| @@ -302,12 +297,23 @@ | ||
| 302 | 297 | @ <tr><th valign="top">x</th> |
| 303 | 298 | @ <td><i>Private:</i> Push and/or pull private branches</td></tr> |
| 304 | 299 | @ <tr><th valign="top">z</th> |
| 305 | 300 | @ <td><i>Zip download:</i> Download a ZIP archive or tarball</td></tr> |
| 306 | 301 | @ </table> |
| 307 | - @ </li> | |
| 308 | - @ | |
| 302 | +} | |
| 303 | + | |
| 304 | +/* | |
| 305 | +** WEBPAGE: setup_ulist_notes | |
| 306 | +** | |
| 307 | +** A documentation page showing notes about user configuration. This information | |
| 308 | +** used to be a side-bar on the user list page, but has been factored out for | |
| 309 | +** improved presentation. | |
| 310 | +*/ | |
| 311 | +void setup_ulist_notes(void){ | |
| 312 | + style_header("User Configuration Notes"); | |
| 313 | + @ <h1>User Configuration Notes:</h1> | |
| 314 | + @ <ol> | |
| 309 | 315 | @ <li><p> |
| 310 | 316 | @ Every user, logged in or not, inherits the privileges of |
| 311 | 317 | @ <span class="usertype">nobody</span>. |
| 312 | 318 | @ </p></li> |
| 313 | 319 | @ |
| @@ -318,21 +324,42 @@ | ||
| 318 | 324 | @ Every logged-in user inherits the combined privileges of |
| 319 | 325 | @ <span class="usertype">anonymous</span> and |
| 320 | 326 | @ <span class="usertype">nobody</span>. |
| 321 | 327 | @ </p></li> |
| 322 | 328 | @ |
| 329 | + @ <li><p> | |
| 330 | + @ Users with privilege <span class="capability">u</span> inherit the combined | |
| 331 | + @ privileges of <span class="usertype">reader</span>, | |
| 332 | + @ <span class="usertype">anonymous</span>, and | |
| 333 | + @ <span class="usertype">nobody</span>. | |
| 334 | + @ </p></li> | |
| 335 | + @ | |
| 323 | 336 | @ <li><p> |
| 324 | 337 | @ Users with privilege <span class="capability">v</span> inherit the combined |
| 325 | 338 | @ privileges of <span class="usertype">developer</span>, |
| 326 | 339 | @ <span class="usertype">anonymous</span>, and |
| 327 | 340 | @ <span class="usertype">nobody</span>. |
| 328 | 341 | @ </p></li> |
| 329 | 342 | @ |
| 343 | + @ <li><p>The permission flags are as follows:</p> | |
| 344 | + setup_usercap_table(); | |
| 345 | + @ </li> | |
| 330 | 346 | @ </ol> |
| 331 | 347 | style_footer(); |
| 332 | 348 | } |
| 333 | 349 | |
| 350 | +/* | |
| 351 | +** WEBPAGE: setup_ucap_list | |
| 352 | +** | |
| 353 | +** A documentation page showing the meaning of the various user capabilities | |
| 354 | +** code letters. | |
| 355 | +*/ | |
| 356 | +void setup_ucap_list(void){ | |
| 357 | + style_header("User Capability Codes"); | |
| 358 | + setup_usercap_table(); | |
| 359 | + style_footer(); | |
| 360 | +} | |
| 334 | 361 | |
| 335 | 362 | /* |
| 336 | 363 | ** Return true if zPw is a valid password string. A valid |
| 337 | 364 | ** password string is: |
| 338 | 365 | ** |
| 339 | 366 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -160,11 +160,14 @@ | |
| 160 | style_submenu_element("Add", "Add User", "setup_uedit"); |
| 161 | style_submenu_element("Log", "Access Log", "access_log"); |
| 162 | style_submenu_element("Help", "Help", "setup_ulist_notes"); |
| 163 | style_header("User List"); |
| 164 | @ <table border=1 cellpadding=2 cellspacing=0 class='userTable'> |
| 165 | @ <thead><tr><th>UID <th>Category <th>Capabilities <th>Info <th>Last Change</tr></thead> |
| 166 | @ <tbody> |
| 167 | db_prepare(&s, |
| 168 | "SELECT uid, login, cap, date(mtime,'unixepoch')" |
| 169 | " FROM user" |
| 170 | " WHERE login IN ('anonymous','nobody','developer','reader')" |
| @@ -236,21 +239,13 @@ | |
| 236 | output_table_sorting_javascript("userlist","nktxTT",2); |
| 237 | style_footer(); |
| 238 | } |
| 239 | |
| 240 | /* |
| 241 | ** WEBPAGE: setup_ulist_notes |
| 242 | ** |
| 243 | ** A documentation page showing notes about user configuration. This information |
| 244 | ** used to be a side-bar on the user list page, but has been factored out for |
| 245 | ** improved presentation. |
| 246 | */ |
| 247 | void setup_ulist_notes(void){ |
| 248 | style_header("User Configuration Notes"); |
| 249 | @ <h1>User Configuration Notes:</h1> |
| 250 | @ <ol> |
| 251 | @ <li><p>The permission flags are as follows:</p> |
| 252 | @ <table> |
| 253 | @ <tr><th valign="top">a</th> |
| 254 | @ <td><i>Admin:</i> Create and delete users</td></tr> |
| 255 | @ <tr><th valign="top">b</th> |
| 256 | @ <td><i>Attach:</i> Add attachments to wiki or tickets</td></tr> |
| @@ -302,12 +297,23 @@ | |
| 302 | @ <tr><th valign="top">x</th> |
| 303 | @ <td><i>Private:</i> Push and/or pull private branches</td></tr> |
| 304 | @ <tr><th valign="top">z</th> |
| 305 | @ <td><i>Zip download:</i> Download a ZIP archive or tarball</td></tr> |
| 306 | @ </table> |
| 307 | @ </li> |
| 308 | @ |
| 309 | @ <li><p> |
| 310 | @ Every user, logged in or not, inherits the privileges of |
| 311 | @ <span class="usertype">nobody</span>. |
| 312 | @ </p></li> |
| 313 | @ |
| @@ -318,21 +324,42 @@ | |
| 318 | @ Every logged-in user inherits the combined privileges of |
| 319 | @ <span class="usertype">anonymous</span> and |
| 320 | @ <span class="usertype">nobody</span>. |
| 321 | @ </p></li> |
| 322 | @ |
| 323 | @ <li><p> |
| 324 | @ Users with privilege <span class="capability">v</span> inherit the combined |
| 325 | @ privileges of <span class="usertype">developer</span>, |
| 326 | @ <span class="usertype">anonymous</span>, and |
| 327 | @ <span class="usertype">nobody</span>. |
| 328 | @ </p></li> |
| 329 | @ |
| 330 | @ </ol> |
| 331 | style_footer(); |
| 332 | } |
| 333 | |
| 334 | |
| 335 | /* |
| 336 | ** Return true if zPw is a valid password string. A valid |
| 337 | ** password string is: |
| 338 | ** |
| 339 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -160,11 +160,14 @@ | |
| 160 | style_submenu_element("Add", "Add User", "setup_uedit"); |
| 161 | style_submenu_element("Log", "Access Log", "access_log"); |
| 162 | style_submenu_element("Help", "Help", "setup_ulist_notes"); |
| 163 | style_header("User List"); |
| 164 | @ <table border=1 cellpadding=2 cellspacing=0 class='userTable'> |
| 165 | @ <thead><tr> |
| 166 | @ <th>UID <th>Category |
| 167 | @ <th>Capabilities (<a href='%R/setup_ucap_list'>key</a>) |
| 168 | @ <th>Info <th>Last Change</tr></thead> |
| 169 | @ <tbody> |
| 170 | db_prepare(&s, |
| 171 | "SELECT uid, login, cap, date(mtime,'unixepoch')" |
| 172 | " FROM user" |
| 173 | " WHERE login IN ('anonymous','nobody','developer','reader')" |
| @@ -236,21 +239,13 @@ | |
| 239 | output_table_sorting_javascript("userlist","nktxTT",2); |
| 240 | style_footer(); |
| 241 | } |
| 242 | |
| 243 | /* |
| 244 | ** Render the user-capability table |
| 245 | */ |
| 246 | static void setup_usercap_table(void){ |
| 247 | @ <table> |
| 248 | @ <tr><th valign="top">a</th> |
| 249 | @ <td><i>Admin:</i> Create and delete users</td></tr> |
| 250 | @ <tr><th valign="top">b</th> |
| 251 | @ <td><i>Attach:</i> Add attachments to wiki or tickets</td></tr> |
| @@ -302,12 +297,23 @@ | |
| 297 | @ <tr><th valign="top">x</th> |
| 298 | @ <td><i>Private:</i> Push and/or pull private branches</td></tr> |
| 299 | @ <tr><th valign="top">z</th> |
| 300 | @ <td><i>Zip download:</i> Download a ZIP archive or tarball</td></tr> |
| 301 | @ </table> |
| 302 | } |
| 303 | |
| 304 | /* |
| 305 | ** WEBPAGE: setup_ulist_notes |
| 306 | ** |
| 307 | ** A documentation page showing notes about user configuration. This information |
| 308 | ** used to be a side-bar on the user list page, but has been factored out for |
| 309 | ** improved presentation. |
| 310 | */ |
| 311 | void setup_ulist_notes(void){ |
| 312 | style_header("User Configuration Notes"); |
| 313 | @ <h1>User Configuration Notes:</h1> |
| 314 | @ <ol> |
| 315 | @ <li><p> |
| 316 | @ Every user, logged in or not, inherits the privileges of |
| 317 | @ <span class="usertype">nobody</span>. |
| 318 | @ </p></li> |
| 319 | @ |
| @@ -318,21 +324,42 @@ | |
| 324 | @ Every logged-in user inherits the combined privileges of |
| 325 | @ <span class="usertype">anonymous</span> and |
| 326 | @ <span class="usertype">nobody</span>. |
| 327 | @ </p></li> |
| 328 | @ |
| 329 | @ <li><p> |
| 330 | @ Users with privilege <span class="capability">u</span> inherit the combined |
| 331 | @ privileges of <span class="usertype">reader</span>, |
| 332 | @ <span class="usertype">anonymous</span>, and |
| 333 | @ <span class="usertype">nobody</span>. |
| 334 | @ </p></li> |
| 335 | @ |
| 336 | @ <li><p> |
| 337 | @ Users with privilege <span class="capability">v</span> inherit the combined |
| 338 | @ privileges of <span class="usertype">developer</span>, |
| 339 | @ <span class="usertype">anonymous</span>, and |
| 340 | @ <span class="usertype">nobody</span>. |
| 341 | @ </p></li> |
| 342 | @ |
| 343 | @ <li><p>The permission flags are as follows:</p> |
| 344 | setup_usercap_table(); |
| 345 | @ </li> |
| 346 | @ </ol> |
| 347 | style_footer(); |
| 348 | } |
| 349 | |
| 350 | /* |
| 351 | ** WEBPAGE: setup_ucap_list |
| 352 | ** |
| 353 | ** A documentation page showing the meaning of the various user capabilities |
| 354 | ** code letters. |
| 355 | */ |
| 356 | void setup_ucap_list(void){ |
| 357 | style_header("User Capability Codes"); |
| 358 | setup_usercap_table(); |
| 359 | style_footer(); |
| 360 | } |
| 361 | |
| 362 | /* |
| 363 | ** Return true if zPw is a valid password string. A valid |
| 364 | ** password string is: |
| 365 | ** |
| 366 |