Fossil SCM
Added 'L' pseudo-capability character to indicate is-logged-in, for use with th1 capexpr. Removed hard-coded addition of login/logout menu entries in skin headers, delegating them to the mainmenu setting, and added Login/Logout entries to the default mainmenu value.
Commit
e5240c9749e2b277049244150e5325d01811b6cb9ee8ccb69eb1bdcad167e7b2
Parent
480aa68d658d894…
11 files changed
-5
-5
-5
-5
-5
-5
+7
-6
+7
+2
+12
+14
| --- skins/black_and_white/header.txt | ||
| +++ skins/black_and_white/header.txt | ||
| @@ -17,11 +17,6 @@ | ||
| 17 | 17 | foreach {name url expr class} $mainmenu { |
| 18 | 18 | if {![capexpr $expr]} continue |
| 19 | 19 | if {[string match /* $url]} {set url $home$url} |
| 20 | 20 | html "<a href='$url'>$name</a><br/>\n" |
| 21 | 21 | } |
| 22 | -if {[info exists login]} { | |
| 23 | - html "<a href='$home/login'>Logout</a>\n" | |
| 24 | -} else { | |
| 25 | - html "<a href='$home/login'>Login</a>\n" | |
| 26 | -} | |
| 27 | 22 | </th1></div> |
| 28 | 23 |
| --- skins/black_and_white/header.txt | |
| +++ skins/black_and_white/header.txt | |
| @@ -17,11 +17,6 @@ | |
| 17 | foreach {name url expr class} $mainmenu { |
| 18 | if {![capexpr $expr]} continue |
| 19 | if {[string match /* $url]} {set url $home$url} |
| 20 | html "<a href='$url'>$name</a><br/>\n" |
| 21 | } |
| 22 | if {[info exists login]} { |
| 23 | html "<a href='$home/login'>Logout</a>\n" |
| 24 | } else { |
| 25 | html "<a href='$home/login'>Login</a>\n" |
| 26 | } |
| 27 | </th1></div> |
| 28 |
| --- skins/black_and_white/header.txt | |
| +++ skins/black_and_white/header.txt | |
| @@ -17,11 +17,6 @@ | |
| 17 | foreach {name url expr class} $mainmenu { |
| 18 | if {![capexpr $expr]} continue |
| 19 | if {[string match /* $url]} {set url $home$url} |
| 20 | html "<a href='$url'>$name</a><br/>\n" |
| 21 | } |
| 22 | </th1></div> |
| 23 |
| --- skins/enhanced1/header.txt | ||
| +++ skins/enhanced1/header.txt | ||
| @@ -95,11 +95,6 @@ | ||
| 95 | 95 | foreach {name url expr class} $mainmenu { |
| 96 | 96 | if {![capexpr $expr]} continue |
| 97 | 97 | if {[string match /* $url]} {set url $home$url} |
| 98 | 98 | html "<a href='$url'>$name</a>\n" |
| 99 | 99 | } |
| 100 | -if {[info exists login]} { | |
| 101 | - html "<a href='$home/logout'>Logout</a>\n" | |
| 102 | -} else { | |
| 103 | - html "<a href='$home/login'>Login</a>\n" | |
| 104 | -} | |
| 105 | 100 | </th1></div> |
| 106 | 101 |
| --- skins/enhanced1/header.txt | |
| +++ skins/enhanced1/header.txt | |
| @@ -95,11 +95,6 @@ | |
| 95 | foreach {name url expr class} $mainmenu { |
| 96 | if {![capexpr $expr]} continue |
| 97 | if {[string match /* $url]} {set url $home$url} |
| 98 | html "<a href='$url'>$name</a>\n" |
| 99 | } |
| 100 | if {[info exists login]} { |
| 101 | html "<a href='$home/logout'>Logout</a>\n" |
| 102 | } else { |
| 103 | html "<a href='$home/login'>Login</a>\n" |
| 104 | } |
| 105 | </th1></div> |
| 106 |
| --- skins/enhanced1/header.txt | |
| +++ skins/enhanced1/header.txt | |
| @@ -95,11 +95,6 @@ | |
| 95 | foreach {name url expr class} $mainmenu { |
| 96 | if {![capexpr $expr]} continue |
| 97 | if {[string match /* $url]} {set url $home$url} |
| 98 | html "<a href='$url'>$name</a>\n" |
| 99 | } |
| 100 | </th1></div> |
| 101 |
| --- skins/khaki/header.txt | ||
| +++ skins/khaki/header.txt | ||
| @@ -16,12 +16,7 @@ | ||
| 16 | 16 | foreach {name url expr class} $mainmenu { |
| 17 | 17 | if {![capexpr $expr]} continue |
| 18 | 18 | if {[string match /* $url]} {set url $home$url} |
| 19 | 19 | html "<a href='$url'>$name</a>\n" |
| 20 | 20 | } |
| 21 | -if {[info exists login]} { | |
| 22 | - html "<a href='$home/logout'>Logout</a>\n" | |
| 23 | -} else { | |
| 24 | - html "<a href='$home/login'>Login</a>\n" | |
| 25 | -} | |
| 26 | 21 | </th1></div> |
| 27 | 22 | <div id='hbdrop'></div> |
| 28 | 23 |
| --- skins/khaki/header.txt | |
| +++ skins/khaki/header.txt | |
| @@ -16,12 +16,7 @@ | |
| 16 | foreach {name url expr class} $mainmenu { |
| 17 | if {![capexpr $expr]} continue |
| 18 | if {[string match /* $url]} {set url $home$url} |
| 19 | html "<a href='$url'>$name</a>\n" |
| 20 | } |
| 21 | if {[info exists login]} { |
| 22 | html "<a href='$home/logout'>Logout</a>\n" |
| 23 | } else { |
| 24 | html "<a href='$home/login'>Login</a>\n" |
| 25 | } |
| 26 | </th1></div> |
| 27 | <div id='hbdrop'></div> |
| 28 |
| --- skins/khaki/header.txt | |
| +++ skins/khaki/header.txt | |
| @@ -16,12 +16,7 @@ | |
| 16 | foreach {name url expr class} $mainmenu { |
| 17 | if {![capexpr $expr]} continue |
| 18 | if {[string match /* $url]} {set url $home$url} |
| 19 | html "<a href='$url'>$name</a>\n" |
| 20 | } |
| 21 | </th1></div> |
| 22 | <div id='hbdrop'></div> |
| 23 |
| --- skins/original/header.txt | ||
| +++ skins/original/header.txt | ||
| @@ -15,11 +15,6 @@ | ||
| 15 | 15 | foreach {name url expr class} $mainmenu { |
| 16 | 16 | if {![capexpr $expr]} continue |
| 17 | 17 | if {[string match /* $url]} {set url $home$url} |
| 18 | 18 | html "<a href='$url'>$name</a>\n" |
| 19 | 19 | } |
| 20 | -if {[info exists login]} { | |
| 21 | - html "<a href='$home/logout'>Logout</a>\n" | |
| 22 | -} else { | |
| 23 | - html "<a href='$home/login'>Login</a>\n" | |
| 24 | -} | |
| 25 | 20 | </th1></div> |
| 26 | 21 |
| --- skins/original/header.txt | |
| +++ skins/original/header.txt | |
| @@ -15,11 +15,6 @@ | |
| 15 | foreach {name url expr class} $mainmenu { |
| 16 | if {![capexpr $expr]} continue |
| 17 | if {[string match /* $url]} {set url $home$url} |
| 18 | html "<a href='$url'>$name</a>\n" |
| 19 | } |
| 20 | if {[info exists login]} { |
| 21 | html "<a href='$home/logout'>Logout</a>\n" |
| 22 | } else { |
| 23 | html "<a href='$home/login'>Login</a>\n" |
| 24 | } |
| 25 | </th1></div> |
| 26 |
| --- skins/original/header.txt | |
| +++ skins/original/header.txt | |
| @@ -15,11 +15,6 @@ | |
| 15 | foreach {name url expr class} $mainmenu { |
| 16 | if {![capexpr $expr]} continue |
| 17 | if {[string match /* $url]} {set url $home$url} |
| 18 | html "<a href='$url'>$name</a>\n" |
| 19 | } |
| 20 | </th1></div> |
| 21 |
| --- skins/plain_gray/header.txt | ||
| +++ skins/plain_gray/header.txt | ||
| @@ -8,12 +8,7 @@ | ||
| 8 | 8 | foreach {name url expr class} $mainmenu { |
| 9 | 9 | if {![capexpr $expr]} continue |
| 10 | 10 | if {[string match /* $url]} {set url $home$url} |
| 11 | 11 | html "<a href='$url'>$name</a>\n" |
| 12 | 12 | } |
| 13 | -if {[info exists login]} { | |
| 14 | - html "<a href='$home/logout'>Logout</a>\n" | |
| 15 | -} else { | |
| 16 | - html "<a href='$home/login'>Login</a>\n" | |
| 17 | -} | |
| 18 | 13 | </th1></div> |
| 19 | 14 | <div id='hbdrop' class='hbdrop'></div> |
| 20 | 15 |
| --- skins/plain_gray/header.txt | |
| +++ skins/plain_gray/header.txt | |
| @@ -8,12 +8,7 @@ | |
| 8 | foreach {name url expr class} $mainmenu { |
| 9 | if {![capexpr $expr]} continue |
| 10 | if {[string match /* $url]} {set url $home$url} |
| 11 | html "<a href='$url'>$name</a>\n" |
| 12 | } |
| 13 | if {[info exists login]} { |
| 14 | html "<a href='$home/logout'>Logout</a>\n" |
| 15 | } else { |
| 16 | html "<a href='$home/login'>Login</a>\n" |
| 17 | } |
| 18 | </th1></div> |
| 19 | <div id='hbdrop' class='hbdrop'></div> |
| 20 |
| --- skins/plain_gray/header.txt | |
| +++ skins/plain_gray/header.txt | |
| @@ -8,12 +8,7 @@ | |
| 8 | foreach {name url expr class} $mainmenu { |
| 9 | if {![capexpr $expr]} continue |
| 10 | if {[string match /* $url]} {set url $home$url} |
| 11 | html "<a href='$url'>$name</a>\n" |
| 12 | } |
| 13 | </th1></div> |
| 14 | <div id='hbdrop' class='hbdrop'></div> |
| 15 |
| --- skins/rounded1/header.txt | ||
| +++ skins/rounded1/header.txt | ||
| @@ -16,11 +16,6 @@ | ||
| 16 | 16 | foreach {name url expr class} $mainmenu { |
| 17 | 17 | if {![capexpr $expr]} continue |
| 18 | 18 | if {[string match /* $url]} {set url $home$url} |
| 19 | 19 | html "<a href='$url'>$name</a>\n" |
| 20 | 20 | } |
| 21 | -if {[info exists login]} { | |
| 22 | - html "<a href='$home/logout'>Logout</a>\n" | |
| 23 | -} else { | |
| 24 | - html "<a href='$home/login'>Login</a>\n" | |
| 25 | -} | |
| 26 | 21 | </th1></div> |
| 27 | 22 |
| --- skins/rounded1/header.txt | |
| +++ skins/rounded1/header.txt | |
| @@ -16,11 +16,6 @@ | |
| 16 | foreach {name url expr class} $mainmenu { |
| 17 | if {![capexpr $expr]} continue |
| 18 | if {[string match /* $url]} {set url $home$url} |
| 19 | html "<a href='$url'>$name</a>\n" |
| 20 | } |
| 21 | if {[info exists login]} { |
| 22 | html "<a href='$home/logout'>Logout</a>\n" |
| 23 | } else { |
| 24 | html "<a href='$home/login'>Login</a>\n" |
| 25 | } |
| 26 | </th1></div> |
| 27 |
| --- skins/rounded1/header.txt | |
| +++ skins/rounded1/header.txt | |
| @@ -16,11 +16,6 @@ | |
| 16 | foreach {name url expr class} $mainmenu { |
| 17 | if {![capexpr $expr]} continue |
| 18 | if {[string match /* $url]} {set url $home$url} |
| 19 | html "<a href='$url'>$name</a>\n" |
| 20 | } |
| 21 | </th1></div> |
| 22 |
+7
-6
| --- skins/xekri/header.txt | ||
| +++ skins/xekri/header.txt | ||
| @@ -92,13 +92,14 @@ | ||
| 92 | 92 | updateClock(); |
| 93 | 93 | </script> |
| 94 | 94 | <div class="mainmenu"><th1> |
| 95 | 95 | foreach {name url expr class} $mainmenu { |
| 96 | 96 | if {![capexpr $expr]} continue |
| 97 | - html "<a href='$home$url'>$name</a>\n" | |
| 98 | -} | |
| 99 | -if {[info exists login]} { | |
| 100 | - html "<a href='$home/logout'>Logout</a>\n" | |
| 101 | -} else { | |
| 102 | - html "<a href='$home/login'>Login</a>\n" | |
| 97 | + if {[string match /* $url]} { | |
| 98 | + if {[string match /$current_page* $url]} { | |
| 99 | + set class "active $class" | |
| 100 | + } | |
| 101 | + set url $home$url | |
| 102 | + } | |
| 103 | + html "<a href='$url' class='$class'>$name</a>\n" | |
| 103 | 104 | } |
| 104 | 105 | </th1></div> |
| 105 | 106 |
| --- skins/xekri/header.txt | |
| +++ skins/xekri/header.txt | |
| @@ -92,13 +92,14 @@ | |
| 92 | updateClock(); |
| 93 | </script> |
| 94 | <div class="mainmenu"><th1> |
| 95 | foreach {name url expr class} $mainmenu { |
| 96 | if {![capexpr $expr]} continue |
| 97 | html "<a href='$home$url'>$name</a>\n" |
| 98 | } |
| 99 | if {[info exists login]} { |
| 100 | html "<a href='$home/logout'>Logout</a>\n" |
| 101 | } else { |
| 102 | html "<a href='$home/login'>Login</a>\n" |
| 103 | } |
| 104 | </th1></div> |
| 105 |
| --- skins/xekri/header.txt | |
| +++ skins/xekri/header.txt | |
| @@ -92,13 +92,14 @@ | |
| 92 | updateClock(); |
| 93 | </script> |
| 94 | <div class="mainmenu"><th1> |
| 95 | foreach {name url expr class} $mainmenu { |
| 96 | if {![capexpr $expr]} continue |
| 97 | if {[string match /* $url]} { |
| 98 | if {[string match /$current_page* $url]} { |
| 99 | set class "active $class" |
| 100 | } |
| 101 | set url $home$url |
| 102 | } |
| 103 | html "<a href='$url' class='$class'>$name</a>\n" |
| 104 | } |
| 105 | </th1></div> |
| 106 |
+7
| --- src/login.c | ||
| +++ src/login.c | ||
| @@ -1330,10 +1330,13 @@ | ||
| 1330 | 1330 | |
| 1331 | 1331 | /* |
| 1332 | 1332 | ** If the current login lacks any of the capabilities listed in |
| 1333 | 1333 | ** the input, then return 0. If all capabilities are present, then |
| 1334 | 1334 | ** return 1. |
| 1335 | +** | |
| 1336 | +** As a special case, the 'L' pseudo-capability ID means "is logged | |
| 1337 | +** in" and will return true for any non-guest user. | |
| 1335 | 1338 | */ |
| 1336 | 1339 | int login_has_capability(const char *zCap, int nCap, u32 flgs){ |
| 1337 | 1340 | int i; |
| 1338 | 1341 | int rc = 1; |
| 1339 | 1342 | FossilUserPerms *p = (flgs & LOGIN_ANON) ? &g.anon : &g.perm; |
| @@ -1373,10 +1376,14 @@ | ||
| 1373 | 1376 | case '6': rc = p->AdminForum;break; |
| 1374 | 1377 | case '7': rc = p->EmailAlert;break; |
| 1375 | 1378 | case 'A': rc = p->Announce; break; |
| 1376 | 1379 | case 'C': rc = p->Chat; break; |
| 1377 | 1380 | case 'D': rc = p->Debug; break; |
| 1381 | + case 'L': rc = g.zLogin && *g.zLogin; break; | |
| 1382 | + /* Mainenance reminder: '@' should not be used because | |
| 1383 | + it would semantically collide with the @ in the | |
| 1384 | + capexpr TH1 command. */ | |
| 1378 | 1385 | default: rc = 0; break; |
| 1379 | 1386 | } |
| 1380 | 1387 | } |
| 1381 | 1388 | return rc; |
| 1382 | 1389 | } |
| 1383 | 1390 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -1330,10 +1330,13 @@ | |
| 1330 | |
| 1331 | /* |
| 1332 | ** If the current login lacks any of the capabilities listed in |
| 1333 | ** the input, then return 0. If all capabilities are present, then |
| 1334 | ** return 1. |
| 1335 | */ |
| 1336 | int login_has_capability(const char *zCap, int nCap, u32 flgs){ |
| 1337 | int i; |
| 1338 | int rc = 1; |
| 1339 | FossilUserPerms *p = (flgs & LOGIN_ANON) ? &g.anon : &g.perm; |
| @@ -1373,10 +1376,14 @@ | |
| 1373 | case '6': rc = p->AdminForum;break; |
| 1374 | case '7': rc = p->EmailAlert;break; |
| 1375 | case 'A': rc = p->Announce; break; |
| 1376 | case 'C': rc = p->Chat; break; |
| 1377 | case 'D': rc = p->Debug; break; |
| 1378 | default: rc = 0; break; |
| 1379 | } |
| 1380 | } |
| 1381 | return rc; |
| 1382 | } |
| 1383 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -1330,10 +1330,13 @@ | |
| 1330 | |
| 1331 | /* |
| 1332 | ** If the current login lacks any of the capabilities listed in |
| 1333 | ** the input, then return 0. If all capabilities are present, then |
| 1334 | ** return 1. |
| 1335 | ** |
| 1336 | ** As a special case, the 'L' pseudo-capability ID means "is logged |
| 1337 | ** in" and will return true for any non-guest user. |
| 1338 | */ |
| 1339 | int login_has_capability(const char *zCap, int nCap, u32 flgs){ |
| 1340 | int i; |
| 1341 | int rc = 1; |
| 1342 | FossilUserPerms *p = (flgs & LOGIN_ANON) ? &g.anon : &g.perm; |
| @@ -1373,10 +1376,14 @@ | |
| 1376 | case '6': rc = p->AdminForum;break; |
| 1377 | case '7': rc = p->EmailAlert;break; |
| 1378 | case 'A': rc = p->Announce; break; |
| 1379 | case 'C': rc = p->Chat; break; |
| 1380 | case 'D': rc = p->Debug; break; |
| 1381 | case 'L': rc = g.zLogin && *g.zLogin; break; |
| 1382 | /* Mainenance reminder: '@' should not be used because |
| 1383 | it would semantically collide with the @ in the |
| 1384 | capexpr TH1 command. */ |
| 1385 | default: rc = 0; break; |
| 1386 | } |
| 1387 | } |
| 1388 | return rc; |
| 1389 | } |
| 1390 |
+2
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -610,10 +610,12 @@ | ||
| 610 | 610 | @ Forum /forum {@2 3 4 5 6} wideonly |
| 611 | 611 | @ Chat /chat C wideonly |
| 612 | 612 | @ Tickets /ticket r wideonly |
| 613 | 613 | @ Wiki /wiki j wideonly |
| 614 | 614 | @ Setup /setup s {} |
| 615 | +@ Logout /logout L {} | |
| 616 | +@ Login /login !L {} | |
| 615 | 617 | ; |
| 616 | 618 | |
| 617 | 619 | /* |
| 618 | 620 | ** Return the default menu |
| 619 | 621 | */ |
| 620 | 622 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -610,10 +610,12 @@ | |
| 610 | @ Forum /forum {@2 3 4 5 6} wideonly |
| 611 | @ Chat /chat C wideonly |
| 612 | @ Tickets /ticket r wideonly |
| 613 | @ Wiki /wiki j wideonly |
| 614 | @ Setup /setup s {} |
| 615 | ; |
| 616 | |
| 617 | /* |
| 618 | ** Return the default menu |
| 619 | */ |
| 620 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -610,10 +610,12 @@ | |
| 610 | @ Forum /forum {@2 3 4 5 6} wideonly |
| 611 | @ Chat /chat C wideonly |
| 612 | @ Tickets /ticket r wideonly |
| 613 | @ Wiki /wiki j wideonly |
| 614 | @ Setup /setup s {} |
| 615 | @ Logout /logout L {} |
| 616 | @ Login /login !L {} |
| 617 | ; |
| 618 | |
| 619 | /* |
| 620 | ** Return the default menu |
| 621 | */ |
| 622 |
+12
| --- www/caps/ref.html | ||
| +++ www/caps/ref.html | ||
| @@ -422,10 +422,22 @@ | ||
| 422 | 422 | <th>Debug</th> |
| 423 | 423 | <td> |
| 424 | 424 | Enable debugging features. Mnemonic: <b>d</b>ebug. |
| 425 | 425 | </td> |
| 426 | 426 | </tr> |
| 427 | + | |
| 428 | + <tr id="L"> | |
| 429 | + <th>L</th> | |
| 430 | + <th>Is-logged-in</th> | |
| 431 | + <td> | |
| 432 | + This is not a real capability, but is used in certain capability | |
| 433 | + checks, e.g. via <a href="../th1.md#capexpr">capexpr</a>. It | |
| 434 | + resolves to true if the current user is logged in. | |
| 435 | + Mnemonic: <b>L</b>ogged in. | |
| 436 | + </td> | |
| 437 | + </tr> | |
| 438 | + | |
| 427 | 439 | </table> |
| 428 | 440 | |
| 429 | 441 | <hr/> |
| 430 | 442 | |
| 431 | 443 | <p id="backlink"><a href="./"><em>Back to Administering User |
| 432 | 444 |
| --- www/caps/ref.html | |
| +++ www/caps/ref.html | |
| @@ -422,10 +422,22 @@ | |
| 422 | <th>Debug</th> |
| 423 | <td> |
| 424 | Enable debugging features. Mnemonic: <b>d</b>ebug. |
| 425 | </td> |
| 426 | </tr> |
| 427 | </table> |
| 428 | |
| 429 | <hr/> |
| 430 | |
| 431 | <p id="backlink"><a href="./"><em>Back to Administering User |
| 432 |
| --- www/caps/ref.html | |
| +++ www/caps/ref.html | |
| @@ -422,10 +422,22 @@ | |
| 422 | <th>Debug</th> |
| 423 | <td> |
| 424 | Enable debugging features. Mnemonic: <b>d</b>ebug. |
| 425 | </td> |
| 426 | </tr> |
| 427 | |
| 428 | <tr id="L"> |
| 429 | <th>L</th> |
| 430 | <th>Is-logged-in</th> |
| 431 | <td> |
| 432 | This is not a real capability, but is used in certain capability |
| 433 | checks, e.g. via <a href="../th1.md#capexpr">capexpr</a>. It |
| 434 | resolves to true if the current user is logged in. |
| 435 | Mnemonic: <b>L</b>ogged in. |
| 436 | </td> |
| 437 | </tr> |
| 438 | |
| 439 | </table> |
| 440 | |
| 441 | <hr/> |
| 442 | |
| 443 | <p id="backlink"><a href="./"><em>Back to Administering User |
| 444 |
+14
| --- www/th1.md | ||
| +++ www/th1.md | ||
| @@ -285,11 +285,25 @@ | ||
| 285 | 285 | ``` |
| 286 | 286 | capexpr {j o r} True if any one of j, o, or r are available |
| 287 | 287 | capexpr {oh} True if both o and h are available |
| 288 | 288 | capexpr {@2 @3 4 5 6} 2 or 3 available for anonymous or one of |
| 289 | 289 | 4, 5 or 6 is available for the user |
| 290 | + capexpr L True if the user is logged in | |
| 291 | + capexpr !L True if the user is not logged in | |
| 292 | +``` | |
| 293 | + | |
| 294 | +The `L` pseudo-capability is intended only to be used on its own or with | |
| 295 | +the `!` prefix for implementing login/logout menus via the `mainmenu` | |
| 296 | +site configuration option: | |
| 297 | + | |
| 298 | +``` | |
| 299 | +Login /login !L {} | |
| 300 | +Logout /logout L {} | |
| 290 | 301 | ``` |
| 302 | + | |
| 303 | +i.e. if the user is logged in, show the "Logout" link, else show the | |
| 304 | +"Login" link. | |
| 291 | 305 | |
| 292 | 306 | <a id="captureTh1"></a>TH1 captureTh1 Command |
| 293 | 307 | ----------------------------------------------------- |
| 294 | 308 | |
| 295 | 309 | * captureTh1 STRING |
| 296 | 310 |
| --- www/th1.md | |
| +++ www/th1.md | |
| @@ -285,11 +285,25 @@ | |
| 285 | ``` |
| 286 | capexpr {j o r} True if any one of j, o, or r are available |
| 287 | capexpr {oh} True if both o and h are available |
| 288 | capexpr {@2 @3 4 5 6} 2 or 3 available for anonymous or one of |
| 289 | 4, 5 or 6 is available for the user |
| 290 | ``` |
| 291 | |
| 292 | <a id="captureTh1"></a>TH1 captureTh1 Command |
| 293 | ----------------------------------------------------- |
| 294 | |
| 295 | * captureTh1 STRING |
| 296 |
| --- www/th1.md | |
| +++ www/th1.md | |
| @@ -285,11 +285,25 @@ | |
| 285 | ``` |
| 286 | capexpr {j o r} True if any one of j, o, or r are available |
| 287 | capexpr {oh} True if both o and h are available |
| 288 | capexpr {@2 @3 4 5 6} 2 or 3 available for anonymous or one of |
| 289 | 4, 5 or 6 is available for the user |
| 290 | capexpr L True if the user is logged in |
| 291 | capexpr !L True if the user is not logged in |
| 292 | ``` |
| 293 | |
| 294 | The `L` pseudo-capability is intended only to be used on its own or with |
| 295 | the `!` prefix for implementing login/logout menus via the `mainmenu` |
| 296 | site configuration option: |
| 297 | |
| 298 | ``` |
| 299 | Login /login !L {} |
| 300 | Logout /logout L {} |
| 301 | ``` |
| 302 | |
| 303 | i.e. if the user is logged in, show the "Logout" link, else show the |
| 304 | "Login" link. |
| 305 | |
| 306 | <a id="captureTh1"></a>TH1 captureTh1 Command |
| 307 | ----------------------------------------------------- |
| 308 | |
| 309 | * captureTh1 STRING |
| 310 |