Fossil SCM
Removed unnecessary items from WWW Configuration, also made RSS Title and Description into generic Project Name and Project Description settings, which will be used elsewhere in the web site.
Commit
f3807dbd88a8d65b85ca39489611268b5ea3a962
Parent
dfea940da850d68…
4 files changed
+22
-18
+19
-35
+13
-12
+2
-2
+22
-18
| --- src/rss.c | ||
| +++ src/rss.c | ||
| @@ -7,11 +7,11 @@ | ||
| 7 | 7 | ** |
| 8 | 8 | ** This program is distributed in the hope that it will be useful, |
| 9 | 9 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | 10 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 | 11 | ** General Public License for more details. |
| 12 | -** | |
| 12 | +** | |
| 13 | 13 | ** You should have received a copy of the GNU General Public |
| 14 | 14 | ** License along with this library; if not, write to the |
| 15 | 15 | ** Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 16 | 16 | ** Boston, MA 02111-1307, USA. |
| 17 | 17 | ** |
| @@ -28,18 +28,18 @@ | ||
| 28 | 28 | #include <assert.h> |
| 29 | 29 | #include <time.h> |
| 30 | 30 | |
| 31 | 31 | time_t rss_datetime_to_time_t(const char *dt){ |
| 32 | 32 | struct tm the_tm; |
| 33 | - | |
| 33 | + | |
| 34 | 34 | the_tm.tm_year = atoi(dt)-1900; |
| 35 | 35 | the_tm.tm_mon = atoi(&dt[5])-1; |
| 36 | 36 | the_tm.tm_mday = atoi(&dt[8]); |
| 37 | 37 | the_tm.tm_hour = atoi(&dt[11]); |
| 38 | 38 | the_tm.tm_min = atoi(&dt[14]); |
| 39 | 39 | the_tm.tm_sec = atoi(&dt[17]); |
| 40 | - | |
| 40 | + | |
| 41 | 41 | return mktime(&the_tm); |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /* |
| 45 | 45 | ** WEBPAGE: timeline.rss |
| @@ -46,11 +46,11 @@ | ||
| 46 | 46 | */ |
| 47 | 47 | |
| 48 | 48 | void page_timeline_rss(void){ |
| 49 | 49 | Stmt q; |
| 50 | 50 | int nLine=0; |
| 51 | - char *zPubDate, *zRSSTitle, *zRSSDescr, *zFreeRSSTitle=0; | |
| 51 | + char *zPubDate, *zProjectName, *zProjectDescr, *zFreeProjectName=0; | |
| 52 | 52 | const char zSQL[] = |
| 53 | 53 | @ SELECT |
| 54 | 54 | @ blob.rid, |
| 55 | 55 | @ uuid, |
| 56 | 56 | @ datetime(event.mtime), |
| @@ -60,31 +60,31 @@ | ||
| 60 | 60 | @ (SELECT count(*) FROM plink WHERE cid=blob.rid) |
| 61 | 61 | @ FROM event, blob |
| 62 | 62 | @ WHERE blob.rid=event.objid |
| 63 | 63 | @ ORDER BY event.mtime DESC |
| 64 | 64 | ; |
| 65 | - | |
| 65 | + | |
| 66 | 66 | cgi_set_content_type("application/rss+xml"); |
| 67 | - | |
| 68 | - zRSSTitle = db_get("rss-title", 0); | |
| 69 | - if( zRSSTitle==0 ){ | |
| 70 | - zFreeRSSTitle = zRSSTitle = mprintf("Fossil source repository for: %s", | |
| 67 | + | |
| 68 | + zProjectName = db_get("project-name", 0); | |
| 69 | + if( zProjectName==0 ){ | |
| 70 | + zFreeProjectName = zProjectName = mprintf("Fossil source repository for: %s", | |
| 71 | 71 | g.zBaseURL); |
| 72 | 72 | } |
| 73 | - zRSSDescr = db_get("rss-description", 0); | |
| 74 | - if( zRSSDescr==0 ){ | |
| 75 | - zRSSDescr = zRSSTitle; | |
| 73 | + zProjectDescr = db_get("project-description", 0); | |
| 74 | + if( zProjectDescr==0 ){ | |
| 75 | + zProjectDescr = zProjectName; | |
| 76 | 76 | } |
| 77 | - | |
| 77 | + | |
| 78 | 78 | zPubDate = cgi_rfc822_datestamp(time(NULL)); |
| 79 | - | |
| 79 | + | |
| 80 | 80 | @ <?xml version="1.0"?> |
| 81 | 81 | @ <rss version="2.0"> |
| 82 | 82 | @ <channel> |
| 83 | - @ <title>%s(zRSSTitle)</title> | |
| 83 | + @ <title>%s(zProjectName)</title> | |
| 84 | 84 | @ <link>%s(g.zBaseURL)</link> |
| 85 | - @ <description>%s(zRSSDescr)</description> | |
| 85 | + @ <description>%s(zProjectDescr)</description> | |
| 86 | 86 | @ <pubDate>%s(zPubDate)</pubDate> |
| 87 | 87 | @ <generator>Fossil version %s(MANIFEST_VERSION) %s(MANIFEST_DATE)</generator> |
| 88 | 88 | db_prepare(&q, zSQL); |
| 89 | 89 | while( db_step(&q)==SQLITE_ROW && nLine<=20 ){ |
| 90 | 90 | const char *zId = db_column_text(&q, 1); |
| @@ -92,13 +92,13 @@ | ||
| 92 | 92 | const char *zCom = db_column_text(&q, 3); |
| 93 | 93 | const char *zAuthor = db_column_text(&q, 4); |
| 94 | 94 | char *zPrefix = ""; |
| 95 | 95 | int nChild = db_column_int(&q, 5); |
| 96 | 96 | int nParent = db_column_int(&q, 6); |
| 97 | - | |
| 97 | + | |
| 98 | 98 | zDate = cgi_rfc822_datestamp(rss_datetime_to_time_t(zDate)); |
| 99 | - | |
| 99 | + | |
| 100 | 100 | if( nParent>1 && nChild>1 ){ |
| 101 | 101 | zPrefix = "*MERGE/FORK* "; |
| 102 | 102 | }else if( nParent>1 ){ |
| 103 | 103 | zPrefix = "*MERGE* "; |
| 104 | 104 | }else if( nChild>1 ){ |
| @@ -117,6 +117,10 @@ | ||
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | db_finalize(&q); |
| 120 | 120 | @ </channel> |
| 121 | 121 | @ </rss> |
| 122 | + | |
| 123 | + if( zFreeProjectName != 0 ){ | |
| 124 | + free( zFreeProjectName ); | |
| 125 | + } | |
| 122 | 126 | } |
| 123 | 127 |
| --- src/rss.c | |
| +++ src/rss.c | |
| @@ -7,11 +7,11 @@ | |
| 7 | ** |
| 8 | ** This program is distributed in the hope that it will be useful, |
| 9 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 | ** General Public License for more details. |
| 12 | ** |
| 13 | ** You should have received a copy of the GNU General Public |
| 14 | ** License along with this library; if not, write to the |
| 15 | ** Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 16 | ** Boston, MA 02111-1307, USA. |
| 17 | ** |
| @@ -28,18 +28,18 @@ | |
| 28 | #include <assert.h> |
| 29 | #include <time.h> |
| 30 | |
| 31 | time_t rss_datetime_to_time_t(const char *dt){ |
| 32 | struct tm the_tm; |
| 33 | |
| 34 | the_tm.tm_year = atoi(dt)-1900; |
| 35 | the_tm.tm_mon = atoi(&dt[5])-1; |
| 36 | the_tm.tm_mday = atoi(&dt[8]); |
| 37 | the_tm.tm_hour = atoi(&dt[11]); |
| 38 | the_tm.tm_min = atoi(&dt[14]); |
| 39 | the_tm.tm_sec = atoi(&dt[17]); |
| 40 | |
| 41 | return mktime(&the_tm); |
| 42 | } |
| 43 | |
| 44 | /* |
| 45 | ** WEBPAGE: timeline.rss |
| @@ -46,11 +46,11 @@ | |
| 46 | */ |
| 47 | |
| 48 | void page_timeline_rss(void){ |
| 49 | Stmt q; |
| 50 | int nLine=0; |
| 51 | char *zPubDate, *zRSSTitle, *zRSSDescr, *zFreeRSSTitle=0; |
| 52 | const char zSQL[] = |
| 53 | @ SELECT |
| 54 | @ blob.rid, |
| 55 | @ uuid, |
| 56 | @ datetime(event.mtime), |
| @@ -60,31 +60,31 @@ | |
| 60 | @ (SELECT count(*) FROM plink WHERE cid=blob.rid) |
| 61 | @ FROM event, blob |
| 62 | @ WHERE blob.rid=event.objid |
| 63 | @ ORDER BY event.mtime DESC |
| 64 | ; |
| 65 | |
| 66 | cgi_set_content_type("application/rss+xml"); |
| 67 | |
| 68 | zRSSTitle = db_get("rss-title", 0); |
| 69 | if( zRSSTitle==0 ){ |
| 70 | zFreeRSSTitle = zRSSTitle = mprintf("Fossil source repository for: %s", |
| 71 | g.zBaseURL); |
| 72 | } |
| 73 | zRSSDescr = db_get("rss-description", 0); |
| 74 | if( zRSSDescr==0 ){ |
| 75 | zRSSDescr = zRSSTitle; |
| 76 | } |
| 77 | |
| 78 | zPubDate = cgi_rfc822_datestamp(time(NULL)); |
| 79 | |
| 80 | @ <?xml version="1.0"?> |
| 81 | @ <rss version="2.0"> |
| 82 | @ <channel> |
| 83 | @ <title>%s(zRSSTitle)</title> |
| 84 | @ <link>%s(g.zBaseURL)</link> |
| 85 | @ <description>%s(zRSSDescr)</description> |
| 86 | @ <pubDate>%s(zPubDate)</pubDate> |
| 87 | @ <generator>Fossil version %s(MANIFEST_VERSION) %s(MANIFEST_DATE)</generator> |
| 88 | db_prepare(&q, zSQL); |
| 89 | while( db_step(&q)==SQLITE_ROW && nLine<=20 ){ |
| 90 | const char *zId = db_column_text(&q, 1); |
| @@ -92,13 +92,13 @@ | |
| 92 | const char *zCom = db_column_text(&q, 3); |
| 93 | const char *zAuthor = db_column_text(&q, 4); |
| 94 | char *zPrefix = ""; |
| 95 | int nChild = db_column_int(&q, 5); |
| 96 | int nParent = db_column_int(&q, 6); |
| 97 | |
| 98 | zDate = cgi_rfc822_datestamp(rss_datetime_to_time_t(zDate)); |
| 99 | |
| 100 | if( nParent>1 && nChild>1 ){ |
| 101 | zPrefix = "*MERGE/FORK* "; |
| 102 | }else if( nParent>1 ){ |
| 103 | zPrefix = "*MERGE* "; |
| 104 | }else if( nChild>1 ){ |
| @@ -117,6 +117,10 @@ | |
| 117 | } |
| 118 | |
| 119 | db_finalize(&q); |
| 120 | @ </channel> |
| 121 | @ </rss> |
| 122 | } |
| 123 |
| --- src/rss.c | |
| +++ src/rss.c | |
| @@ -7,11 +7,11 @@ | |
| 7 | ** |
| 8 | ** This program is distributed in the hope that it will be useful, |
| 9 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 | ** General Public License for more details. |
| 12 | ** |
| 13 | ** You should have received a copy of the GNU General Public |
| 14 | ** License along with this library; if not, write to the |
| 15 | ** Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 16 | ** Boston, MA 02111-1307, USA. |
| 17 | ** |
| @@ -28,18 +28,18 @@ | |
| 28 | #include <assert.h> |
| 29 | #include <time.h> |
| 30 | |
| 31 | time_t rss_datetime_to_time_t(const char *dt){ |
| 32 | struct tm the_tm; |
| 33 | |
| 34 | the_tm.tm_year = atoi(dt)-1900; |
| 35 | the_tm.tm_mon = atoi(&dt[5])-1; |
| 36 | the_tm.tm_mday = atoi(&dt[8]); |
| 37 | the_tm.tm_hour = atoi(&dt[11]); |
| 38 | the_tm.tm_min = atoi(&dt[14]); |
| 39 | the_tm.tm_sec = atoi(&dt[17]); |
| 40 | |
| 41 | return mktime(&the_tm); |
| 42 | } |
| 43 | |
| 44 | /* |
| 45 | ** WEBPAGE: timeline.rss |
| @@ -46,11 +46,11 @@ | |
| 46 | */ |
| 47 | |
| 48 | void page_timeline_rss(void){ |
| 49 | Stmt q; |
| 50 | int nLine=0; |
| 51 | char *zPubDate, *zProjectName, *zProjectDescr, *zFreeProjectName=0; |
| 52 | const char zSQL[] = |
| 53 | @ SELECT |
| 54 | @ blob.rid, |
| 55 | @ uuid, |
| 56 | @ datetime(event.mtime), |
| @@ -60,31 +60,31 @@ | |
| 60 | @ (SELECT count(*) FROM plink WHERE cid=blob.rid) |
| 61 | @ FROM event, blob |
| 62 | @ WHERE blob.rid=event.objid |
| 63 | @ ORDER BY event.mtime DESC |
| 64 | ; |
| 65 | |
| 66 | cgi_set_content_type("application/rss+xml"); |
| 67 | |
| 68 | zProjectName = db_get("project-name", 0); |
| 69 | if( zProjectName==0 ){ |
| 70 | zFreeProjectName = zProjectName = mprintf("Fossil source repository for: %s", |
| 71 | g.zBaseURL); |
| 72 | } |
| 73 | zProjectDescr = db_get("project-description", 0); |
| 74 | if( zProjectDescr==0 ){ |
| 75 | zProjectDescr = zProjectName; |
| 76 | } |
| 77 | |
| 78 | zPubDate = cgi_rfc822_datestamp(time(NULL)); |
| 79 | |
| 80 | @ <?xml version="1.0"?> |
| 81 | @ <rss version="2.0"> |
| 82 | @ <channel> |
| 83 | @ <title>%s(zProjectName)</title> |
| 84 | @ <link>%s(g.zBaseURL)</link> |
| 85 | @ <description>%s(zProjectDescr)</description> |
| 86 | @ <pubDate>%s(zPubDate)</pubDate> |
| 87 | @ <generator>Fossil version %s(MANIFEST_VERSION) %s(MANIFEST_DATE)</generator> |
| 88 | db_prepare(&q, zSQL); |
| 89 | while( db_step(&q)==SQLITE_ROW && nLine<=20 ){ |
| 90 | const char *zId = db_column_text(&q, 1); |
| @@ -92,13 +92,13 @@ | |
| 92 | const char *zCom = db_column_text(&q, 3); |
| 93 | const char *zAuthor = db_column_text(&q, 4); |
| 94 | char *zPrefix = ""; |
| 95 | int nChild = db_column_int(&q, 5); |
| 96 | int nParent = db_column_int(&q, 6); |
| 97 | |
| 98 | zDate = cgi_rfc822_datestamp(rss_datetime_to_time_t(zDate)); |
| 99 | |
| 100 | if( nParent>1 && nChild>1 ){ |
| 101 | zPrefix = "*MERGE/FORK* "; |
| 102 | }else if( nParent>1 ){ |
| 103 | zPrefix = "*MERGE* "; |
| 104 | }else if( nChild>1 ){ |
| @@ -117,6 +117,10 @@ | |
| 117 | } |
| 118 | |
| 119 | db_finalize(&q); |
| 120 | @ </channel> |
| 121 | @ </rss> |
| 122 | |
| 123 | if( zFreeProjectName != 0 ){ |
| 124 | free( zFreeProjectName ); |
| 125 | } |
| 126 | } |
| 127 |
+19
-35
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -8,11 +8,11 @@ | ||
| 8 | 8 | ** |
| 9 | 9 | ** This program is distributed in the hope that it will be useful, |
| 10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | 12 | ** General Public License for more details. |
| 13 | -** | |
| 13 | +** | |
| 14 | 14 | ** You should have received a copy of the GNU General Public |
| 15 | 15 | ** License along with this library; if not, write to the |
| 16 | 16 | ** Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 17 | 17 | ** Boston, MA 02111-1307, USA. |
| 18 | 18 | ** |
| @@ -80,11 +80,11 @@ | ||
| 80 | 80 | ** Show a list of users. Clicking on any user jumps to the edit |
| 81 | 81 | ** screen for that user. |
| 82 | 82 | */ |
| 83 | 83 | void setup_ulist(void){ |
| 84 | 84 | Stmt s; |
| 85 | - | |
| 85 | + | |
| 86 | 86 | login_check_credentials(); |
| 87 | 87 | if( !g.okSetup ){ |
| 88 | 88 | login_needed(); |
| 89 | 89 | return; |
| 90 | 90 | } |
| @@ -237,11 +237,11 @@ | ||
| 237 | 237 | zPw = P("pw"); |
| 238 | 238 | if( zPw==0 || zPw[0]==0 ){ |
| 239 | 239 | zPw = db_text(0, "SELECT pw FROM user WHERE uid=%d", uid); |
| 240 | 240 | } |
| 241 | 241 | zLogin = P("login"); |
| 242 | - if( uid>0 && | |
| 242 | + if( uid>0 && | |
| 243 | 243 | db_exists("SELECT 1 FROM user WHERE login=%Q AND uid!=%d", zLogin, uid) |
| 244 | 244 | ){ |
| 245 | 245 | style_header("User Creation Error"); |
| 246 | 246 | @ <font color="red">Login "%h(zLogin)" is already used by a different |
| 247 | 247 | @ user.</font> |
| @@ -367,11 +367,11 @@ | ||
| 367 | 367 | @ users. This capability is intended for deletion of spam. |
| 368 | 368 | @ </p></li> |
| 369 | 369 | @ |
| 370 | 370 | @ <li><p> |
| 371 | 371 | @ The <b>Query</b> privilege allows the user to create or edit |
| 372 | - @ report formats by specifying appropriate SQL. Users can run | |
| 372 | + @ report formats by specifying appropriate SQL. Users can run | |
| 373 | 373 | @ existing reports without the Query privilege. |
| 374 | 374 | @ </p></li> |
| 375 | 375 | @ |
| 376 | 376 | @ <li><p> |
| 377 | 377 | @ An <b>Admin</b> user can add other users, create new ticket report |
| @@ -512,15 +512,15 @@ | ||
| 512 | 512 | @ <hr> |
| 513 | 513 | entry_attribute("Login expiration time", 6, "cookie-expire", "cex", "8766"); |
| 514 | 514 | @ <p>The number of hours for which a login is valid. This must be a |
| 515 | 515 | @ positive number. The default is 8760 hours which is approximately equal |
| 516 | 516 | @ to a year.</p> |
| 517 | - | |
| 517 | + | |
| 518 | 518 | @ <hr> |
| 519 | 519 | onoff_attribute("Allow anonymous signup", "anon-signup", "asu", 0); |
| 520 | 520 | @ <p>Allow users to create their own accounts</p> |
| 521 | - | |
| 521 | + | |
| 522 | 522 | @ <hr> |
| 523 | 523 | @ <p><input type="submit" name="submit" value="Apply Changes"></p> |
| 524 | 524 | @ </form> |
| 525 | 525 | db_end_transaction(0); |
| 526 | 526 | style_footer(); |
| @@ -537,39 +537,23 @@ | ||
| 537 | 537 | |
| 538 | 538 | style_header("WWW Configuration"); |
| 539 | 539 | db_begin_transaction(); |
| 540 | 540 | @ <form action="%s(g.zBaseURL)/setup_config" method="POST"> |
| 541 | 541 | |
| 542 | - @ <hr> | |
| 543 | - entry_attribute("Home page", 60, "homepage", "hp", ""); | |
| 544 | - @ <p>The name of a wiki file that is the homepage for the website. | |
| 545 | - @ The home page is the page that is displayed by the "Home" link | |
| 546 | - @ at the top of this screen. Omit the path and the ".wiki" | |
| 547 | - @ suffix. </p> | |
| 548 | - | |
| 549 | - entry_attribute("Ticket subdirectory", 60, "ticket-subdir", "tsd", ""); | |
| 550 | - @ <p>A subdirectory in the file hierarchy that contains all trouble | |
| 551 | - @ tickets. Leave this blank to disable ticketing. Tickets text | |
| 552 | - @ files within this subdirectory containing a particular format | |
| 553 | - @ (documented separately) and with the ".tkt" suffix.</p> | |
| 554 | - | |
| 555 | - entry_attribute("Wiki subdirectory", 60, "wiki-subdir", "wsd", ""); | |
| 556 | - @ <p>A subdirectory in the file hierarchy that contains wiki pages. | |
| 557 | - @ Leave this blank to disable wiki. Wiki pages are | |
| 558 | - @ files within this subdirectory whose name is he wiki page title | |
| 559 | - @ and with the suffix ".wiki".</p> | |
| 560 | - | |
| 561 | - entry_attribute("RSS Feed Title", 60, "rss-title", "rst", ""); | |
| 562 | - @ <p>The title of the RSS feed that publishes the changes to the | |
| 563 | - @ repository. If left blank, the system will generate a generic | |
| 564 | - @ title that, unfortunantly, not very helpful.</p> | |
| 565 | - | |
| 566 | - textarea_attribute("RSS Feed Description", 5, 60, "rss-description", "rsd", ""); | |
| 567 | - @ <p>The description of the RSS feed that publishes the changes to | |
| 568 | - @ the repository. If left blank, the system will use the RSS Feed Title. | |
| 569 | - | |
| 570 | - @ <hr> | |
| 542 | + @ <hr /> | |
| 543 | + | |
| 544 | + entry_attribute("Project Name", 60, "project-name", "pn", ""); | |
| 545 | + @ <p>Give your project a name so visitors know what this site is about. | |
| 546 | + @ The project name will also be used as the RSS feed title.</p> | |
| 547 | + | |
| 548 | + @ <hr /> | |
| 549 | + | |
| 550 | + textarea_attribute("Project Description", 5, 60, "project-description", "pd", ""); | |
| 551 | + @ <p>Describe your project. This will be used in page headers for search | |
| 552 | + @ engines as well as a short RSS description.</p> | |
| 553 | + | |
| 554 | + @ <hr /> | |
| 571 | 555 | @ <p><input type="submit" name="submit" value="Apply Changes"></p> |
| 572 | 556 | @ </form> |
| 573 | 557 | db_end_transaction(0); |
| 574 | 558 | style_footer(); |
| 575 | 559 | } |
| 576 | 560 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -8,11 +8,11 @@ | |
| 8 | ** |
| 9 | ** This program is distributed in the hope that it will be useful, |
| 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | ** General Public License for more details. |
| 13 | ** |
| 14 | ** You should have received a copy of the GNU General Public |
| 15 | ** License along with this library; if not, write to the |
| 16 | ** Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 17 | ** Boston, MA 02111-1307, USA. |
| 18 | ** |
| @@ -80,11 +80,11 @@ | |
| 80 | ** Show a list of users. Clicking on any user jumps to the edit |
| 81 | ** screen for that user. |
| 82 | */ |
| 83 | void setup_ulist(void){ |
| 84 | Stmt s; |
| 85 | |
| 86 | login_check_credentials(); |
| 87 | if( !g.okSetup ){ |
| 88 | login_needed(); |
| 89 | return; |
| 90 | } |
| @@ -237,11 +237,11 @@ | |
| 237 | zPw = P("pw"); |
| 238 | if( zPw==0 || zPw[0]==0 ){ |
| 239 | zPw = db_text(0, "SELECT pw FROM user WHERE uid=%d", uid); |
| 240 | } |
| 241 | zLogin = P("login"); |
| 242 | if( uid>0 && |
| 243 | db_exists("SELECT 1 FROM user WHERE login=%Q AND uid!=%d", zLogin, uid) |
| 244 | ){ |
| 245 | style_header("User Creation Error"); |
| 246 | @ <font color="red">Login "%h(zLogin)" is already used by a different |
| 247 | @ user.</font> |
| @@ -367,11 +367,11 @@ | |
| 367 | @ users. This capability is intended for deletion of spam. |
| 368 | @ </p></li> |
| 369 | @ |
| 370 | @ <li><p> |
| 371 | @ The <b>Query</b> privilege allows the user to create or edit |
| 372 | @ report formats by specifying appropriate SQL. Users can run |
| 373 | @ existing reports without the Query privilege. |
| 374 | @ </p></li> |
| 375 | @ |
| 376 | @ <li><p> |
| 377 | @ An <b>Admin</b> user can add other users, create new ticket report |
| @@ -512,15 +512,15 @@ | |
| 512 | @ <hr> |
| 513 | entry_attribute("Login expiration time", 6, "cookie-expire", "cex", "8766"); |
| 514 | @ <p>The number of hours for which a login is valid. This must be a |
| 515 | @ positive number. The default is 8760 hours which is approximately equal |
| 516 | @ to a year.</p> |
| 517 | |
| 518 | @ <hr> |
| 519 | onoff_attribute("Allow anonymous signup", "anon-signup", "asu", 0); |
| 520 | @ <p>Allow users to create their own accounts</p> |
| 521 | |
| 522 | @ <hr> |
| 523 | @ <p><input type="submit" name="submit" value="Apply Changes"></p> |
| 524 | @ </form> |
| 525 | db_end_transaction(0); |
| 526 | style_footer(); |
| @@ -537,39 +537,23 @@ | |
| 537 | |
| 538 | style_header("WWW Configuration"); |
| 539 | db_begin_transaction(); |
| 540 | @ <form action="%s(g.zBaseURL)/setup_config" method="POST"> |
| 541 | |
| 542 | @ <hr> |
| 543 | entry_attribute("Home page", 60, "homepage", "hp", ""); |
| 544 | @ <p>The name of a wiki file that is the homepage for the website. |
| 545 | @ The home page is the page that is displayed by the "Home" link |
| 546 | @ at the top of this screen. Omit the path and the ".wiki" |
| 547 | @ suffix. </p> |
| 548 | |
| 549 | entry_attribute("Ticket subdirectory", 60, "ticket-subdir", "tsd", ""); |
| 550 | @ <p>A subdirectory in the file hierarchy that contains all trouble |
| 551 | @ tickets. Leave this blank to disable ticketing. Tickets text |
| 552 | @ files within this subdirectory containing a particular format |
| 553 | @ (documented separately) and with the ".tkt" suffix.</p> |
| 554 | |
| 555 | entry_attribute("Wiki subdirectory", 60, "wiki-subdir", "wsd", ""); |
| 556 | @ <p>A subdirectory in the file hierarchy that contains wiki pages. |
| 557 | @ Leave this blank to disable wiki. Wiki pages are |
| 558 | @ files within this subdirectory whose name is he wiki page title |
| 559 | @ and with the suffix ".wiki".</p> |
| 560 | |
| 561 | entry_attribute("RSS Feed Title", 60, "rss-title", "rst", ""); |
| 562 | @ <p>The title of the RSS feed that publishes the changes to the |
| 563 | @ repository. If left blank, the system will generate a generic |
| 564 | @ title that, unfortunantly, not very helpful.</p> |
| 565 | |
| 566 | textarea_attribute("RSS Feed Description", 5, 60, "rss-description", "rsd", ""); |
| 567 | @ <p>The description of the RSS feed that publishes the changes to |
| 568 | @ the repository. If left blank, the system will use the RSS Feed Title. |
| 569 | |
| 570 | @ <hr> |
| 571 | @ <p><input type="submit" name="submit" value="Apply Changes"></p> |
| 572 | @ </form> |
| 573 | db_end_transaction(0); |
| 574 | style_footer(); |
| 575 | } |
| 576 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -8,11 +8,11 @@ | |
| 8 | ** |
| 9 | ** This program is distributed in the hope that it will be useful, |
| 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | ** General Public License for more details. |
| 13 | ** |
| 14 | ** You should have received a copy of the GNU General Public |
| 15 | ** License along with this library; if not, write to the |
| 16 | ** Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 17 | ** Boston, MA 02111-1307, USA. |
| 18 | ** |
| @@ -80,11 +80,11 @@ | |
| 80 | ** Show a list of users. Clicking on any user jumps to the edit |
| 81 | ** screen for that user. |
| 82 | */ |
| 83 | void setup_ulist(void){ |
| 84 | Stmt s; |
| 85 | |
| 86 | login_check_credentials(); |
| 87 | if( !g.okSetup ){ |
| 88 | login_needed(); |
| 89 | return; |
| 90 | } |
| @@ -237,11 +237,11 @@ | |
| 237 | zPw = P("pw"); |
| 238 | if( zPw==0 || zPw[0]==0 ){ |
| 239 | zPw = db_text(0, "SELECT pw FROM user WHERE uid=%d", uid); |
| 240 | } |
| 241 | zLogin = P("login"); |
| 242 | if( uid>0 && |
| 243 | db_exists("SELECT 1 FROM user WHERE login=%Q AND uid!=%d", zLogin, uid) |
| 244 | ){ |
| 245 | style_header("User Creation Error"); |
| 246 | @ <font color="red">Login "%h(zLogin)" is already used by a different |
| 247 | @ user.</font> |
| @@ -367,11 +367,11 @@ | |
| 367 | @ users. This capability is intended for deletion of spam. |
| 368 | @ </p></li> |
| 369 | @ |
| 370 | @ <li><p> |
| 371 | @ The <b>Query</b> privilege allows the user to create or edit |
| 372 | @ report formats by specifying appropriate SQL. Users can run |
| 373 | @ existing reports without the Query privilege. |
| 374 | @ </p></li> |
| 375 | @ |
| 376 | @ <li><p> |
| 377 | @ An <b>Admin</b> user can add other users, create new ticket report |
| @@ -512,15 +512,15 @@ | |
| 512 | @ <hr> |
| 513 | entry_attribute("Login expiration time", 6, "cookie-expire", "cex", "8766"); |
| 514 | @ <p>The number of hours for which a login is valid. This must be a |
| 515 | @ positive number. The default is 8760 hours which is approximately equal |
| 516 | @ to a year.</p> |
| 517 | |
| 518 | @ <hr> |
| 519 | onoff_attribute("Allow anonymous signup", "anon-signup", "asu", 0); |
| 520 | @ <p>Allow users to create their own accounts</p> |
| 521 | |
| 522 | @ <hr> |
| 523 | @ <p><input type="submit" name="submit" value="Apply Changes"></p> |
| 524 | @ </form> |
| 525 | db_end_transaction(0); |
| 526 | style_footer(); |
| @@ -537,39 +537,23 @@ | |
| 537 | |
| 538 | style_header("WWW Configuration"); |
| 539 | db_begin_transaction(); |
| 540 | @ <form action="%s(g.zBaseURL)/setup_config" method="POST"> |
| 541 | |
| 542 | @ <hr /> |
| 543 | |
| 544 | entry_attribute("Project Name", 60, "project-name", "pn", ""); |
| 545 | @ <p>Give your project a name so visitors know what this site is about. |
| 546 | @ The project name will also be used as the RSS feed title.</p> |
| 547 | |
| 548 | @ <hr /> |
| 549 | |
| 550 | textarea_attribute("Project Description", 5, 60, "project-description", "pd", ""); |
| 551 | @ <p>Describe your project. This will be used in page headers for search |
| 552 | @ engines as well as a short RSS description.</p> |
| 553 | |
| 554 | @ <hr /> |
| 555 | @ <p><input type="submit" name="submit" value="Apply Changes"></p> |
| 556 | @ </form> |
| 557 | db_end_transaction(0); |
| 558 | style_footer(); |
| 559 | } |
| 560 |
+13
-12
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -7,11 +7,11 @@ | ||
| 7 | 7 | ** |
| 8 | 8 | ** This program is distributed in the hope that it will be useful, |
| 9 | 9 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | 10 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 | 11 | ** General Public License for more details. |
| 12 | -** | |
| 12 | +** | |
| 13 | 13 | ** You should have received a copy of the GNU General Public |
| 14 | 14 | ** License along with this library; if not, write to the |
| 15 | 15 | ** Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 16 | 16 | ** Boston, MA 02111-1307, USA. |
| 17 | 17 | ** |
| @@ -69,16 +69,20 @@ | ||
| 69 | 69 | /* |
| 70 | 70 | ** Draw the header. |
| 71 | 71 | */ |
| 72 | 72 | void style_header(const char *zTitle){ |
| 73 | 73 | const char *zLogInOut = "Logout"; |
| 74 | + char *zProjectDescr = db_get("project-description", 0); | |
| 74 | 75 | login_check_credentials(); |
| 75 | 76 | @ <html> |
| 76 | 77 | @ <head> |
| 77 | 78 | @ <title>%s(zTitle)</title> |
| 78 | 79 | @ <link rel="alternate" type="application/rss+xml" title="RSS Feed" href="%s(g.zBaseURL)/timeline.rss"> |
| 79 | 80 | @ <link rel="stylesheet" href="%s(g.zBaseURL)/style.css" type="text/css" media="screen"> |
| 81 | + if( zProjectDescr != 0 ){ | |
| 82 | + @ <meta name="description" content="%s(zProjectDescr)"> | |
| 83 | + } | |
| 80 | 84 | @ </head> |
| 81 | 85 | @ <body> |
| 82 | 86 | @ <div id="page-title">%s(zTitle)</div> |
| 83 | 87 | @ <div id="login-status"> |
| 84 | 88 | if( g.zLogin==0 ){ |
| @@ -92,13 +96,10 @@ | ||
| 92 | 96 | @ <a href="%s(g.zBaseURL)/index">Home</a> |
| 93 | 97 | if( g.okRead ){ |
| 94 | 98 | @ | <a href="%s(g.zBaseURL)/leaves">Leaves</a> |
| 95 | 99 | @ | <a href="%s(g.zBaseURL)/timeline">Timeline</a> |
| 96 | 100 | } |
| 97 | - if( g.okRdWiki ){ | |
| 98 | - @ | <a href="%s(g.zBaseURL)/wiki">Wiki</a> | |
| 99 | - } | |
| 100 | 101 | #if 0 |
| 101 | 102 | @ | <font color="#888888">Search</font> |
| 102 | 103 | @ | <font color="#888888">Ticket</font> |
| 103 | 104 | @ | <font color="#888888">Reports</font> |
| 104 | 105 | #endif |
| @@ -145,11 +146,11 @@ | ||
| 145 | 146 | ** WEBPAGE: index |
| 146 | 147 | ** WEBPAGE: home |
| 147 | 148 | ** WEBPAGE: not_found |
| 148 | 149 | */ |
| 149 | 150 | void page_index(void){ |
| 150 | - char *zHome = (char*)db_get("homepage", 0); | |
| 151 | + char *zHome = "Home"; | |
| 151 | 152 | if( zHome ){ |
| 152 | 153 | g.zExtra = zHome; |
| 153 | 154 | g.okRdWiki = 1; |
| 154 | 155 | wiki_page(); |
| 155 | 156 | }else{ |
| @@ -165,16 +166,16 @@ | ||
| 165 | 166 | /* |
| 166 | 167 | ** Create a fake replicate of the "vfile" table as a TEMP table |
| 167 | 168 | ** using the manifest identified by manid. |
| 168 | 169 | */ |
| 169 | 170 | static void style_create_fake_vfile(int manid){ |
| 170 | - static const char zVfileDef[] = | |
| 171 | + static const char zVfileDef[] = | |
| 171 | 172 | @ CREATE TEMP TABLE vfile( |
| 172 | 173 | @ id INTEGER PRIMARY KEY, -- ID of the checked out file |
| 173 | 174 | @ vid INTEGER REFERENCES blob, -- The version this file is part of. |
| 174 | 175 | @ chnged INT DEFAULT 0, -- 0:unchnged 1:edited 2:m-chng 3:m-add |
| 175 | - @ deleted BOOLEAN DEFAULT 0, -- True if deleted | |
| 176 | + @ deleted BOOLEAN DEFAULT 0, -- True if deleted | |
| 176 | 177 | @ rid INTEGER, -- Originally from this repository record |
| 177 | 178 | @ mrid INTEGER, -- Based on this record due to a merge |
| 178 | 179 | @ pathname TEXT, -- Full pathname |
| 179 | 180 | @ UNIQUE(pathname,vid) |
| 180 | 181 | @ ); |
| @@ -192,21 +193,21 @@ | ||
| 192 | 193 | int id = 0; |
| 193 | 194 | int rid = 0; |
| 194 | 195 | int chnged = 0; |
| 195 | 196 | char *zPathname = 0; |
| 196 | 197 | char *z; |
| 197 | - | |
| 198 | + | |
| 198 | 199 | cgi_set_content_type("text/css"); |
| 199 | 200 | |
| 200 | 201 | login_check_credentials(); |
| 201 | 202 | if( !g.localOpen ){ |
| 202 | 203 | int headid = db_int(0, |
| 203 | 204 | "SELECT cid FROM plink ORDER BY mtime DESC LIMIT 1" |
| 204 | 205 | ); |
| 205 | 206 | style_create_fake_vfile(headid); |
| 206 | 207 | } |
| 207 | - | |
| 208 | + | |
| 208 | 209 | db_prepare(&q, |
| 209 | 210 | "SELECT id, rid, chnged, pathname FROM vfile" |
| 210 | 211 | " WHERE (pathname='style.css' OR pathname LIKE '%%/style.css')" |
| 211 | 212 | " AND NOT deleted" |
| 212 | 213 | ); |
| @@ -234,11 +235,11 @@ | ||
| 234 | 235 | @ %s(z) |
| 235 | 236 | }else{ |
| 236 | 237 | /* No CSS file found, use our own */ |
| 237 | 238 | /* |
| 238 | 239 | ** Selector order: tags, ids, classes, other |
| 239 | - ** Content order: margin, borders, padding, fonts, colors, other | |
| 240 | + ** Content order: margin, borders, padding, fonts, colors, other | |
| 240 | 241 | ** Note: Once things are finialize a bit we can collapse this and |
| 241 | 242 | ** make it much smaller, if necessary. Right now, it's verbose |
| 242 | 243 | ** but easy to edit. |
| 243 | 244 | */ |
| 244 | 245 | @ body { |
| @@ -288,12 +289,12 @@ | ||
| 288 | 289 | @ background-color: white; |
| 289 | 290 | @ } |
| 290 | 291 | @ #page { |
| 291 | 292 | @ padding: 10px 20px 10px 20px; |
| 292 | 293 | @ } |
| 293 | - @ #style-footer { | |
| 294 | - @ font-size: 0.8em; | |
| 294 | + @ #style-footer { | |
| 295 | + @ font-size: 0.8em; | |
| 295 | 296 | @ margin-top: 12px; |
| 296 | 297 | @ padding: 5px 10px 5px 10px; |
| 297 | 298 | @ text-align: right; |
| 298 | 299 | @ background-color: #414f84; |
| 299 | 300 | @ color: white; |
| 300 | 301 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -7,11 +7,11 @@ | |
| 7 | ** |
| 8 | ** This program is distributed in the hope that it will be useful, |
| 9 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 | ** General Public License for more details. |
| 12 | ** |
| 13 | ** You should have received a copy of the GNU General Public |
| 14 | ** License along with this library; if not, write to the |
| 15 | ** Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 16 | ** Boston, MA 02111-1307, USA. |
| 17 | ** |
| @@ -69,16 +69,20 @@ | |
| 69 | /* |
| 70 | ** Draw the header. |
| 71 | */ |
| 72 | void style_header(const char *zTitle){ |
| 73 | const char *zLogInOut = "Logout"; |
| 74 | login_check_credentials(); |
| 75 | @ <html> |
| 76 | @ <head> |
| 77 | @ <title>%s(zTitle)</title> |
| 78 | @ <link rel="alternate" type="application/rss+xml" title="RSS Feed" href="%s(g.zBaseURL)/timeline.rss"> |
| 79 | @ <link rel="stylesheet" href="%s(g.zBaseURL)/style.css" type="text/css" media="screen"> |
| 80 | @ </head> |
| 81 | @ <body> |
| 82 | @ <div id="page-title">%s(zTitle)</div> |
| 83 | @ <div id="login-status"> |
| 84 | if( g.zLogin==0 ){ |
| @@ -92,13 +96,10 @@ | |
| 92 | @ <a href="%s(g.zBaseURL)/index">Home</a> |
| 93 | if( g.okRead ){ |
| 94 | @ | <a href="%s(g.zBaseURL)/leaves">Leaves</a> |
| 95 | @ | <a href="%s(g.zBaseURL)/timeline">Timeline</a> |
| 96 | } |
| 97 | if( g.okRdWiki ){ |
| 98 | @ | <a href="%s(g.zBaseURL)/wiki">Wiki</a> |
| 99 | } |
| 100 | #if 0 |
| 101 | @ | <font color="#888888">Search</font> |
| 102 | @ | <font color="#888888">Ticket</font> |
| 103 | @ | <font color="#888888">Reports</font> |
| 104 | #endif |
| @@ -145,11 +146,11 @@ | |
| 145 | ** WEBPAGE: index |
| 146 | ** WEBPAGE: home |
| 147 | ** WEBPAGE: not_found |
| 148 | */ |
| 149 | void page_index(void){ |
| 150 | char *zHome = (char*)db_get("homepage", 0); |
| 151 | if( zHome ){ |
| 152 | g.zExtra = zHome; |
| 153 | g.okRdWiki = 1; |
| 154 | wiki_page(); |
| 155 | }else{ |
| @@ -165,16 +166,16 @@ | |
| 165 | /* |
| 166 | ** Create a fake replicate of the "vfile" table as a TEMP table |
| 167 | ** using the manifest identified by manid. |
| 168 | */ |
| 169 | static void style_create_fake_vfile(int manid){ |
| 170 | static const char zVfileDef[] = |
| 171 | @ CREATE TEMP TABLE vfile( |
| 172 | @ id INTEGER PRIMARY KEY, -- ID of the checked out file |
| 173 | @ vid INTEGER REFERENCES blob, -- The version this file is part of. |
| 174 | @ chnged INT DEFAULT 0, -- 0:unchnged 1:edited 2:m-chng 3:m-add |
| 175 | @ deleted BOOLEAN DEFAULT 0, -- True if deleted |
| 176 | @ rid INTEGER, -- Originally from this repository record |
| 177 | @ mrid INTEGER, -- Based on this record due to a merge |
| 178 | @ pathname TEXT, -- Full pathname |
| 179 | @ UNIQUE(pathname,vid) |
| 180 | @ ); |
| @@ -192,21 +193,21 @@ | |
| 192 | int id = 0; |
| 193 | int rid = 0; |
| 194 | int chnged = 0; |
| 195 | char *zPathname = 0; |
| 196 | char *z; |
| 197 | |
| 198 | cgi_set_content_type("text/css"); |
| 199 | |
| 200 | login_check_credentials(); |
| 201 | if( !g.localOpen ){ |
| 202 | int headid = db_int(0, |
| 203 | "SELECT cid FROM plink ORDER BY mtime DESC LIMIT 1" |
| 204 | ); |
| 205 | style_create_fake_vfile(headid); |
| 206 | } |
| 207 | |
| 208 | db_prepare(&q, |
| 209 | "SELECT id, rid, chnged, pathname FROM vfile" |
| 210 | " WHERE (pathname='style.css' OR pathname LIKE '%%/style.css')" |
| 211 | " AND NOT deleted" |
| 212 | ); |
| @@ -234,11 +235,11 @@ | |
| 234 | @ %s(z) |
| 235 | }else{ |
| 236 | /* No CSS file found, use our own */ |
| 237 | /* |
| 238 | ** Selector order: tags, ids, classes, other |
| 239 | ** Content order: margin, borders, padding, fonts, colors, other |
| 240 | ** Note: Once things are finialize a bit we can collapse this and |
| 241 | ** make it much smaller, if necessary. Right now, it's verbose |
| 242 | ** but easy to edit. |
| 243 | */ |
| 244 | @ body { |
| @@ -288,12 +289,12 @@ | |
| 288 | @ background-color: white; |
| 289 | @ } |
| 290 | @ #page { |
| 291 | @ padding: 10px 20px 10px 20px; |
| 292 | @ } |
| 293 | @ #style-footer { |
| 294 | @ font-size: 0.8em; |
| 295 | @ margin-top: 12px; |
| 296 | @ padding: 5px 10px 5px 10px; |
| 297 | @ text-align: right; |
| 298 | @ background-color: #414f84; |
| 299 | @ color: white; |
| 300 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -7,11 +7,11 @@ | |
| 7 | ** |
| 8 | ** This program is distributed in the hope that it will be useful, |
| 9 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 | ** General Public License for more details. |
| 12 | ** |
| 13 | ** You should have received a copy of the GNU General Public |
| 14 | ** License along with this library; if not, write to the |
| 15 | ** Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 16 | ** Boston, MA 02111-1307, USA. |
| 17 | ** |
| @@ -69,16 +69,20 @@ | |
| 69 | /* |
| 70 | ** Draw the header. |
| 71 | */ |
| 72 | void style_header(const char *zTitle){ |
| 73 | const char *zLogInOut = "Logout"; |
| 74 | char *zProjectDescr = db_get("project-description", 0); |
| 75 | login_check_credentials(); |
| 76 | @ <html> |
| 77 | @ <head> |
| 78 | @ <title>%s(zTitle)</title> |
| 79 | @ <link rel="alternate" type="application/rss+xml" title="RSS Feed" href="%s(g.zBaseURL)/timeline.rss"> |
| 80 | @ <link rel="stylesheet" href="%s(g.zBaseURL)/style.css" type="text/css" media="screen"> |
| 81 | if( zProjectDescr != 0 ){ |
| 82 | @ <meta name="description" content="%s(zProjectDescr)"> |
| 83 | } |
| 84 | @ </head> |
| 85 | @ <body> |
| 86 | @ <div id="page-title">%s(zTitle)</div> |
| 87 | @ <div id="login-status"> |
| 88 | if( g.zLogin==0 ){ |
| @@ -92,13 +96,10 @@ | |
| 96 | @ <a href="%s(g.zBaseURL)/index">Home</a> |
| 97 | if( g.okRead ){ |
| 98 | @ | <a href="%s(g.zBaseURL)/leaves">Leaves</a> |
| 99 | @ | <a href="%s(g.zBaseURL)/timeline">Timeline</a> |
| 100 | } |
| 101 | #if 0 |
| 102 | @ | <font color="#888888">Search</font> |
| 103 | @ | <font color="#888888">Ticket</font> |
| 104 | @ | <font color="#888888">Reports</font> |
| 105 | #endif |
| @@ -145,11 +146,11 @@ | |
| 146 | ** WEBPAGE: index |
| 147 | ** WEBPAGE: home |
| 148 | ** WEBPAGE: not_found |
| 149 | */ |
| 150 | void page_index(void){ |
| 151 | char *zHome = "Home"; |
| 152 | if( zHome ){ |
| 153 | g.zExtra = zHome; |
| 154 | g.okRdWiki = 1; |
| 155 | wiki_page(); |
| 156 | }else{ |
| @@ -165,16 +166,16 @@ | |
| 166 | /* |
| 167 | ** Create a fake replicate of the "vfile" table as a TEMP table |
| 168 | ** using the manifest identified by manid. |
| 169 | */ |
| 170 | static void style_create_fake_vfile(int manid){ |
| 171 | static const char zVfileDef[] = |
| 172 | @ CREATE TEMP TABLE vfile( |
| 173 | @ id INTEGER PRIMARY KEY, -- ID of the checked out file |
| 174 | @ vid INTEGER REFERENCES blob, -- The version this file is part of. |
| 175 | @ chnged INT DEFAULT 0, -- 0:unchnged 1:edited 2:m-chng 3:m-add |
| 176 | @ deleted BOOLEAN DEFAULT 0, -- True if deleted |
| 177 | @ rid INTEGER, -- Originally from this repository record |
| 178 | @ mrid INTEGER, -- Based on this record due to a merge |
| 179 | @ pathname TEXT, -- Full pathname |
| 180 | @ UNIQUE(pathname,vid) |
| 181 | @ ); |
| @@ -192,21 +193,21 @@ | |
| 193 | int id = 0; |
| 194 | int rid = 0; |
| 195 | int chnged = 0; |
| 196 | char *zPathname = 0; |
| 197 | char *z; |
| 198 | |
| 199 | cgi_set_content_type("text/css"); |
| 200 | |
| 201 | login_check_credentials(); |
| 202 | if( !g.localOpen ){ |
| 203 | int headid = db_int(0, |
| 204 | "SELECT cid FROM plink ORDER BY mtime DESC LIMIT 1" |
| 205 | ); |
| 206 | style_create_fake_vfile(headid); |
| 207 | } |
| 208 | |
| 209 | db_prepare(&q, |
| 210 | "SELECT id, rid, chnged, pathname FROM vfile" |
| 211 | " WHERE (pathname='style.css' OR pathname LIKE '%%/style.css')" |
| 212 | " AND NOT deleted" |
| 213 | ); |
| @@ -234,11 +235,11 @@ | |
| 235 | @ %s(z) |
| 236 | }else{ |
| 237 | /* No CSS file found, use our own */ |
| 238 | /* |
| 239 | ** Selector order: tags, ids, classes, other |
| 240 | ** Content order: margin, borders, padding, fonts, colors, other |
| 241 | ** Note: Once things are finialize a bit we can collapse this and |
| 242 | ** make it much smaller, if necessary. Right now, it's verbose |
| 243 | ** but easy to edit. |
| 244 | */ |
| 245 | @ body { |
| @@ -288,12 +289,12 @@ | |
| 289 | @ background-color: white; |
| 290 | @ } |
| 291 | @ #page { |
| 292 | @ padding: 10px 20px 10px 20px; |
| 293 | @ } |
| 294 | @ #style-footer { |
| 295 | @ font-size: 0.8em; |
| 296 | @ margin-top: 12px; |
| 297 | @ padding: 5px 10px 5px 10px; |
| 298 | @ text-align: right; |
| 299 | @ background-color: #414f84; |
| 300 | @ color: white; |
| 301 |
+2
-2
| --- src/user.c | ||
| +++ src/user.c | ||
| @@ -7,11 +7,11 @@ | ||
| 7 | 7 | ** |
| 8 | 8 | ** This program is distributed in the hope that it will be useful, |
| 9 | 9 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | 10 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 | 11 | ** General Public License for more details. |
| 12 | -** | |
| 12 | +** | |
| 13 | 13 | ** You should have received a copy of the GNU General Public |
| 14 | 14 | ** License along with this library; if not, write to the |
| 15 | 15 | ** Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 16 | 16 | ** Boston, MA 02111-1307, USA. |
| 17 | 17 | ** |
| @@ -52,11 +52,11 @@ | ||
| 52 | 52 | ** getpass for Windows |
| 53 | 53 | */ |
| 54 | 54 | static char *getpass(const char *prompt){ |
| 55 | 55 | static char pwd[64]; |
| 56 | 56 | size_t i; |
| 57 | - | |
| 57 | + | |
| 58 | 58 | fputs(prompt,stderr); |
| 59 | 59 | fflush(stderr); |
| 60 | 60 | for(i=0; i<sizeof(pwd)-1; ++i){ |
| 61 | 61 | pwd[i] = _getch(); |
| 62 | 62 | if(pwd[i]=='\r' || pwd[i]=='\n'){ |
| 63 | 63 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -7,11 +7,11 @@ | |
| 7 | ** |
| 8 | ** This program is distributed in the hope that it will be useful, |
| 9 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 | ** General Public License for more details. |
| 12 | ** |
| 13 | ** You should have received a copy of the GNU General Public |
| 14 | ** License along with this library; if not, write to the |
| 15 | ** Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 16 | ** Boston, MA 02111-1307, USA. |
| 17 | ** |
| @@ -52,11 +52,11 @@ | |
| 52 | ** getpass for Windows |
| 53 | */ |
| 54 | static char *getpass(const char *prompt){ |
| 55 | static char pwd[64]; |
| 56 | size_t i; |
| 57 | |
| 58 | fputs(prompt,stderr); |
| 59 | fflush(stderr); |
| 60 | for(i=0; i<sizeof(pwd)-1; ++i){ |
| 61 | pwd[i] = _getch(); |
| 62 | if(pwd[i]=='\r' || pwd[i]=='\n'){ |
| 63 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -7,11 +7,11 @@ | |
| 7 | ** |
| 8 | ** This program is distributed in the hope that it will be useful, |
| 9 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 | ** General Public License for more details. |
| 12 | ** |
| 13 | ** You should have received a copy of the GNU General Public |
| 14 | ** License along with this library; if not, write to the |
| 15 | ** Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 16 | ** Boston, MA 02111-1307, USA. |
| 17 | ** |
| @@ -52,11 +52,11 @@ | |
| 52 | ** getpass for Windows |
| 53 | */ |
| 54 | static char *getpass(const char *prompt){ |
| 55 | static char pwd[64]; |
| 56 | size_t i; |
| 57 | |
| 58 | fputs(prompt,stderr); |
| 59 | fflush(stderr); |
| 60 | for(i=0; i<sizeof(pwd)-1; ++i){ |
| 61 | pwd[i] = _getch(); |
| 62 | if(pwd[i]=='\r' || pwd[i]=='\n'){ |
| 63 |