Fossil SCM

Add the /setup_ucap_list built-in documentation page. Improvements to the /setup_ulist_notes built-in documentation page.

drh 2016-08-16 17:25 trunk
Commit 70d898fe3cc24eb65497abefde4168e3531ce5d0
1 file changed +40 -13
+40 -13
--- src/setup.c
+++ src/setup.c
@@ -160,11 +160,14 @@
160160
style_submenu_element("Add", "Add User", "setup_uedit");
161161
style_submenu_element("Log", "Access Log", "access_log");
162162
style_submenu_element("Help", "Help", "setup_ulist_notes");
163163
style_header("User List");
164164
@ <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>
166169
@ <tbody>
167170
db_prepare(&s,
168171
"SELECT uid, login, cap, date(mtime,'unixepoch')"
169172
" FROM user"
170173
" WHERE login IN ('anonymous','nobody','developer','reader')"
@@ -236,21 +239,13 @@
236239
output_table_sorting_javascript("userlist","nktxTT",2);
237240
style_footer();
238241
}
239242
240243
/*
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
246245
*/
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){
252247
@ <table>
253248
@ <tr><th valign="top">a</th>
254249
@ <td><i>Admin:</i> Create and delete users</td></tr>
255250
@ <tr><th valign="top">b</th>
256251
@ <td><i>Attach:</i> Add attachments to wiki or tickets</td></tr>
@@ -302,12 +297,23 @@
302297
@ <tr><th valign="top">x</th>
303298
@ <td><i>Private:</i> Push and/or pull private branches</td></tr>
304299
@ <tr><th valign="top">z</th>
305300
@ <td><i>Zip download:</i> Download a ZIP archive or tarball</td></tr>
306301
@ </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>
309315
@ <li><p>
310316
@ Every user, logged in or not, inherits the privileges of
311317
@ <span class="usertype">nobody</span>.
312318
@ </p></li>
313319
@
@@ -318,21 +324,42 @@
318324
@ Every logged-in user inherits the combined privileges of
319325
@ <span class="usertype">anonymous</span> and
320326
@ <span class="usertype">nobody</span>.
321327
@ </p></li>
322328
@
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
+ @
323336
@ <li><p>
324337
@ Users with privilege <span class="capability">v</span> inherit the combined
325338
@ privileges of <span class="usertype">developer</span>,
326339
@ <span class="usertype">anonymous</span>, and
327340
@ <span class="usertype">nobody</span>.
328341
@ </p></li>
329342
@
343
+ @ <li><p>The permission flags are as follows:</p>
344
+ setup_usercap_table();
345
+ @ </li>
330346
@ </ol>
331347
style_footer();
332348
}
333349
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
+}
334361
335362
/*
336363
** Return true if zPw is a valid password string. A valid
337364
** password string is:
338365
**
339366
--- 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

Keyboard Shortcuts

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