Fossil SCM
Fix over-length code lines in the setup.c source file.
Commit
7001228a093ba66e3027d7c69bd160c576b46ec2c4f61593576f5abc06ccb6d1
Parent
862d630ffb8821c…
1 file changed
+66
-45
+66
-45
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -74,11 +74,12 @@ | ||
| 74 | 74 | /* Make sure the header contains <base href="...">. Issue a warning |
| 75 | 75 | ** if it does not. */ |
| 76 | 76 | if( !cgi_header_contains("<base href=") ){ |
| 77 | 77 | @ <p class="generalError"><b>Configuration Error:</b> Please add |
| 78 | 78 | @ <tt><base href="$secureurl/$current_page"></tt> after |
| 79 | - @ <tt><head></tt> in the <a href="setup_skinedit?w=2">HTML header</a>!</p> | |
| 79 | + @ <tt><head></tt> in the | |
| 80 | + @ <a href="setup_skinedit?w=2">HTML header</a>!</p> | |
| 80 | 81 | } |
| 81 | 82 | |
| 82 | 83 | #if !defined(_WIN32) |
| 83 | 84 | /* Check for /dev/null and /dev/urandom. We want both devices to be present, |
| 84 | 85 | ** but they are sometimes omitted (by mistake) from chroot jails. */ |
| @@ -228,11 +229,12 @@ | ||
| 228 | 229 | @ data-column-types='ktxTTK' data-init-sort='2'> |
| 229 | 230 | @ <thead><tr> |
| 230 | 231 | @ <th>Login Name<th>Caps<th>Info<th>Date<th>Expire<th>Last Login</tr></thead> |
| 231 | 232 | @ <tbody> |
| 232 | 233 | db_multi_exec( |
| 233 | - "CREATE TEMP TABLE lastAccess(uname TEXT PRIMARY KEY, atime REAL) WITHOUT ROWID;" | |
| 234 | + "CREATE TEMP TABLE lastAccess(uname TEXT PRIMARY KEY, atime REAL)" | |
| 235 | + "WITHOUT ROWID;" | |
| 234 | 236 | ); |
| 235 | 237 | if( db_table_exists("repository","accesslog") ){ |
| 236 | 238 | db_multi_exec( |
| 237 | 239 | "INSERT INTO lastAccess(uname, atime)" |
| 238 | 240 | " SELECT uname, max(mtime) FROM (" |
| @@ -247,11 +249,12 @@ | ||
| 247 | 249 | zWith = mprintf(" AND cap GLOB '*[%q]*'", zWith); |
| 248 | 250 | }else{ |
| 249 | 251 | zWith = ""; |
| 250 | 252 | } |
| 251 | 253 | db_prepare(&s, |
| 252 | - "SELECT uid, login, cap, info, date(mtime,'unixepoch'), lower(login) AS sortkey, " | |
| 254 | + "SELECT uid, login, cap, info, date(mtime,'unixepoch')," | |
| 255 | + " lower(login) AS sortkey, " | |
| 253 | 256 | " CASE WHEN info LIKE '%%expires 20%%'" |
| 254 | 257 | " THEN substr(info,instr(lower(info),'expires')+8,10)" |
| 255 | 258 | " END AS exp," |
| 256 | 259 | "atime" |
| 257 | 260 | " FROM user LEFT JOIN lastAccess ON login=uname" |
| @@ -271,11 +274,12 @@ | ||
| 271 | 274 | char *zAge = 0; |
| 272 | 275 | if( rATime>0.0 ){ |
| 273 | 276 | zAge = human_readable_age(rNow - rATime); |
| 274 | 277 | } |
| 275 | 278 | @ <tr> |
| 276 | - @ <td data-sortkey='%h(zSortKey)'><a href='setup_uedit?id=%d(uid)'>%h(zLogin)</a> | |
| 279 | + @ <td data-sortkey='%h(zSortKey)'>\ | |
| 280 | + @ <a href='setup_uedit?id=%d(uid)'>%h(zLogin)</a> | |
| 277 | 281 | @ <td>%h(zCap) |
| 278 | 282 | @ <td>%h(zInfo) |
| 279 | 283 | @ <td>%h(zDate?zDate:"") |
| 280 | 284 | @ <td>%h(zExp?zExp:"") |
| 281 | 285 | @ <td data-sortkey='%f(rATime)' style='white-space:nowrap'>%s(zAge?zAge:"") |
| @@ -352,13 +356,13 @@ | ||
| 352 | 356 | } |
| 353 | 357 | |
| 354 | 358 | /* |
| 355 | 359 | ** WEBPAGE: setup_ulist_notes |
| 356 | 360 | ** |
| 357 | -** A documentation page showing notes about user configuration. This information | |
| 358 | -** used to be a side-bar on the user list page, but has been factored out for | |
| 359 | -** improved presentation. | |
| 361 | +** A documentation page showing notes about user configuration. This | |
| 362 | +** information used to be a side-bar on the user list page, but has been | |
| 363 | +** factored out for improved presentation. | |
| 360 | 364 | */ |
| 361 | 365 | void setup_ulist_notes(void){ |
| 362 | 366 | style_header("User Configuration Notes"); |
| 363 | 367 | @ <h1>User Configuration Notes:</h1> |
| 364 | 368 | @ <ol> |
| @@ -481,14 +485,15 @@ | ||
| 481 | 485 | |
| 482 | 486 | zCap[i] = 0; |
| 483 | 487 | zPw = P("pw"); |
| 484 | 488 | zLogin = P("login"); |
| 485 | 489 | if( strlen(zLogin)==0 ){ |
| 490 | + char *zRef = cgi_referer("setup_ulist"); | |
| 486 | 491 | style_header("User Creation Error"); |
| 487 | 492 | @ <span class="loginError">Empty login not allowed.</span> |
| 488 | 493 | @ |
| 489 | - @ <p><a href="setup_uedit?id=%d(uid)&referer=%T(cgi_referer("setup_ulist"))"> | |
| 494 | + @ <p><a href="setup_uedit?id=%d(uid)&referer=%T(zRef)"> | |
| 490 | 495 | @ [Bummer]</a></p> |
| 491 | 496 | style_footer(); |
| 492 | 497 | return; |
| 493 | 498 | } |
| 494 | 499 | if( isValidPwString(zPw) ){ |
| @@ -495,16 +500,17 @@ | ||
| 495 | 500 | zPw = sha1_shared_secret(zPw, zLogin, 0); |
| 496 | 501 | }else{ |
| 497 | 502 | zPw = db_text(0, "SELECT pw FROM user WHERE uid=%d", uid); |
| 498 | 503 | } |
| 499 | 504 | zOldLogin = db_text(0, "SELECT login FROM user WHERE uid=%d", uid); |
| 500 | - if( db_exists("SELECT 1 FROM user WHERE login=%Q AND uid!=%d", zLogin, uid) ){ | |
| 505 | + if( db_exists("SELECT 1 FROM user WHERE login=%Q AND uid!=%d",zLogin,uid) ){ | |
| 506 | + char *zRef = cgi_referer("setup_ulist"); | |
| 501 | 507 | style_header("User Creation Error"); |
| 502 | 508 | @ <span class="loginError">Login "%h(zLogin)" is already used by |
| 503 | 509 | @ a different user.</span> |
| 504 | 510 | @ |
| 505 | - @ <p><a href="setup_uedit?id=%d(uid)&referer=%T(cgi_referer("setup_ulist"))"> | |
| 511 | + @ <p><a href="setup_uedit?id=%d(uid)&referer=%T(zRef)"> | |
| 506 | 512 | @ [Bummer]</a></p> |
| 507 | 513 | style_footer(); |
| 508 | 514 | return; |
| 509 | 515 | } |
| 510 | 516 | login_verify_csrf_secret(); |
| @@ -543,15 +549,16 @@ | ||
| 543 | 549 | blob_reset(&sql); |
| 544 | 550 | admin_log( "Updated user [%q] in all login groups " |
| 545 | 551 | "with capabilities [%q].", |
| 546 | 552 | zLogin, zCap ); |
| 547 | 553 | if( zErr ){ |
| 554 | + char *zRef = cgi_referer("setup_ulist"); | |
| 548 | 555 | style_header("User Change Error"); |
| 549 | 556 | admin_log( "Error updating user '%q': %s'.", zLogin, zErr ); |
| 550 | 557 | @ <span class="loginError">%h(zErr)</span> |
| 551 | 558 | @ |
| 552 | - @ <p><a href="setup_uedit?id=%d(uid)&referer=%T(cgi_referer("setup_ulist"))"> | |
| 559 | + @ <p><a href="setup_uedit?id=%d(uid)&referer=%T(zRef)"> | |
| 553 | 560 | @ [Bummer]</a></p> |
| 554 | 561 | style_footer(); |
| 555 | 562 | return; |
| 556 | 563 | } |
| 557 | 564 | } |
| @@ -781,18 +788,20 @@ | ||
| 781 | 788 | @ indicates the privileges of <span class="usertype">nobody</span> that |
| 782 | 789 | @ are available to all users regardless of whether or not they are logged in. |
| 783 | 790 | @ </p></li> |
| 784 | 791 | @ |
| 785 | 792 | @ <li><p> |
| 786 | - @ The "<span class="ueditInheritAnonymous"><sub>A</sub></span>" subscript suffix | |
| 793 | + @ The "<span class="ueditInheritAnonymous"><sub>A</sub></span>" | |
| 794 | + @ subscript suffix | |
| 787 | 795 | @ indicates the privileges of <span class="usertype">anonymous</span> that |
| 788 | 796 | @ are inherited by all logged-in users. |
| 789 | 797 | @ </p></li> |
| 790 | 798 | @ |
| 791 | 799 | @ <li><p> |
| 792 | - @ The "<span class="ueditInheritDeveloper"><sub>D</sub></span>" subscript suffix | |
| 793 | - @ indicates the privileges of <span class="usertype">developer</span> that | |
| 800 | + @ The "<span class="ueditInheritDeveloper"><sub>D</sub></span>" | |
| 801 | + @ subscript suffix indicates the privileges of | |
| 802 | + @ <span class="usertype">developer</span> that | |
| 794 | 803 | @ are inherited by all users with the |
| 795 | 804 | @ <span class="capability">Developer</span> privilege. |
| 796 | 805 | @ </p></li> |
| 797 | 806 | @ |
| 798 | 807 | @ <li><p> |
| @@ -973,11 +982,12 @@ | ||
| 973 | 982 | db_set(zVar, zQ, 0); |
| 974 | 983 | admin_log("Set entry_attribute %Q to: %.*s%s", |
| 975 | 984 | zVar, 20, zQ, (nZQ>20 ? "..." : "")); |
| 976 | 985 | zVal = zQ; |
| 977 | 986 | } |
| 978 | - @ <input type="text" id="%s(zQParm)" name="%s(zQParm)" value="%h(zVal)" size="%d(width)" | |
| 987 | + @ <input type="text" id="%s(zQParm)" name="%s(zQParm)" value="%h(zVal)" \ | |
| 988 | + @ size="%d(width)" | |
| 979 | 989 | if( disabled ){ |
| 980 | 990 | @ disabled="disabled" |
| 981 | 991 | } |
| 982 | 992 | @ /> <b>%s(zLabel)</b> |
| 983 | 993 | } |
| @@ -1364,11 +1374,12 @@ | ||
| 1364 | 1374 | @ IP octets</a> in the login cookie across all repositories in the |
| 1365 | 1375 | @ same Login Group. |
| 1366 | 1376 | @ <hr /><h2>Implementation Details</h2> |
| 1367 | 1377 | @ <p>The following are fields from the CONFIG table related to login-groups, |
| 1368 | 1378 | @ provided here for instructional and debugging purposes:</p> |
| 1369 | - @ <table border='1' class='sortable' data-column-types='ttt' data-init-sort='1'> | |
| 1379 | + @ <table border='1' class='sortable' data-column-types='ttt' \ | |
| 1380 | + @ data-init-sort='1'> | |
| 1370 | 1381 | @ <thead><tr> |
| 1371 | 1382 | @ <th>Config.Name<th>Config.Value<th>Config.mtime</tr> |
| 1372 | 1383 | @ </thead><tbody> |
| 1373 | 1384 | db_prepare(&q, "SELECT name, value, datetime(mtime,'unixepoch') FROM config" |
| 1374 | 1385 | " WHERE name GLOB 'peer-*'" |
| @@ -1458,14 +1469,14 @@ | ||
| 1458 | 1469 | @ <p>(Property: "timeline-utc") |
| 1459 | 1470 | @ <hr /> |
| 1460 | 1471 | multiple_choice_attribute("Per-Item Time Format", "timeline-date-format", |
| 1461 | 1472 | "tdf", "0", count(azTimeFormats)/2, azTimeFormats); |
| 1462 | 1473 | @ <p>If the "HH:MM" or "HH:MM:SS" format is selected, then the date is shown |
| 1463 | - @ in a separate box (using CSS class "timelineDate") whenever the date changes. | |
| 1464 | - @ With the "YYYY-MM-DD HH:MM" and "YYMMDD ..." formats, the complete date | |
| 1465 | - @ and time is shown on every timeline entry using the CSS class "timelineTime". | |
| 1466 | - @ (Preperty: "timeline-date-format")</p> | |
| 1474 | + @ in a separate box (using CSS class "timelineDate") whenever the date | |
| 1475 | + @ changes. With the "YYYY-MM-DD HH:MM" and "YYMMDD ..." formats, | |
| 1476 | + @ the complete date and time is shown on every timeline entry using the | |
| 1477 | + @ CSS class "timelineTime". (Preperty: "timeline-date-format")</p> | |
| 1467 | 1478 | |
| 1468 | 1479 | @ <hr /> |
| 1469 | 1480 | onoff_attribute("Show version differences by default", |
| 1470 | 1481 | "show-version-diffs", "vdiff", 0, 0); |
| 1471 | 1482 | @ <p>The version-information pages linked from the timeline can either |
| @@ -1606,23 +1617,23 @@ | ||
| 1606 | 1617 | @ engines as well as a short RSS description. |
| 1607 | 1618 | @ (Property: "project-description")</p> |
| 1608 | 1619 | @ <hr /> |
| 1609 | 1620 | entry_attribute("Tarball and ZIP-archive Prefix", 20, "short-project-name", |
| 1610 | 1621 | "spn", "", 0); |
| 1611 | - @ <p>This is used as a prefix on the names of generated tarballs and ZIP archive. | |
| 1612 | - @ For best results, keep this prefix brief and avoid special characters such | |
| 1613 | - @ as "/" and "\". | |
| 1622 | + @ <p>This is used as a prefix on the names of generated tarballs and | |
| 1623 | + @ ZIP archive. For best results, keep this prefix brief and avoid special | |
| 1624 | + @ characters such as "/" and "\". | |
| 1614 | 1625 | @ If no tarball prefix is specified, then the full Project Name above is used. |
| 1615 | 1626 | @ (Property: "short-project-name") |
| 1616 | 1627 | @ </p> |
| 1617 | 1628 | @ <hr /> |
| 1618 | 1629 | entry_attribute("Download Tag", 20, "download-tag", "dlt", "trunk", 0); |
| 1619 | 1630 | @ <p>The <a href='%R/download'>/download</a> page is designed to provide |
| 1620 | 1631 | @ a convenient place for newbies |
| 1621 | - @ to download a ZIP archive or a tarball of the project. By default, the latest | |
| 1622 | - @ trunk check-in is downloaded. Change this tag to something else (ex: release) | |
| 1623 | - @ to alter the behavior of the /download page. | |
| 1632 | + @ to download a ZIP archive or a tarball of the project. By default, | |
| 1633 | + @ the latest trunk check-in is downloaded. Change this tag to something | |
| 1634 | + @ else (ex: release) to alter the behavior of the /download page. | |
| 1624 | 1635 | @ (Property: "download-tag") |
| 1625 | 1636 | @ </p> |
| 1626 | 1637 | @ <hr /> |
| 1627 | 1638 | onoff_attribute("Enable WYSIWYG Wiki Editing", |
| 1628 | 1639 | "wysiwyg-wiki", "wysiwyg-wiki", 0, 0); |
| @@ -1763,11 +1774,12 @@ | ||
| 1763 | 1774 | @ <hr /> |
| 1764 | 1775 | @ <b>Ad-Unit Notes:</b><ul> |
| 1765 | 1776 | @ <li>Leave both Ad-Units blank to disable all advertising. |
| 1766 | 1777 | @ <li>The "Banner Ad-Unit" is used for wide pages. |
| 1767 | 1778 | @ <li>The "Right-Column Ad-Unit" is used on pages with tall, narrow content. |
| 1768 | - @ <li>If the "Right-Column Ad-Unit" is blank, the "Banner Ad-Unit" is used on all pages. | |
| 1779 | + @ <li>If the "Right-Column Ad-Unit" is blank, the "Banner Ad-Unit" is | |
| 1780 | + @ used on all pages. | |
| 1769 | 1781 | @ <li>Properties: "adunit", "adunit-right", "adunit-omit-if-admin", and |
| 1770 | 1782 | @ "adunit-omit-if-user". |
| 1771 | 1783 | @ <li>Suggested <a href="setup_skinedit?w=0">CSS</a> changes: |
| 1772 | 1784 | @ <blockquote><pre> |
| 1773 | 1785 | @ div.adunit_banner { |
| @@ -1876,11 +1888,12 @@ | ||
| 1876 | 1888 | cgi_redirect("setup_logo"); |
| 1877 | 1889 | } |
| 1878 | 1890 | style_header("Edit Project Logo And Background"); |
| 1879 | 1891 | @ <p>The current project logo has a MIME-Type of <b>%h(zLogoMime)</b> |
| 1880 | 1892 | @ and looks like this:</p> |
| 1881 | - @ <blockquote><p><img src="%s(g.zTop)/logo/%z(zLogoMtime)" alt="logo" border="1" /> | |
| 1893 | + @ <blockquote><p><img src="%s(g.zTop)/logo/%z(zLogoMtime)" \ | |
| 1894 | + @ alt="logo" border="1" /> | |
| 1882 | 1895 | @ </p></blockquote> |
| 1883 | 1896 | @ |
| 1884 | 1897 | @ <form action="%s(g.zTop)/setup_logo" method="post" |
| 1885 | 1898 | @ enctype="multipart/form-data"><div> |
| 1886 | 1899 | @ <p>The logo is accessible to all users at this URL: |
| @@ -1899,11 +1912,12 @@ | ||
| 1899 | 1912 | @ </div></form> |
| 1900 | 1913 | @ <hr /> |
| 1901 | 1914 | @ |
| 1902 | 1915 | @ <p>The current background image has a MIME-Type of <b>%h(zBgMime)</b> |
| 1903 | 1916 | @ and looks like this:</p> |
| 1904 | - @ <blockquote><p><img src="%s(g.zTop)/background/%z(zBgMtime)" alt="background" border=1 /> | |
| 1917 | + @ <blockquote><p><img src="%s(g.zTop)/background/%z(zBgMtime)" \ | |
| 1918 | + @ alt="background" border=1 /> | |
| 1905 | 1919 | @ </p></blockquote> |
| 1906 | 1920 | @ |
| 1907 | 1921 | @ <form action="%s(g.zTop)/setup_logo" method="post" |
| 1908 | 1922 | @ enctype="multipart/form-data"><div> |
| 1909 | 1923 | @ <p>The background image is accessible to all users at this URL: |
| @@ -1991,11 +2005,12 @@ | ||
| 1991 | 2005 | |
| 1992 | 2006 | if( P("configtab") ){ |
| 1993 | 2007 | /* If the user presses the "CONFIG Table Query" button, populate the |
| 1994 | 2008 | ** query text with a pre-packaged query against the CONFIG table */ |
| 1995 | 2009 | zQ = "SELECT\n" |
| 1996 | - " CASE WHEN length(name)<50 THEN name ELSE printf('%.50s...',name) END AS name,\n" | |
| 2010 | + " CASE WHEN length(name)<50 THEN name ELSE printf('%.50s...',name)" | |
| 2011 | + " END AS name,\n" | |
| 1997 | 2012 | " CASE WHEN typeof(value)<>'blob' AND length(value)<80 THEN value\n" |
| 1998 | 2013 | " ELSE '...' END AS value,\n" |
| 1999 | 2014 | " datetime(mtime, 'unixepoch') AS mtime\n" |
| 2000 | 2015 | "FROM config\n" |
| 2001 | 2016 | "-- ORDER BY mtime DESC; -- optional"; |
| @@ -2011,11 +2026,12 @@ | ||
| 2011 | 2026 | @ <input type="submit" name="tablelist" value="List Tables"> |
| 2012 | 2027 | @ <input type="submit" name="configtab" value="CONFIG Table Query"> |
| 2013 | 2028 | @ </form> |
| 2014 | 2029 | if( P("schema") ){ |
| 2015 | 2030 | zQ = sqlite3_mprintf( |
| 2016 | - "SELECT sql FROM repository.sqlite_master WHERE sql IS NOT NULL ORDER BY name"); | |
| 2031 | + "SELECT sql FROM repository.sqlite_master" | |
| 2032 | + " WHERE sql IS NOT NULL ORDER BY name"); | |
| 2017 | 2033 | go = 1; |
| 2018 | 2034 | }else if( P("tablelist") ){ |
| 2019 | 2035 | zQ = sqlite3_mprintf( |
| 2020 | 2036 | "SELECT name FROM repository.sqlite_master WHERE type='table'" |
| 2021 | 2037 | " ORDER BY name"); |
| @@ -2389,41 +2405,46 @@ | ||
| 2389 | 2405 | @ <input type='hidden' name='namelist' value='%h(blob_str(&namelist))'> |
| 2390 | 2406 | @ <input type='submit' name='submit' value="Apply Changes"> |
| 2391 | 2407 | @ </td><td></td></tr> |
| 2392 | 2408 | @ </table></form> |
| 2393 | 2409 | @ <hr> |
| 2394 | - @ <p>When the first term of an incoming URL exactly matches one of the "Aliases" on | |
| 2395 | - @ the left-hand side (LHS) above, the URL is converted into the corresponding form | |
| 2396 | - @ on the right-hand side (RHS). | |
| 2410 | + @ <p>When the first term of an incoming URL exactly matches one of | |
| 2411 | + @ the "Aliases" on the left-hand side (LHS) above, the URL is | |
| 2412 | + @ converted into the corresponding form on the right-hand side (RHS). | |
| 2397 | 2413 | @ <ul> |
| 2398 | 2414 | @ <li><p> |
| 2399 | 2415 | @ The LHS is compared against only the first term of the incoming URL. |
| 2400 | 2416 | @ All LHS entries in the alias table should therefore begin with a |
| 2401 | 2417 | @ single "/" followed by a single path element. |
| 2402 | 2418 | @ <li><p> |
| 2403 | - @ The RHS entries in the alias table should begin with a single "/" followed by | |
| 2404 | - @ a path element, and optionally followed by "?" and a list of query parameters. | |
| 2419 | + @ The RHS entries in the alias table should begin with a single "/" | |
| 2420 | + @ followed by a path element, and optionally followed by "?" and a | |
| 2421 | + @ list of query parameters. | |
| 2405 | 2422 | @ <li><p> |
| 2406 | 2423 | @ Query parameters on the RHS are added to the set of query parameters |
| 2407 | 2424 | @ in the incoming URL. |
| 2408 | 2425 | @ <li><p> |
| 2409 | - @ If the same query parameter appears in both the incoming URL and on the RHS of the | |
| 2410 | - @ alias, the RHS query parameter value overwrites the value on the incoming URL. | |
| 2426 | + @ If the same query parameter appears in both the incoming URL and | |
| 2427 | + @ on the RHS of the alias, the RHS query parameter value overwrites | |
| 2428 | + @ the value on the incoming URL. | |
| 2411 | 2429 | @ <li><p> |
| 2412 | - @ If a query parameter on the RHS of the alias is of the form "X!" (a name followed | |
| 2413 | - @ by "!") then the X query parameter is removed from the incoming URL if it exists. | |
| 2430 | + @ If a query parameter on the RHS of the alias is of the form "X!" | |
| 2431 | + @ (a name followed by "!") then the X query parameter is removed | |
| 2432 | + @ from the incoming URL if | |
| 2433 | + @ it exists. | |
| 2414 | 2434 | @ <li><p> |
| 2415 | 2435 | @ Only a single alias operation occurs. It is not possible to nest aliases. |
| 2416 | 2436 | @ The RHS entries must be built-in webpage names. |
| 2417 | 2437 | @ <li><p> |
| 2418 | - @ The alias table is only checked if no built-in webpage matches the incoming URL. | |
| 2419 | - @ Hence, it is not possible to override a built-in webpage using aliases. This is | |
| 2420 | - @ by design. | |
| 2438 | + @ The alias table is only checked if no built-in webpage matches | |
| 2439 | + @ the incoming URL. | |
| 2440 | + @ Hence, it is not possible to override a built-in webpage using aliases. | |
| 2441 | + @ This is by design. | |
| 2421 | 2442 | @ </ul> |
| 2422 | 2443 | @ |
| 2423 | 2444 | @ <p>To delete an entry from the alias table, change its name or value to an |
| 2424 | 2445 | @ empty string and press "Apply Changes". |
| 2425 | 2446 | @ |
| 2426 | - @ <p>To add a new alias, fill in the name and value in the bottom row of the table | |
| 2427 | - @ above and press "Apply Changes". | |
| 2447 | + @ <p>To add a new alias, fill in the name and value in the bottom row | |
| 2448 | + @ of the table above and press "Apply Changes". | |
| 2428 | 2449 | style_footer(); |
| 2429 | 2450 | } |
| 2430 | 2451 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -74,11 +74,12 @@ | |
| 74 | /* Make sure the header contains <base href="...">. Issue a warning |
| 75 | ** if it does not. */ |
| 76 | if( !cgi_header_contains("<base href=") ){ |
| 77 | @ <p class="generalError"><b>Configuration Error:</b> Please add |
| 78 | @ <tt><base href="$secureurl/$current_page"></tt> after |
| 79 | @ <tt><head></tt> in the <a href="setup_skinedit?w=2">HTML header</a>!</p> |
| 80 | } |
| 81 | |
| 82 | #if !defined(_WIN32) |
| 83 | /* Check for /dev/null and /dev/urandom. We want both devices to be present, |
| 84 | ** but they are sometimes omitted (by mistake) from chroot jails. */ |
| @@ -228,11 +229,12 @@ | |
| 228 | @ data-column-types='ktxTTK' data-init-sort='2'> |
| 229 | @ <thead><tr> |
| 230 | @ <th>Login Name<th>Caps<th>Info<th>Date<th>Expire<th>Last Login</tr></thead> |
| 231 | @ <tbody> |
| 232 | db_multi_exec( |
| 233 | "CREATE TEMP TABLE lastAccess(uname TEXT PRIMARY KEY, atime REAL) WITHOUT ROWID;" |
| 234 | ); |
| 235 | if( db_table_exists("repository","accesslog") ){ |
| 236 | db_multi_exec( |
| 237 | "INSERT INTO lastAccess(uname, atime)" |
| 238 | " SELECT uname, max(mtime) FROM (" |
| @@ -247,11 +249,12 @@ | |
| 247 | zWith = mprintf(" AND cap GLOB '*[%q]*'", zWith); |
| 248 | }else{ |
| 249 | zWith = ""; |
| 250 | } |
| 251 | db_prepare(&s, |
| 252 | "SELECT uid, login, cap, info, date(mtime,'unixepoch'), lower(login) AS sortkey, " |
| 253 | " CASE WHEN info LIKE '%%expires 20%%'" |
| 254 | " THEN substr(info,instr(lower(info),'expires')+8,10)" |
| 255 | " END AS exp," |
| 256 | "atime" |
| 257 | " FROM user LEFT JOIN lastAccess ON login=uname" |
| @@ -271,11 +274,12 @@ | |
| 271 | char *zAge = 0; |
| 272 | if( rATime>0.0 ){ |
| 273 | zAge = human_readable_age(rNow - rATime); |
| 274 | } |
| 275 | @ <tr> |
| 276 | @ <td data-sortkey='%h(zSortKey)'><a href='setup_uedit?id=%d(uid)'>%h(zLogin)</a> |
| 277 | @ <td>%h(zCap) |
| 278 | @ <td>%h(zInfo) |
| 279 | @ <td>%h(zDate?zDate:"") |
| 280 | @ <td>%h(zExp?zExp:"") |
| 281 | @ <td data-sortkey='%f(rATime)' style='white-space:nowrap'>%s(zAge?zAge:"") |
| @@ -352,13 +356,13 @@ | |
| 352 | } |
| 353 | |
| 354 | /* |
| 355 | ** WEBPAGE: setup_ulist_notes |
| 356 | ** |
| 357 | ** A documentation page showing notes about user configuration. This information |
| 358 | ** used to be a side-bar on the user list page, but has been factored out for |
| 359 | ** improved presentation. |
| 360 | */ |
| 361 | void setup_ulist_notes(void){ |
| 362 | style_header("User Configuration Notes"); |
| 363 | @ <h1>User Configuration Notes:</h1> |
| 364 | @ <ol> |
| @@ -481,14 +485,15 @@ | |
| 481 | |
| 482 | zCap[i] = 0; |
| 483 | zPw = P("pw"); |
| 484 | zLogin = P("login"); |
| 485 | if( strlen(zLogin)==0 ){ |
| 486 | style_header("User Creation Error"); |
| 487 | @ <span class="loginError">Empty login not allowed.</span> |
| 488 | @ |
| 489 | @ <p><a href="setup_uedit?id=%d(uid)&referer=%T(cgi_referer("setup_ulist"))"> |
| 490 | @ [Bummer]</a></p> |
| 491 | style_footer(); |
| 492 | return; |
| 493 | } |
| 494 | if( isValidPwString(zPw) ){ |
| @@ -495,16 +500,17 @@ | |
| 495 | zPw = sha1_shared_secret(zPw, zLogin, 0); |
| 496 | }else{ |
| 497 | zPw = db_text(0, "SELECT pw FROM user WHERE uid=%d", uid); |
| 498 | } |
| 499 | zOldLogin = db_text(0, "SELECT login FROM user WHERE uid=%d", uid); |
| 500 | if( db_exists("SELECT 1 FROM user WHERE login=%Q AND uid!=%d", zLogin, uid) ){ |
| 501 | style_header("User Creation Error"); |
| 502 | @ <span class="loginError">Login "%h(zLogin)" is already used by |
| 503 | @ a different user.</span> |
| 504 | @ |
| 505 | @ <p><a href="setup_uedit?id=%d(uid)&referer=%T(cgi_referer("setup_ulist"))"> |
| 506 | @ [Bummer]</a></p> |
| 507 | style_footer(); |
| 508 | return; |
| 509 | } |
| 510 | login_verify_csrf_secret(); |
| @@ -543,15 +549,16 @@ | |
| 543 | blob_reset(&sql); |
| 544 | admin_log( "Updated user [%q] in all login groups " |
| 545 | "with capabilities [%q].", |
| 546 | zLogin, zCap ); |
| 547 | if( zErr ){ |
| 548 | style_header("User Change Error"); |
| 549 | admin_log( "Error updating user '%q': %s'.", zLogin, zErr ); |
| 550 | @ <span class="loginError">%h(zErr)</span> |
| 551 | @ |
| 552 | @ <p><a href="setup_uedit?id=%d(uid)&referer=%T(cgi_referer("setup_ulist"))"> |
| 553 | @ [Bummer]</a></p> |
| 554 | style_footer(); |
| 555 | return; |
| 556 | } |
| 557 | } |
| @@ -781,18 +788,20 @@ | |
| 781 | @ indicates the privileges of <span class="usertype">nobody</span> that |
| 782 | @ are available to all users regardless of whether or not they are logged in. |
| 783 | @ </p></li> |
| 784 | @ |
| 785 | @ <li><p> |
| 786 | @ The "<span class="ueditInheritAnonymous"><sub>A</sub></span>" subscript suffix |
| 787 | @ indicates the privileges of <span class="usertype">anonymous</span> that |
| 788 | @ are inherited by all logged-in users. |
| 789 | @ </p></li> |
| 790 | @ |
| 791 | @ <li><p> |
| 792 | @ The "<span class="ueditInheritDeveloper"><sub>D</sub></span>" subscript suffix |
| 793 | @ indicates the privileges of <span class="usertype">developer</span> that |
| 794 | @ are inherited by all users with the |
| 795 | @ <span class="capability">Developer</span> privilege. |
| 796 | @ </p></li> |
| 797 | @ |
| 798 | @ <li><p> |
| @@ -973,11 +982,12 @@ | |
| 973 | db_set(zVar, zQ, 0); |
| 974 | admin_log("Set entry_attribute %Q to: %.*s%s", |
| 975 | zVar, 20, zQ, (nZQ>20 ? "..." : "")); |
| 976 | zVal = zQ; |
| 977 | } |
| 978 | @ <input type="text" id="%s(zQParm)" name="%s(zQParm)" value="%h(zVal)" size="%d(width)" |
| 979 | if( disabled ){ |
| 980 | @ disabled="disabled" |
| 981 | } |
| 982 | @ /> <b>%s(zLabel)</b> |
| 983 | } |
| @@ -1364,11 +1374,12 @@ | |
| 1364 | @ IP octets</a> in the login cookie across all repositories in the |
| 1365 | @ same Login Group. |
| 1366 | @ <hr /><h2>Implementation Details</h2> |
| 1367 | @ <p>The following are fields from the CONFIG table related to login-groups, |
| 1368 | @ provided here for instructional and debugging purposes:</p> |
| 1369 | @ <table border='1' class='sortable' data-column-types='ttt' data-init-sort='1'> |
| 1370 | @ <thead><tr> |
| 1371 | @ <th>Config.Name<th>Config.Value<th>Config.mtime</tr> |
| 1372 | @ </thead><tbody> |
| 1373 | db_prepare(&q, "SELECT name, value, datetime(mtime,'unixepoch') FROM config" |
| 1374 | " WHERE name GLOB 'peer-*'" |
| @@ -1458,14 +1469,14 @@ | |
| 1458 | @ <p>(Property: "timeline-utc") |
| 1459 | @ <hr /> |
| 1460 | multiple_choice_attribute("Per-Item Time Format", "timeline-date-format", |
| 1461 | "tdf", "0", count(azTimeFormats)/2, azTimeFormats); |
| 1462 | @ <p>If the "HH:MM" or "HH:MM:SS" format is selected, then the date is shown |
| 1463 | @ in a separate box (using CSS class "timelineDate") whenever the date changes. |
| 1464 | @ With the "YYYY-MM-DD HH:MM" and "YYMMDD ..." formats, the complete date |
| 1465 | @ and time is shown on every timeline entry using the CSS class "timelineTime". |
| 1466 | @ (Preperty: "timeline-date-format")</p> |
| 1467 | |
| 1468 | @ <hr /> |
| 1469 | onoff_attribute("Show version differences by default", |
| 1470 | "show-version-diffs", "vdiff", 0, 0); |
| 1471 | @ <p>The version-information pages linked from the timeline can either |
| @@ -1606,23 +1617,23 @@ | |
| 1606 | @ engines as well as a short RSS description. |
| 1607 | @ (Property: "project-description")</p> |
| 1608 | @ <hr /> |
| 1609 | entry_attribute("Tarball and ZIP-archive Prefix", 20, "short-project-name", |
| 1610 | "spn", "", 0); |
| 1611 | @ <p>This is used as a prefix on the names of generated tarballs and ZIP archive. |
| 1612 | @ For best results, keep this prefix brief and avoid special characters such |
| 1613 | @ as "/" and "\". |
| 1614 | @ If no tarball prefix is specified, then the full Project Name above is used. |
| 1615 | @ (Property: "short-project-name") |
| 1616 | @ </p> |
| 1617 | @ <hr /> |
| 1618 | entry_attribute("Download Tag", 20, "download-tag", "dlt", "trunk", 0); |
| 1619 | @ <p>The <a href='%R/download'>/download</a> page is designed to provide |
| 1620 | @ a convenient place for newbies |
| 1621 | @ to download a ZIP archive or a tarball of the project. By default, the latest |
| 1622 | @ trunk check-in is downloaded. Change this tag to something else (ex: release) |
| 1623 | @ to alter the behavior of the /download page. |
| 1624 | @ (Property: "download-tag") |
| 1625 | @ </p> |
| 1626 | @ <hr /> |
| 1627 | onoff_attribute("Enable WYSIWYG Wiki Editing", |
| 1628 | "wysiwyg-wiki", "wysiwyg-wiki", 0, 0); |
| @@ -1763,11 +1774,12 @@ | |
| 1763 | @ <hr /> |
| 1764 | @ <b>Ad-Unit Notes:</b><ul> |
| 1765 | @ <li>Leave both Ad-Units blank to disable all advertising. |
| 1766 | @ <li>The "Banner Ad-Unit" is used for wide pages. |
| 1767 | @ <li>The "Right-Column Ad-Unit" is used on pages with tall, narrow content. |
| 1768 | @ <li>If the "Right-Column Ad-Unit" is blank, the "Banner Ad-Unit" is used on all pages. |
| 1769 | @ <li>Properties: "adunit", "adunit-right", "adunit-omit-if-admin", and |
| 1770 | @ "adunit-omit-if-user". |
| 1771 | @ <li>Suggested <a href="setup_skinedit?w=0">CSS</a> changes: |
| 1772 | @ <blockquote><pre> |
| 1773 | @ div.adunit_banner { |
| @@ -1876,11 +1888,12 @@ | |
| 1876 | cgi_redirect("setup_logo"); |
| 1877 | } |
| 1878 | style_header("Edit Project Logo And Background"); |
| 1879 | @ <p>The current project logo has a MIME-Type of <b>%h(zLogoMime)</b> |
| 1880 | @ and looks like this:</p> |
| 1881 | @ <blockquote><p><img src="%s(g.zTop)/logo/%z(zLogoMtime)" alt="logo" border="1" /> |
| 1882 | @ </p></blockquote> |
| 1883 | @ |
| 1884 | @ <form action="%s(g.zTop)/setup_logo" method="post" |
| 1885 | @ enctype="multipart/form-data"><div> |
| 1886 | @ <p>The logo is accessible to all users at this URL: |
| @@ -1899,11 +1912,12 @@ | |
| 1899 | @ </div></form> |
| 1900 | @ <hr /> |
| 1901 | @ |
| 1902 | @ <p>The current background image has a MIME-Type of <b>%h(zBgMime)</b> |
| 1903 | @ and looks like this:</p> |
| 1904 | @ <blockquote><p><img src="%s(g.zTop)/background/%z(zBgMtime)" alt="background" border=1 /> |
| 1905 | @ </p></blockquote> |
| 1906 | @ |
| 1907 | @ <form action="%s(g.zTop)/setup_logo" method="post" |
| 1908 | @ enctype="multipart/form-data"><div> |
| 1909 | @ <p>The background image is accessible to all users at this URL: |
| @@ -1991,11 +2005,12 @@ | |
| 1991 | |
| 1992 | if( P("configtab") ){ |
| 1993 | /* If the user presses the "CONFIG Table Query" button, populate the |
| 1994 | ** query text with a pre-packaged query against the CONFIG table */ |
| 1995 | zQ = "SELECT\n" |
| 1996 | " CASE WHEN length(name)<50 THEN name ELSE printf('%.50s...',name) END AS name,\n" |
| 1997 | " CASE WHEN typeof(value)<>'blob' AND length(value)<80 THEN value\n" |
| 1998 | " ELSE '...' END AS value,\n" |
| 1999 | " datetime(mtime, 'unixepoch') AS mtime\n" |
| 2000 | "FROM config\n" |
| 2001 | "-- ORDER BY mtime DESC; -- optional"; |
| @@ -2011,11 +2026,12 @@ | |
| 2011 | @ <input type="submit" name="tablelist" value="List Tables"> |
| 2012 | @ <input type="submit" name="configtab" value="CONFIG Table Query"> |
| 2013 | @ </form> |
| 2014 | if( P("schema") ){ |
| 2015 | zQ = sqlite3_mprintf( |
| 2016 | "SELECT sql FROM repository.sqlite_master WHERE sql IS NOT NULL ORDER BY name"); |
| 2017 | go = 1; |
| 2018 | }else if( P("tablelist") ){ |
| 2019 | zQ = sqlite3_mprintf( |
| 2020 | "SELECT name FROM repository.sqlite_master WHERE type='table'" |
| 2021 | " ORDER BY name"); |
| @@ -2389,41 +2405,46 @@ | |
| 2389 | @ <input type='hidden' name='namelist' value='%h(blob_str(&namelist))'> |
| 2390 | @ <input type='submit' name='submit' value="Apply Changes"> |
| 2391 | @ </td><td></td></tr> |
| 2392 | @ </table></form> |
| 2393 | @ <hr> |
| 2394 | @ <p>When the first term of an incoming URL exactly matches one of the "Aliases" on |
| 2395 | @ the left-hand side (LHS) above, the URL is converted into the corresponding form |
| 2396 | @ on the right-hand side (RHS). |
| 2397 | @ <ul> |
| 2398 | @ <li><p> |
| 2399 | @ The LHS is compared against only the first term of the incoming URL. |
| 2400 | @ All LHS entries in the alias table should therefore begin with a |
| 2401 | @ single "/" followed by a single path element. |
| 2402 | @ <li><p> |
| 2403 | @ The RHS entries in the alias table should begin with a single "/" followed by |
| 2404 | @ a path element, and optionally followed by "?" and a list of query parameters. |
| 2405 | @ <li><p> |
| 2406 | @ Query parameters on the RHS are added to the set of query parameters |
| 2407 | @ in the incoming URL. |
| 2408 | @ <li><p> |
| 2409 | @ If the same query parameter appears in both the incoming URL and on the RHS of the |
| 2410 | @ alias, the RHS query parameter value overwrites the value on the incoming URL. |
| 2411 | @ <li><p> |
| 2412 | @ If a query parameter on the RHS of the alias is of the form "X!" (a name followed |
| 2413 | @ by "!") then the X query parameter is removed from the incoming URL if it exists. |
| 2414 | @ <li><p> |
| 2415 | @ Only a single alias operation occurs. It is not possible to nest aliases. |
| 2416 | @ The RHS entries must be built-in webpage names. |
| 2417 | @ <li><p> |
| 2418 | @ The alias table is only checked if no built-in webpage matches the incoming URL. |
| 2419 | @ Hence, it is not possible to override a built-in webpage using aliases. This is |
| 2420 | @ by design. |
| 2421 | @ </ul> |
| 2422 | @ |
| 2423 | @ <p>To delete an entry from the alias table, change its name or value to an |
| 2424 | @ empty string and press "Apply Changes". |
| 2425 | @ |
| 2426 | @ <p>To add a new alias, fill in the name and value in the bottom row of the table |
| 2427 | @ above and press "Apply Changes". |
| 2428 | style_footer(); |
| 2429 | } |
| 2430 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -74,11 +74,12 @@ | |
| 74 | /* Make sure the header contains <base href="...">. Issue a warning |
| 75 | ** if it does not. */ |
| 76 | if( !cgi_header_contains("<base href=") ){ |
| 77 | @ <p class="generalError"><b>Configuration Error:</b> Please add |
| 78 | @ <tt><base href="$secureurl/$current_page"></tt> after |
| 79 | @ <tt><head></tt> in the |
| 80 | @ <a href="setup_skinedit?w=2">HTML header</a>!</p> |
| 81 | } |
| 82 | |
| 83 | #if !defined(_WIN32) |
| 84 | /* Check for /dev/null and /dev/urandom. We want both devices to be present, |
| 85 | ** but they are sometimes omitted (by mistake) from chroot jails. */ |
| @@ -228,11 +229,12 @@ | |
| 229 | @ data-column-types='ktxTTK' data-init-sort='2'> |
| 230 | @ <thead><tr> |
| 231 | @ <th>Login Name<th>Caps<th>Info<th>Date<th>Expire<th>Last Login</tr></thead> |
| 232 | @ <tbody> |
| 233 | db_multi_exec( |
| 234 | "CREATE TEMP TABLE lastAccess(uname TEXT PRIMARY KEY, atime REAL)" |
| 235 | "WITHOUT ROWID;" |
| 236 | ); |
| 237 | if( db_table_exists("repository","accesslog") ){ |
| 238 | db_multi_exec( |
| 239 | "INSERT INTO lastAccess(uname, atime)" |
| 240 | " SELECT uname, max(mtime) FROM (" |
| @@ -247,11 +249,12 @@ | |
| 249 | zWith = mprintf(" AND cap GLOB '*[%q]*'", zWith); |
| 250 | }else{ |
| 251 | zWith = ""; |
| 252 | } |
| 253 | db_prepare(&s, |
| 254 | "SELECT uid, login, cap, info, date(mtime,'unixepoch')," |
| 255 | " lower(login) AS sortkey, " |
| 256 | " CASE WHEN info LIKE '%%expires 20%%'" |
| 257 | " THEN substr(info,instr(lower(info),'expires')+8,10)" |
| 258 | " END AS exp," |
| 259 | "atime" |
| 260 | " FROM user LEFT JOIN lastAccess ON login=uname" |
| @@ -271,11 +274,12 @@ | |
| 274 | char *zAge = 0; |
| 275 | if( rATime>0.0 ){ |
| 276 | zAge = human_readable_age(rNow - rATime); |
| 277 | } |
| 278 | @ <tr> |
| 279 | @ <td data-sortkey='%h(zSortKey)'>\ |
| 280 | @ <a href='setup_uedit?id=%d(uid)'>%h(zLogin)</a> |
| 281 | @ <td>%h(zCap) |
| 282 | @ <td>%h(zInfo) |
| 283 | @ <td>%h(zDate?zDate:"") |
| 284 | @ <td>%h(zExp?zExp:"") |
| 285 | @ <td data-sortkey='%f(rATime)' style='white-space:nowrap'>%s(zAge?zAge:"") |
| @@ -352,13 +356,13 @@ | |
| 356 | } |
| 357 | |
| 358 | /* |
| 359 | ** WEBPAGE: setup_ulist_notes |
| 360 | ** |
| 361 | ** A documentation page showing notes about user configuration. This |
| 362 | ** information used to be a side-bar on the user list page, but has been |
| 363 | ** factored out for improved presentation. |
| 364 | */ |
| 365 | void setup_ulist_notes(void){ |
| 366 | style_header("User Configuration Notes"); |
| 367 | @ <h1>User Configuration Notes:</h1> |
| 368 | @ <ol> |
| @@ -481,14 +485,15 @@ | |
| 485 | |
| 486 | zCap[i] = 0; |
| 487 | zPw = P("pw"); |
| 488 | zLogin = P("login"); |
| 489 | if( strlen(zLogin)==0 ){ |
| 490 | char *zRef = cgi_referer("setup_ulist"); |
| 491 | style_header("User Creation Error"); |
| 492 | @ <span class="loginError">Empty login not allowed.</span> |
| 493 | @ |
| 494 | @ <p><a href="setup_uedit?id=%d(uid)&referer=%T(zRef)"> |
| 495 | @ [Bummer]</a></p> |
| 496 | style_footer(); |
| 497 | return; |
| 498 | } |
| 499 | if( isValidPwString(zPw) ){ |
| @@ -495,16 +500,17 @@ | |
| 500 | zPw = sha1_shared_secret(zPw, zLogin, 0); |
| 501 | }else{ |
| 502 | zPw = db_text(0, "SELECT pw FROM user WHERE uid=%d", uid); |
| 503 | } |
| 504 | zOldLogin = db_text(0, "SELECT login FROM user WHERE uid=%d", uid); |
| 505 | if( db_exists("SELECT 1 FROM user WHERE login=%Q AND uid!=%d",zLogin,uid) ){ |
| 506 | char *zRef = cgi_referer("setup_ulist"); |
| 507 | style_header("User Creation Error"); |
| 508 | @ <span class="loginError">Login "%h(zLogin)" is already used by |
| 509 | @ a different user.</span> |
| 510 | @ |
| 511 | @ <p><a href="setup_uedit?id=%d(uid)&referer=%T(zRef)"> |
| 512 | @ [Bummer]</a></p> |
| 513 | style_footer(); |
| 514 | return; |
| 515 | } |
| 516 | login_verify_csrf_secret(); |
| @@ -543,15 +549,16 @@ | |
| 549 | blob_reset(&sql); |
| 550 | admin_log( "Updated user [%q] in all login groups " |
| 551 | "with capabilities [%q].", |
| 552 | zLogin, zCap ); |
| 553 | if( zErr ){ |
| 554 | char *zRef = cgi_referer("setup_ulist"); |
| 555 | style_header("User Change Error"); |
| 556 | admin_log( "Error updating user '%q': %s'.", zLogin, zErr ); |
| 557 | @ <span class="loginError">%h(zErr)</span> |
| 558 | @ |
| 559 | @ <p><a href="setup_uedit?id=%d(uid)&referer=%T(zRef)"> |
| 560 | @ [Bummer]</a></p> |
| 561 | style_footer(); |
| 562 | return; |
| 563 | } |
| 564 | } |
| @@ -781,18 +788,20 @@ | |
| 788 | @ indicates the privileges of <span class="usertype">nobody</span> that |
| 789 | @ are available to all users regardless of whether or not they are logged in. |
| 790 | @ </p></li> |
| 791 | @ |
| 792 | @ <li><p> |
| 793 | @ The "<span class="ueditInheritAnonymous"><sub>A</sub></span>" |
| 794 | @ subscript suffix |
| 795 | @ indicates the privileges of <span class="usertype">anonymous</span> that |
| 796 | @ are inherited by all logged-in users. |
| 797 | @ </p></li> |
| 798 | @ |
| 799 | @ <li><p> |
| 800 | @ The "<span class="ueditInheritDeveloper"><sub>D</sub></span>" |
| 801 | @ subscript suffix indicates the privileges of |
| 802 | @ <span class="usertype">developer</span> that |
| 803 | @ are inherited by all users with the |
| 804 | @ <span class="capability">Developer</span> privilege. |
| 805 | @ </p></li> |
| 806 | @ |
| 807 | @ <li><p> |
| @@ -973,11 +982,12 @@ | |
| 982 | db_set(zVar, zQ, 0); |
| 983 | admin_log("Set entry_attribute %Q to: %.*s%s", |
| 984 | zVar, 20, zQ, (nZQ>20 ? "..." : "")); |
| 985 | zVal = zQ; |
| 986 | } |
| 987 | @ <input type="text" id="%s(zQParm)" name="%s(zQParm)" value="%h(zVal)" \ |
| 988 | @ size="%d(width)" |
| 989 | if( disabled ){ |
| 990 | @ disabled="disabled" |
| 991 | } |
| 992 | @ /> <b>%s(zLabel)</b> |
| 993 | } |
| @@ -1364,11 +1374,12 @@ | |
| 1374 | @ IP octets</a> in the login cookie across all repositories in the |
| 1375 | @ same Login Group. |
| 1376 | @ <hr /><h2>Implementation Details</h2> |
| 1377 | @ <p>The following are fields from the CONFIG table related to login-groups, |
| 1378 | @ provided here for instructional and debugging purposes:</p> |
| 1379 | @ <table border='1' class='sortable' data-column-types='ttt' \ |
| 1380 | @ data-init-sort='1'> |
| 1381 | @ <thead><tr> |
| 1382 | @ <th>Config.Name<th>Config.Value<th>Config.mtime</tr> |
| 1383 | @ </thead><tbody> |
| 1384 | db_prepare(&q, "SELECT name, value, datetime(mtime,'unixepoch') FROM config" |
| 1385 | " WHERE name GLOB 'peer-*'" |
| @@ -1458,14 +1469,14 @@ | |
| 1469 | @ <p>(Property: "timeline-utc") |
| 1470 | @ <hr /> |
| 1471 | multiple_choice_attribute("Per-Item Time Format", "timeline-date-format", |
| 1472 | "tdf", "0", count(azTimeFormats)/2, azTimeFormats); |
| 1473 | @ <p>If the "HH:MM" or "HH:MM:SS" format is selected, then the date is shown |
| 1474 | @ in a separate box (using CSS class "timelineDate") whenever the date |
| 1475 | @ changes. With the "YYYY-MM-DD HH:MM" and "YYMMDD ..." formats, |
| 1476 | @ the complete date and time is shown on every timeline entry using the |
| 1477 | @ CSS class "timelineTime". (Preperty: "timeline-date-format")</p> |
| 1478 | |
| 1479 | @ <hr /> |
| 1480 | onoff_attribute("Show version differences by default", |
| 1481 | "show-version-diffs", "vdiff", 0, 0); |
| 1482 | @ <p>The version-information pages linked from the timeline can either |
| @@ -1606,23 +1617,23 @@ | |
| 1617 | @ engines as well as a short RSS description. |
| 1618 | @ (Property: "project-description")</p> |
| 1619 | @ <hr /> |
| 1620 | entry_attribute("Tarball and ZIP-archive Prefix", 20, "short-project-name", |
| 1621 | "spn", "", 0); |
| 1622 | @ <p>This is used as a prefix on the names of generated tarballs and |
| 1623 | @ ZIP archive. For best results, keep this prefix brief and avoid special |
| 1624 | @ characters such as "/" and "\". |
| 1625 | @ If no tarball prefix is specified, then the full Project Name above is used. |
| 1626 | @ (Property: "short-project-name") |
| 1627 | @ </p> |
| 1628 | @ <hr /> |
| 1629 | entry_attribute("Download Tag", 20, "download-tag", "dlt", "trunk", 0); |
| 1630 | @ <p>The <a href='%R/download'>/download</a> page is designed to provide |
| 1631 | @ a convenient place for newbies |
| 1632 | @ to download a ZIP archive or a tarball of the project. By default, |
| 1633 | @ the latest trunk check-in is downloaded. Change this tag to something |
| 1634 | @ else (ex: release) to alter the behavior of the /download page. |
| 1635 | @ (Property: "download-tag") |
| 1636 | @ </p> |
| 1637 | @ <hr /> |
| 1638 | onoff_attribute("Enable WYSIWYG Wiki Editing", |
| 1639 | "wysiwyg-wiki", "wysiwyg-wiki", 0, 0); |
| @@ -1763,11 +1774,12 @@ | |
| 1774 | @ <hr /> |
| 1775 | @ <b>Ad-Unit Notes:</b><ul> |
| 1776 | @ <li>Leave both Ad-Units blank to disable all advertising. |
| 1777 | @ <li>The "Banner Ad-Unit" is used for wide pages. |
| 1778 | @ <li>The "Right-Column Ad-Unit" is used on pages with tall, narrow content. |
| 1779 | @ <li>If the "Right-Column Ad-Unit" is blank, the "Banner Ad-Unit" is |
| 1780 | @ used on all pages. |
| 1781 | @ <li>Properties: "adunit", "adunit-right", "adunit-omit-if-admin", and |
| 1782 | @ "adunit-omit-if-user". |
| 1783 | @ <li>Suggested <a href="setup_skinedit?w=0">CSS</a> changes: |
| 1784 | @ <blockquote><pre> |
| 1785 | @ div.adunit_banner { |
| @@ -1876,11 +1888,12 @@ | |
| 1888 | cgi_redirect("setup_logo"); |
| 1889 | } |
| 1890 | style_header("Edit Project Logo And Background"); |
| 1891 | @ <p>The current project logo has a MIME-Type of <b>%h(zLogoMime)</b> |
| 1892 | @ and looks like this:</p> |
| 1893 | @ <blockquote><p><img src="%s(g.zTop)/logo/%z(zLogoMtime)" \ |
| 1894 | @ alt="logo" border="1" /> |
| 1895 | @ </p></blockquote> |
| 1896 | @ |
| 1897 | @ <form action="%s(g.zTop)/setup_logo" method="post" |
| 1898 | @ enctype="multipart/form-data"><div> |
| 1899 | @ <p>The logo is accessible to all users at this URL: |
| @@ -1899,11 +1912,12 @@ | |
| 1912 | @ </div></form> |
| 1913 | @ <hr /> |
| 1914 | @ |
| 1915 | @ <p>The current background image has a MIME-Type of <b>%h(zBgMime)</b> |
| 1916 | @ and looks like this:</p> |
| 1917 | @ <blockquote><p><img src="%s(g.zTop)/background/%z(zBgMtime)" \ |
| 1918 | @ alt="background" border=1 /> |
| 1919 | @ </p></blockquote> |
| 1920 | @ |
| 1921 | @ <form action="%s(g.zTop)/setup_logo" method="post" |
| 1922 | @ enctype="multipart/form-data"><div> |
| 1923 | @ <p>The background image is accessible to all users at this URL: |
| @@ -1991,11 +2005,12 @@ | |
| 2005 | |
| 2006 | if( P("configtab") ){ |
| 2007 | /* If the user presses the "CONFIG Table Query" button, populate the |
| 2008 | ** query text with a pre-packaged query against the CONFIG table */ |
| 2009 | zQ = "SELECT\n" |
| 2010 | " CASE WHEN length(name)<50 THEN name ELSE printf('%.50s...',name)" |
| 2011 | " END AS name,\n" |
| 2012 | " CASE WHEN typeof(value)<>'blob' AND length(value)<80 THEN value\n" |
| 2013 | " ELSE '...' END AS value,\n" |
| 2014 | " datetime(mtime, 'unixepoch') AS mtime\n" |
| 2015 | "FROM config\n" |
| 2016 | "-- ORDER BY mtime DESC; -- optional"; |
| @@ -2011,11 +2026,12 @@ | |
| 2026 | @ <input type="submit" name="tablelist" value="List Tables"> |
| 2027 | @ <input type="submit" name="configtab" value="CONFIG Table Query"> |
| 2028 | @ </form> |
| 2029 | if( P("schema") ){ |
| 2030 | zQ = sqlite3_mprintf( |
| 2031 | "SELECT sql FROM repository.sqlite_master" |
| 2032 | " WHERE sql IS NOT NULL ORDER BY name"); |
| 2033 | go = 1; |
| 2034 | }else if( P("tablelist") ){ |
| 2035 | zQ = sqlite3_mprintf( |
| 2036 | "SELECT name FROM repository.sqlite_master WHERE type='table'" |
| 2037 | " ORDER BY name"); |
| @@ -2389,41 +2405,46 @@ | |
| 2405 | @ <input type='hidden' name='namelist' value='%h(blob_str(&namelist))'> |
| 2406 | @ <input type='submit' name='submit' value="Apply Changes"> |
| 2407 | @ </td><td></td></tr> |
| 2408 | @ </table></form> |
| 2409 | @ <hr> |
| 2410 | @ <p>When the first term of an incoming URL exactly matches one of |
| 2411 | @ the "Aliases" on the left-hand side (LHS) above, the URL is |
| 2412 | @ converted into the corresponding form on the right-hand side (RHS). |
| 2413 | @ <ul> |
| 2414 | @ <li><p> |
| 2415 | @ The LHS is compared against only the first term of the incoming URL. |
| 2416 | @ All LHS entries in the alias table should therefore begin with a |
| 2417 | @ single "/" followed by a single path element. |
| 2418 | @ <li><p> |
| 2419 | @ The RHS entries in the alias table should begin with a single "/" |
| 2420 | @ followed by a path element, and optionally followed by "?" and a |
| 2421 | @ list of query parameters. |
| 2422 | @ <li><p> |
| 2423 | @ Query parameters on the RHS are added to the set of query parameters |
| 2424 | @ in the incoming URL. |
| 2425 | @ <li><p> |
| 2426 | @ If the same query parameter appears in both the incoming URL and |
| 2427 | @ on the RHS of the alias, the RHS query parameter value overwrites |
| 2428 | @ the value on the incoming URL. |
| 2429 | @ <li><p> |
| 2430 | @ If a query parameter on the RHS of the alias is of the form "X!" |
| 2431 | @ (a name followed by "!") then the X query parameter is removed |
| 2432 | @ from the incoming URL if |
| 2433 | @ it exists. |
| 2434 | @ <li><p> |
| 2435 | @ Only a single alias operation occurs. It is not possible to nest aliases. |
| 2436 | @ The RHS entries must be built-in webpage names. |
| 2437 | @ <li><p> |
| 2438 | @ The alias table is only checked if no built-in webpage matches |
| 2439 | @ the incoming URL. |
| 2440 | @ Hence, it is not possible to override a built-in webpage using aliases. |
| 2441 | @ This is by design. |
| 2442 | @ </ul> |
| 2443 | @ |
| 2444 | @ <p>To delete an entry from the alias table, change its name or value to an |
| 2445 | @ empty string and press "Apply Changes". |
| 2446 | @ |
| 2447 | @ <p>To add a new alias, fill in the name and value in the bottom row |
| 2448 | @ of the table above and press "Apply Changes". |
| 2449 | style_footer(); |
| 2450 | } |
| 2451 |