Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Changes anchor tags (<a>) so that the href= attribute can be set by javascript rather than by HTML. This is to make it harder for spiders to follow the hyperlinks to every diff and annotation in the project history. It all seems to work, but it needs further testing and review before going live. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | spider-defense |
| Files: | files | file ages | folders |
| SHA1: |
8ae52fc4183f3100ce47ca69f1545e34 |
| User & Date: | drh 2012-04-28 07:15:25.219 |
| Original Comment: | Changes anchor tags (<a>) so that the href= attribute can be set by javascript rather than by HTML. This is to make it harder for spiders to follow the hyperlinks to every diff and annotation in the project history. It all seems to work, but it needs further testing and review before going live. |
Context
|
2012-04-28
| ||
| 08:03 | Refinements to the new hyperlink logic and spider defense. ... (Closed-Leaf check-in: d9c8a7dd73 user: drh tags: spider-defense) | |
| 07:15 | Changes anchor tags (<a>) so that the href= attribute can be set by javascript rather than by HTML. This is to make it harder for spiders to follow the hyperlinks to every diff and annotation in the project history. It all seems to work, but it needs further testing and review before going live. ... (check-in: 8ae52fc418 user: drh tags: spider-defense) | |
| 03:32 | Enhance the "translate" utility so that formatting characters can occur in between the "%" and "C" of a printf-style conversion on @-lines. ... (check-in: f9711803e2 user: drh tags: trunk) | |
Changes
Changes to src/branch.c.
| ︙ | ︙ | |||
319 320 321 322 323 324 325 |
style_submenu_element("Color-Test", "Color-Test", "brlist?colortest");
}else{
style_submenu_element("All", "All", "brlist?all");
}
login_anonymous_available();
style_sidebox_begin("Nomenclature:", "33%");
@ <ol>
| | | | | | 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 |
style_submenu_element("Color-Test", "Color-Test", "brlist?colortest");
}else{
style_submenu_element("All", "All", "brlist?all");
}
login_anonymous_available();
style_sidebox_begin("Nomenclature:", "33%");
@ <ol>
@ <li> An <div class="sideboxDescribed">%z(href("brlist"))
@ open branch</a></div> is a branch that has one or
@ more %z(href("leaves"))open leaves.</a>
@ The presence of open leaves presumably means
@ that the branch is still being extended with new check-ins.</li>
@ <li> A <div class="sideboxDescribed">%z(href("brlist?closed"))
@ closed branch</a></div> is a branch with only
@ <div class="sideboxDescribed">%z(href("leaves?closed"))
@ closed leaves</a></div>.
@ Closed branches are fixed and do not change (unless they are first
@ reopened)</li>
@ </ol>
style_sidebox_end();
branch_prepare_list_query(&q, showAll?1:(showClosed?-1:0));
|
| ︙ | ︙ | |||
354 355 356 357 358 359 360 |
@ <ul>
cnt++;
}
if( colorTest ){
const char *zColor = hash_color(zBr);
@ <li><span style="background-color: %s(zColor)">
@ %h(zBr) → %s(zColor)</span></li>
| < < | | 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
@ <ul>
cnt++;
}
if( colorTest ){
const char *zColor = hash_color(zBr);
@ <li><span style="background-color: %s(zColor)">
@ %h(zBr) → %s(zColor)</span></li>
}else{
@ <li>%z(href("%R/timeline?r=%T",zBr))%h(zBr)</a></li>
}
}
if( cnt ){
@ </ul>
}
db_finalize(&q);
@ <script type="text/JavaScript">
|
| ︙ | ︙ | |||
380 381 382 383 384 385 386 |
/*
** This routine is called while for each check-in that is rendered by
** the timeline of a "brlist" page. Add some additional hyperlinks
** to the end of the line.
*/
static void brtimeline_extra(int rid){
Stmt q;
| | | | 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 |
/*
** This routine is called while for each check-in that is rendered by
** the timeline of a "brlist" page. Add some additional hyperlinks
** to the end of the line.
*/
static void brtimeline_extra(int rid){
Stmt q;
if( !g.perm.Hyperlink ) return;
db_prepare(&q,
"SELECT substr(tagname,5) FROM tagxref, tag"
" WHERE tagxref.rid=%d"
" AND tagxref.tagid=tag.tagid"
" AND tagxref.tagtype>0"
" AND tag.tagname GLOB 'sym-*'",
rid
);
while( db_step(&q)==SQLITE_ROW ){
const char *zTagName = db_column_text(&q, 0);
@ %z(href("%R/timeline?r=%T",zTagName))[timeline]</a>
}
db_finalize(&q);
}
/*
** WEBPAGE: brtimeline
**
|
| ︙ | ︙ |
Changes to src/browse.c.
| ︙ | ︙ | |||
77 78 79 80 81 82 83 |
int i, j;
char *zSep = "";
for(i=0; zPath[i]; i=j){
for(j=i; zPath[j] && zPath[j]!='/'; j++){}
if( zPath[j] && g.perm.History ){
if( zCI ){
| > | | > | | | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
int i, j;
char *zSep = "";
for(i=0; zPath[i]; i=j){
for(j=i; zPath[j] && zPath[j]!='/'; j++){}
if( zPath[j] && g.perm.History ){
if( zCI ){
char *zLink = href("%R/dir?ci=%S&name=%#T", zCI, j, zPath);
blob_appendf(pOut, "%s%z%#h</a>",
zSep, zLink, j-i, &zPath[i]);
}else{
char *zLink = href("%R/dir?name=%#T", j, zPath);
blob_appendf(pOut, "%s%z%#h</a>",
zSep, zLink, j-i, &zPath[i]);
}
}else{
blob_appendf(pOut, "%s%#h", zSep, j-i, &zPath[i]);
}
zSep = "/";
while( zPath[j]=='/' ){ j++; }
}
|
| ︙ | ︙ | |||
153 154 155 156 157 158 159 |
blob_append(&dirname, "in the top-level directory", -1);
zPrefix = "";
}
if( zCI ){
char zShort[20];
memcpy(zShort, zUuid, 10);
zShort[10] = 0;
| | | | | | | | | < | | | | | 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 |
blob_append(&dirname, "in the top-level directory", -1);
zPrefix = "";
}
if( zCI ){
char zShort[20];
memcpy(zShort, zUuid, 10);
zShort[10] = 0;
@ <h2>Files of check-in [%z(href("vinfo?name=%T",zUuid))%s(zShort)</a>]
@ %s(blob_str(&dirname))</h2>
zSubdirLink = mprintf("%R/dir?ci=%S&name=%T", zUuid, zPrefix);
if( zD ){
style_submenu_element("Top", "Top", "%R/dir?ci=%S", zUuid);
style_submenu_element("All", "All", "%R/dir?name=%t", zD);
}else{
style_submenu_element("All", "All", "%R/dir");
}
}else{
int hasTrunk;
@ <h2>The union of all files from all check-ins
@ %s(blob_str(&dirname))</h2>
hasTrunk = db_exists(
"SELECT 1 FROM tagxref WHERE tagid=%d AND value='trunk'",
TAG_BRANCH);
zSubdirLink = mprintf("%R/dir?name=%T", zPrefix);
if( zD ){
style_submenu_element("Top", "Top", "%R/dir");
style_submenu_element("Tip", "Tip", "%R/dir?name=%t&ci=tip", zD);
if( hasTrunk ){
style_submenu_element("Trunk", "Trunk", "%R/dir?name=%t&ci=trunk",
zD);
}
}else{
style_submenu_element("Tip", "Tip", "%R/dir?ci=tip");
if( hasTrunk ){
style_submenu_element("Trunk", "Trunk", "%R/dir?ci=trunk");
}
}
}
/* Compute the temporary table "localfiles" containing the names
** of all files and subdirectories in the zD[] directory.
**
|
| ︙ | ︙ | |||
276 277 278 279 280 281 282 |
@ </ul></td><td class="browser"><ul class="browser">
i = 0;
}
i++;
zFN = db_column_text(&q, 0);
if( zFN[0]=='/' ){
zFN++;
| | | | | 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 |
@ </ul></td><td class="browser"><ul class="browser">
i = 0;
}
i++;
zFN = db_column_text(&q, 0);
if( zFN[0]=='/' ){
zFN++;
@ <li>%z(href("%s%T",zSubdirLink,zFN))%h(zFN)</a></li>
}else if( zCI ){
const char *zUuid = db_column_text(&q, 1);
@ <li>%z(href("%R/artifact/%s",zUuid))%h(zFN)</a></li>
}else{
@ <li>%z(href("%R/finfo?name=%T%T",zPrefix,zFN))%h(zFN)
@ </a></li>
}
}
db_finalize(&q);
manifest_destroy(pM);
@ </ul></td></tr></table>
style_footer();
}
|
Changes to src/diff.c.
| ︙ | ︙ | |||
1776 1777 1778 1779 1780 1781 1782 |
while( db_step(&q)==SQLITE_ROW ){
int pid = db_column_int(&q, 0);
const char *zUuid = db_column_text(&q, 1);
const char *zDate = db_column_text(&q, 2);
const char *zUser = db_column_text(&q, 3);
if( webLabel ){
zLabel = mprintf(
| | | | 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 |
while( db_step(&q)==SQLITE_ROW ){
int pid = db_column_int(&q, 0);
const char *zUuid = db_column_text(&q, 1);
const char *zDate = db_column_text(&q, 2);
const char *zUser = db_column_text(&q, 3);
if( webLabel ){
zLabel = mprintf(
"<a href='%R/info/%s' target='infowindow'>%.10s</a> %s %13.13s",
zUuid, zUuid, zDate, zUser
);
}else{
zLabel = mprintf("%.10s %s %13.13s", zUuid, zDate, zUser);
}
p->nVers++;
p->azVers = fossil_realloc(p->azVers, p->nVers*sizeof(p->azVers[0]) );
p->azVers[p->nVers-1] = zLabel;
|
| ︙ | ︙ | |||
1819 1820 1821 1822 1823 1824 1825 |
if( mid==0 || fnid==0 ){ fossil_redirect_home(); }
iLimit = atoi(PD("limit","-1"));
if( !db_exists("SELECT 1 FROM mlink WHERE mid=%d AND fnid=%d",mid,fnid) ){
fossil_redirect_home();
}
style_header("File Annotation");
if( P("filevers") ) annFlags |= ANN_FILE_VERS;
| | | 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 |
if( mid==0 || fnid==0 ){ fossil_redirect_home(); }
iLimit = atoi(PD("limit","-1"));
if( !db_exists("SELECT 1 FROM mlink WHERE mid=%d AND fnid=%d",mid,fnid) ){
fossil_redirect_home();
}
style_header("File Annotation");
if( P("filevers") ) annFlags |= ANN_FILE_VERS;
annotate_file(&ann, fnid, mid, g.perm.Hyperlink, iLimit, annFlags);
if( P("log") ){
int i;
@ <h2>Versions analyzed:</h2>
@ <ol>
for(i=0; i<ann.nVers; i++){
@ <li><tt>%s(ann.azVers[i])</tt></li>
}
|
| ︙ | ︙ |
Changes to src/event.c.
| ︙ | ︙ | |||
29 30 31 32 33 34 35 |
#include "event.h"
/*
** Output a hyperlink to an event given its tagid.
*/
void hyperlink_to_event_tagid(int tagid){
char *zEventId;
| < < | < < < < < | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
#include "event.h"
/*
** Output a hyperlink to an event given its tagid.
*/
void hyperlink_to_event_tagid(int tagid){
char *zEventId;
zEventId = db_text(0, "SELECT substr(tagname, 7) FROM tag WHERE tagid=%d",
tagid);
@ [%z(href("%R/event/%s",zEventId))%S(zEventId)</a>]
free(zEventId);
}
/*
** WEBPAGE: event
** URL: /event
** PARAMETERS:
|
| ︙ | ︙ | |||
128 129 130 131 132 133 134 |
if( g.perm.WrWiki && g.perm.Write && nextRid==0 ){
style_submenu_element("Edit", "Edit", "%s/eventedit?name=%s",
g.zTop, zEventId);
}
zETime = db_text(0, "SELECT datetime(%.17g)", pEvent->rEventDate);
style_submenu_element("Context", "Context", "%s/timeline?c=%T",
g.zTop, zETime);
| | | 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
if( g.perm.WrWiki && g.perm.Write && nextRid==0 ){
style_submenu_element("Edit", "Edit", "%s/eventedit?name=%s",
g.zTop, zEventId);
}
zETime = db_text(0, "SELECT datetime(%.17g)", pEvent->rEventDate);
style_submenu_element("Context", "Context", "%s/timeline?c=%T",
g.zTop, zETime);
if( g.perm.Hyperlink ){
if( showDetail ){
style_submenu_element("Plain", "Plain", "%s/event?name=%s&aid=%s",
g.zTop, zEventId, zUuid);
if( nextRid ){
char *zNext;
zNext = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", nextRid);
style_submenu_element("Next", "Next",
|
| ︙ | ︙ | |||
155 156 157 158 159 160 161 |
}else{
style_submenu_element("Detail", "Detail",
"%s/event?name=%s&aid=%s&detail=1",
g.zTop, zEventId, zUuid);
}
}
| | | | | | 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
}else{
style_submenu_element("Detail", "Detail",
"%s/event?name=%s&aid=%s&detail=1",
g.zTop, zEventId, zUuid);
}
}
if( showDetail && g.perm.Hyperlink ){
int i;
const char *zClr = 0;
Blob comment;
zATime = db_text(0, "SELECT datetime(%.17g)", pEvent->rDate);
@ <p>Event [%z(href("%R/artifact/%s",zUuid))%S(zUuid)</a>] at
@ [%z(href("%R/timeline?c=%T",zETime))%s(zETime)</a>]
@ entered by user <b>%h(pEvent->zUser)</b> on
@ [%z(href("%R/timeline?c=%T",zATime))%s(zATime)</a>]:</p>
@ <blockquote>
for(i=0; i<pEvent->nTag; i++){
if( fossil_strcmp(pEvent->aTag[i].zName,"+bgcolor")==0 ){
zClr = pEvent->aTag[i].zValue;
}
}
if( zClr && zClr[0]==0 ) zClr = 0;
|
| ︙ | ︙ |
Changes to src/finfo.c.
| ︙ | ︙ | |||
303 304 305 306 307 308 309 |
@ <tr><td>
@ <div class="divider">%s(zPrevDate)</div>
@ </td></tr>
}
memcpy(zTime, &zDate[11], 5);
zTime[5] = 0;
@ <tr><td class="timelineTime">
| | < < < < < | | | | 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 |
@ <tr><td>
@ <div class="divider">%s(zPrevDate)</div>
@ </td></tr>
}
memcpy(zTime, &zDate[11], 5);
zTime[5] = 0;
@ <tr><td class="timelineTime">
@ %z(href("%R/timeline?c=%t",zDate))%s(zTime)</a></td>
@ <td class="timelineGraph"><div id="m%d(gidx)"></div></td>
if( zBgClr && zBgClr[0] ){
@ <td class="timelineTableCell" style="background-color: %h(zBgClr);">
}else{
@ <td class="timelineTableCell">
}
sqlite3_snprintf(sizeof(zShort), zShort, "%.10s", zUuid);
sqlite3_snprintf(sizeof(zShortCkin), zShortCkin, "%.10s", zCkin);
if( zUuid ){
@ %z(href("%R/artifact/%s",zUuid))[%S(zUuid)]</a> part of check-in
}else{
@ <b>Deleted</b> by check-in
}
hyperlink_to_uuid(zShortCkin);
@ %h(zCom) (user:
hyperlink_to_user(zUser, zDate, "");
@ branch: %h(zBr))
if( g.perm.History && zUuid ){
const char *z = zFilename;
if( fpid ){
@ %z(href("%R/fdiff?v1=%s&v2=%s",zPUuid,zUuid))[diff]</a>
}
@ %z(href("%R/annotate?checkin=%S&filename=%h",zCkin,z))
@ [annotate]</a>
}
@ </td></tr>
}
db_finalize(&q);
if( pGraph ){
graph_finish(pGraph, 0);
|
| ︙ | ︙ |
Changes to src/info.c.
| ︙ | ︙ | |||
259 260 261 262 263 264 265 |
hyperlink_to_uuid(zOrigUuid);
}else{
@ propagates to descendants
}
#if 0
if( zValue && fossil_strcmp(zTagname,"branch")==0 ){
@
| | | 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
hyperlink_to_uuid(zOrigUuid);
}else{
@ propagates to descendants
}
#if 0
if( zValue && fossil_strcmp(zTagname,"branch")==0 ){
@
@ %z(href("%R/timeline?r=%T",zValue))branch timeline</a>
}
#endif
}
if( zSrcUuid && zSrcUuid[0] ){
if( tagtype==0 ){
@ by
}else{
|
| ︙ | ︙ | |||
331 332 333 334 335 336 337 |
const char *zName, /* Name of the file that has changed */
const char *zOld, /* blob.uuid before change. NULL for added files */
const char *zNew, /* blob.uuid after change. NULL for deletes */
const char *zOldName, /* Prior name. NULL if no name change. */
int diffFlags, /* Flags for text_diff(). Zero to omit diffs */
int mperm /* executable or symlink permission for zNew */
){
| | | | | | | | | | | | | | 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 |
const char *zName, /* Name of the file that has changed */
const char *zOld, /* blob.uuid before change. NULL for added files */
const char *zNew, /* blob.uuid after change. NULL for deletes */
const char *zOldName, /* Prior name. NULL if no name change. */
int diffFlags, /* Flags for text_diff(). Zero to omit diffs */
int mperm /* executable or symlink permission for zNew */
){
if( !g.perm.Hyperlink ){
if( zNew==0 ){
@ <p>Deleted %h(zName)</p>
}else if( zOld==0 ){
@ <p>Added %h(zName)</p>
}else if( zOldName!=0 && fossil_strcmp(zName,zOldName)!=0 ){
@ <p>Name change from %h(zOldName) to %h(zName)
}else if( fossil_strcmp(zNew, zOld)==0 ){
@ <p>Execute permission %s(( mperm==PERM_EXE )?"set":"cleared")
@ for %h(zName)</p>
}else{
@ <p>Changes to %h(zName)</p>
}
if( diffFlags ){
@ <pre style="white-space:pre;">
append_diff(zOld, zNew, diffFlags);
@ </pre>
}
}else{
if( zOld && zNew ){
if( fossil_strcmp(zOld, zNew)!=0 ){
@ <p>Modified %z(href("%R/finfo?name=%T",zName))%h(zName)</a>
@ from %z(href("%R/artifact/%s",zOld))[%S(zOld)]</a>
@ to %z(href("%R/artifact/%s",zNew))[%S(zNew)].</a>
}else if( zOldName!=0 && fossil_strcmp(zName,zOldName)!=0 ){
@ <p>Name change from
@ from %z(href("%R/finfo?name=%T",zOldName))%h(zOldName)</a>
@ to %z(href("%R/finfo?name=%T",zName))%h(zName)</a>.
}else{
@ <p>Execute permission %s(( mperm==PERM_EXE )?"set":"cleared") for
@ %z(href("%R/finfo?name=%T",zName))%h(zName)</a>
}
}else if( zOld ){
@ <p>Deleted %z(href("%s/finfo?name=%T",g.zTop,zName))%h(zName)</a>
@ version %z(href("%R/artifact/%s",zOld))[%S(zOld)]</a>
}else{
@ <p>Added %z(href("%R/finfo?name=%T",zName))%h(zName)</a>
@ version %z(href("%R/artifact/%s",zNew))[%S(zNew)]</a>
}
if( diffFlags ){
@ <pre style="white-space:pre;">
append_diff(zOld, zNew, diffFlags);
@ </pre>
}else if( zOld && zNew && fossil_strcmp(zOld,zNew)!=0 ){
@
@ %z(href("%R/fdiff?v1=%S&v2=%S",zOld,zNew))[diff]</a>
}
@ </p>
}
}
/*
** Construct an appropriate diffFlag for text_diff() based on query
|
| ︙ | ︙ | |||
533 534 535 536 537 538 539 |
const char *zDate = db_column_text(&q, 2);
if( zUser==0 || zUser[0]==0 ) zUser = "unknown";
@ <tr><th>Received From:</th>
@ <td>%h(zUser) @ %h(zIpAddr) on %s(zDate)</td></tr>
}
db_finalize(&q);
}
| | | | | | | | | | | | | | | | | | | | | | | | | | 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 |
const char *zDate = db_column_text(&q, 2);
if( zUser==0 || zUser[0]==0 ) zUser = "unknown";
@ <tr><th>Received From:</th>
@ <td>%h(zUser) @ %h(zIpAddr) on %s(zDate)</td></tr>
}
db_finalize(&q);
}
if( g.perm.Hyperlink ){
const char *zProjName = db_get("project-name", "unnamed");
@ <tr><th>Timelines:</th><td>
@ %z(href("%R/timeline?f=%S",zUuid))family</a>
if( zParent ){
@ | %z(href("%R/timeline?p=%S",zUuid))ancestors</a>
}
if( !isLeaf ){
@ | %z(href("%R/timeline?d=%S",zUuid))descendants</a>
}
if( zParent && !isLeaf ){
@ | %z(href("%R/timeline?dp=%S",zUuid))both</a>
}
db_prepare(&q, "SELECT substr(tag.tagname,5) FROM tagxref, tag "
" WHERE rid=%d AND tagtype>0 "
" AND tag.tagid=tagxref.tagid "
" AND +tag.tagname GLOB 'sym-*'", rid);
while( db_step(&q)==SQLITE_ROW ){
const char *zTagName = db_column_text(&q, 0);
@ | %z(href("%R/timeline?r=%T",zTagName))%h(zTagName)</a>
}
db_finalize(&q);
@ </td></tr>
@ <tr><th>Other Links:</th>
@ <td>
@ %z(href("%R/dir?ci=%S",zUuid))files</a>
if( g.perm.Zip ){
char *zUrl = mprintf("%R/tarball/%s-%S.tar.gz?uuid=%s",
zProjName, zUuid, zUuid);
@ | %z(href("%s",zUrl))Tarball</a>
@ | %z(href("%R/zip/%s-%S.zip?uuid=%s",zProjName,zUuid,zUuid))
@ ZIP archive</a>
fossil_free(zUrl);
}
@ | %z(href("%R/artifact/%S",zUuid))manifest</a>
if( g.perm.Write ){
@ | %z(href("%R/ci_edit?r=%S",zUuid))edit</a>
}
@ </td>
@ </tr>
}
@ </table>
}else{
style_header("Check-in Information");
login_anonymous_available();
}
db_finalize(&q);
showTags(rid, "");
if( zParent ){
@ <div class="section">Changes</div>
@ <div class="sectionmenu">
showDiff = g.zPath[0]!='c';
if( db_get_boolean("show-version-diffs", 0)==0 ){
showDiff = !showDiff;
if( showDiff ){
@ %z(xhref("class='button'","%R/vinfo/%T",zName)))
@ hide diffs</a>
if( sideBySide ){
@ %z(xhref("class='button'","%R/ci/%T?sbs=0",zName))
@ unified diffs</a>
}else{
@ %z(xhref("class='button'","%R/ci/%T?sbs=1",zName))
@ side-by-side diffs</a>
}
}else{
@ %z(xhref("class='button'","%R/ci/%T?sbs=0",zName))
@ show unified diffs</a>
@ %z(xhref("class='button'","%R/ci/%T?sbs=1",zName))
@ show side-by-side diffs</a>
}
}else{
if( showDiff ){
@ %z(xhref("class='button'","%R/ci/%T",zName))hide diffs</a>
if( sideBySide ){
@ %z(xhref("class='button'","%R/info/%T?sbs=0",zName))
@ unified diffs</a>
}else{
@ %z(xhref("class='button'","%R/info/%T?sbs=1",zName))
@ side-by-side diffs</a>
}
}else{
@ %z(xhref("class='button'","%R/vinfo/%T?sbs=0",zName))
@ show unified diffs</a>
@ %z(xhref("class='button'","%R/vinfo/%T?sbs=1",zName))
@ show side-by-side diffs</a>
}
}
@ %z(xhref("class='button'","%R/vpatch?from=%S&to=%S",zParent,zUuid))
@ patch</a></div>
db_prepare(&q,
"SELECT name,"
" mperm,"
" (SELECT uuid FROM blob WHERE rid=mlink.pid),"
" (SELECT uuid FROM blob WHERE rid=mlink.fid),"
" (SELECT name FROM filename WHERE filename.fnid=mlink.pfnid)"
|
| ︙ | ︙ | |||
696 697 698 699 700 701 702 |
@ <tr><th>Date:</th><td>
hyperlink_to_date(zDate, "</td></tr>");
if( g.perm.Setup ){
@ <tr><th>Record ID:</th><td>%d(rid)</td></tr>
}
@ <tr><th>Original User:</th><td>
hyperlink_to_user(zUser, zDate, "</td></tr>");
| | | | | 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 |
@ <tr><th>Date:</th><td>
hyperlink_to_date(zDate, "</td></tr>");
if( g.perm.Setup ){
@ <tr><th>Record ID:</th><td>%d(rid)</td></tr>
}
@ <tr><th>Original User:</th><td>
hyperlink_to_user(zUser, zDate, "</td></tr>");
if( g.perm.Hyperlink ){
@ <tr><th>Commands:</th>
@ <td>
@ &z(href("%R/whistory?name=%t",zName))history</a>
@ | %z(href("%R/artifact/%S",zUuid))raw-text</a>
@ </td>
@ </tr>
}
@ </table></p>
}else{
style_header("Wiki Information");
rid = 0;
|
| ︙ | ︙ | |||
934 935 936 937 938 939 940 |
if( mPerm==PERM_LNK ){
@ <li>Symbolic link
}else if( mPerm==PERM_EXE ){
@ <li>Executable file
}else{
@ <li>File
}
| < | < < < < < < | < | | | 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 |
if( mPerm==PERM_LNK ){
@ <li>Symbolic link
}else if( mPerm==PERM_EXE ){
@ <li>Executable file
}else{
@ <li>File
}
@ %z(href("%R/finfo?name=%T",zName))%h(zName)</a>
@ <ul>
prevName = fossil_strdup(zName);
}
@ <li>
hyperlink_to_date(zDate,"");
@ - part of checkin
hyperlink_to_uuid(zVers);
if( zBr && zBr[0] ){
@ on branch %z(href("%R/timeline?r=%T",zBr))%h(zBr)</a>
}
@ - %w(zCom) (user:
hyperlink_to_user(zUser,zDate,"");
@ )
if( g.perm.Hyperlink ){
@ %z(href("%R/annotate?checkin=%S&filename=%T",zVers,zName))
@ [annotate]</a>
}
cnt++;
if( pDownloadName && blob_size(pDownloadName)==0 ){
blob_append(pDownloadName, zName, -1);
}
}
|
| ︙ | ︙ | |||
987 988 989 990 991 992 993 |
const char *zDate = db_column_text(&q, 1);
const char *zUser = db_column_text(&q, 2);
if( cnt>0 ){
@ Also wiki page
}else{
@ Wiki page
}
| < < < | < < | 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 |
const char *zDate = db_column_text(&q, 1);
const char *zUser = db_column_text(&q, 2);
if( cnt>0 ){
@ Also wiki page
}else{
@ Wiki page
}
@ [%z(href("%R/wiki?name=%t",zPagename))%h(zPagename)</a>] by
hyperlink_to_user(zUser,zDate," on");
hyperlink_to_date(zDate,".");
nWiki++;
cnt++;
if( pDownloadName && blob_size(pDownloadName)==0 ){
blob_appendf(pDownloadName, "%s.wiki", zPagename);
}
|
| ︙ | ︙ | |||
1063 1064 1065 1066 1067 1068 1069 |
/* const char *zSrc = db_column_text(&q, 4); */
if( cnt>0 ){
@ Also attachment "%h(zFilename)" to
}else{
@ Attachment "%h(zFilename)" to
}
if( strlen(zTarget)==UUID_SIZE && validate16(zTarget,UUID_SIZE) ){
| | | | | | | | 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 |
/* const char *zSrc = db_column_text(&q, 4); */
if( cnt>0 ){
@ Also attachment "%h(zFilename)" to
}else{
@ Attachment "%h(zFilename)" to
}
if( strlen(zTarget)==UUID_SIZE && validate16(zTarget,UUID_SIZE) ){
if( g.perm.Hyperlink && g.perm.RdTkt ){
@ ticket [%z(href("%R/tktview?name=%S",zTarget))%S(zTarget)</a>]
}else{
@ ticket [%S(zTarget)]
}
}else{
if( g.perm.Hyperlink && g.perm.RdWiki ){
@ wiki page [%z(href("%R/wiki?name=%t",zTarget)))%h(zTarget)</a>]
}else{
@ wiki page [%h(zTarget)]
}
}
@ added by
hyperlink_to_user(zUser,zDate," on");
hyperlink_to_date(zDate,".");
cnt++;
if( pDownloadName && blob_size(pDownloadName)==0 ){
blob_append(pDownloadName, zFilename, -1);
}
}
db_finalize(&q);
if( cnt==0 ){
@ Control artifact.
if( pDownloadName && blob_size(pDownloadName)==0 ){
blob_appendf(pDownloadName, "%.10s.txt", zUuid);
}
}else if( linkToView && g.perm.Hyperlink ){
@ %z(href("%R/artifact/%S",zUuid))[view]</a>
}
}
/*
** WEBPAGE: fdiff
** URL: fdiff?v1=UUID&v2=UUID&patch&sbs=BOOLEAN
|
| ︙ | ︙ | |||
1158 1159 1160 1161 1162 1163 1164 |
style_submenu_element("Unified Diff", "udiff",
"%s/fdiff?v1=%T&v2=%T&sbs=0",
g.zTop, P("v1"), P("v2"));
}
if( P("smhdr")!=0 ){
@ <h2>Differences From Artifact
| | | | | < | 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 |
style_submenu_element("Unified Diff", "udiff",
"%s/fdiff?v1=%T&v2=%T&sbs=0",
g.zTop, P("v1"), P("v2"));
}
if( P("smhdr")!=0 ){
@ <h2>Differences From Artifact
@ %z(href("%R/artifact/%S",zV1))[%S(zV1)]</a> To
@ %z(href("%R/artifact/%S",zV2))[%S(zV2)]</a>.</h2>
}else{
@ <h2>Differences From
@ Artifact %z(href("%R/artifact/%S",zV1))[%S(zV1)]</a>:</h2>
object_description(v1, 0, 0);
@ <h2>To Artifact %z(href("%R/artifact/%S",zV2))[%S(zV2)]</a>:</h2>
object_description(v2, 0, 0);
}
@ <hr />
@ <div class="%s(zStyle)">
@ %s(blob_str(&diff))
@ </div>
blob_reset(&diff);
|
| ︙ | ︙ | |||
1520 1521 1522 1523 1524 1525 1526 |
if( pTktChng==0 ){
fossil_redirect_home();
}
style_header("Ticket Change Details");
zDate = db_text(0, "SELECT datetime(%.12f)", pTktChng->rDate);
memcpy(zTktName, pTktChng->zTicketUuid, 10);
zTktName[10] = 0;
| | | | | < | 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 |
if( pTktChng==0 ){
fossil_redirect_home();
}
style_header("Ticket Change Details");
zDate = db_text(0, "SELECT datetime(%.12f)", pTktChng->rDate);
memcpy(zTktName, pTktChng->zTicketUuid, 10);
zTktName[10] = 0;
if( g.perm.Hyperlink ){
@ <h2>Changes to ticket
@ %z(href("%R/tktview/%s",pTktChng->zTicketUuid)))%s(zTktName)</a></h2>
@
@ <p>By %h(pTktChng->zUser) on %s(zDate). See also:
@ %z(href("%R/artifact/%T",zUuid))artifact content</a>, and
@ %z(href("%R/tkthistory/%s",pTktChng->zTicketUuid))ticket history</a></p>
}else{
@ <h2>Changes to ticket %s(zTktName)</h2>
@
@ <p>By %h(pTktChng->zUser) on %s(zDate).
@ </p>
}
@
|
| ︙ | ︙ | |||
1963 1964 1965 1966 1967 1968 1969 |
@ %s(blob_str(&suffix))
@ </td></tr></table>
@ </blockquote>
@ <hr />
blob_reset(&suffix);
}
@ <p>Make changes to attributes of check-in
| | | 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 |
@ %s(blob_str(&suffix))
@ </td></tr></table>
@ </blockquote>
@ <hr />
blob_reset(&suffix);
}
@ <p>Make changes to attributes of check-in
@ [%z(href("%R/ci/%s",zUuid))%s(zUuid)</a>]:</p>
@ <form action="%s(g.zTop)/ci_edit" method="post"><div>
login_insert_csrf_secret();
@ <input type="hidden" name="r" value="%S(zUuid)" />
@ <table border="0" cellspacing="10">
@ <tr><td align="right" valign="top"><b>User:</b></td>
@ <td valign="top">
|
| ︙ | ︙ |
Changes to src/login.c.
| ︙ | ︙ | |||
909 910 911 912 913 914 915 |
if( fossil_strcmp(g.zLogin,"nobody")==0 ){
g.zLogin = 0;
}
/* Set the capabilities */
login_replace_capabilities(zCap, 0);
login_set_anon_nobody_capabilities();
| | > | 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 |
if( fossil_strcmp(g.zLogin,"nobody")==0 ){
g.zLogin = 0;
}
/* Set the capabilities */
login_replace_capabilities(zCap, 0);
login_set_anon_nobody_capabilities();
if( zCap[0] && !g.perm.History && !g.perm.Link
&& db_get_boolean("auto-enable-hyperlinks",1)
&& isHuman(P("HTTP_USER_AGENT")) ){
g.perm.History = 1;
}
/* If the public-pages glob pattern is defined and REQUEST_URI matches
** one of the globs in public-pages, then also add in all default-perms
** permissions.
|
| ︙ | ︙ | |||
981 982 983 984 985 986 987 |
g.perm.TktFmt = g.perm.Attach = g.perm.ApndTkt = 1;
/* Fall thru into Read/Write */
case 'i': g.perm.Read = g.perm.Write = 1; break;
case 'o': g.perm.Read = 1; break;
case 'z': g.perm.Zip = 1; break;
case 'd': g.perm.Delete = 1; break;
| | > | 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 |
g.perm.TktFmt = g.perm.Attach = g.perm.ApndTkt = 1;
/* Fall thru into Read/Write */
case 'i': g.perm.Read = g.perm.Write = 1; break;
case 'o': g.perm.Read = 1; break;
case 'z': g.perm.Zip = 1; break;
case 'd': g.perm.Delete = 1; break;
case 'h': g.perm.History = g.perm.Hyperlink = 1; break;
case 'l': g.perm.Link = g.perm.Hyperlink = 1; break;
case 'g': g.perm.Clone = 1; break;
case 'p': g.perm.Password = 1; break;
case 'j': g.perm.RdWiki = 1; break;
case 'k': g.perm.WrWiki = g.perm.RdWiki = g.perm.ApndWiki =1; break;
case 'm': g.perm.ApndWiki = 1; break;
case 'f': g.perm.NewWiki = 1; break;
|
| ︙ | ︙ | |||
1055 1056 1057 1058 1059 1060 1061 |
case 'e': rc = g.perm.RdAddr; break;
case 'f': rc = g.perm.NewWiki; break;
case 'g': rc = g.perm.Clone; break;
case 'h': rc = g.perm.History; break;
case 'i': rc = g.perm.Write; break;
case 'j': rc = g.perm.RdWiki; break;
case 'k': rc = g.perm.WrWiki; break;
| | | 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 |
case 'e': rc = g.perm.RdAddr; break;
case 'f': rc = g.perm.NewWiki; break;
case 'g': rc = g.perm.Clone; break;
case 'h': rc = g.perm.History; break;
case 'i': rc = g.perm.Write; break;
case 'j': rc = g.perm.RdWiki; break;
case 'k': rc = g.perm.WrWiki; break;
case 'l': rc = g.perm.Link; break;
case 'm': rc = g.perm.ApndWiki; break;
case 'n': rc = g.perm.NewTkt; break;
case 'o': rc = g.perm.Read; break;
case 'p': rc = g.perm.Password; break;
/* case 'q': */
case 'r': rc = g.perm.RdTkt; break;
case 's': rc = g.perm.Setup; break;
|
| ︙ | ︙ | |||
1133 1134 1135 1136 1137 1138 1139 |
/*
** Call this routine if the user lacks okHistory permission. If
** the anonymous user has okHistory permission, then paint a mesage
** to inform the user that much more information is available by
** logging in as anonymous.
*/
void login_anonymous_available(void){
| | | 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 |
/*
** Call this routine if the user lacks okHistory permission. If
** the anonymous user has okHistory permission, then paint a mesage
** to inform the user that much more information is available by
** logging in as anonymous.
*/
void login_anonymous_available(void){
if( !g.perm.History && !g.perm.Link &&
db_exists("SELECT 1 FROM user"
" WHERE login='anonymous'"
" AND cap LIKE '%%h%%'") ){
const char *zUrl = PD("REQUEST_URI", "index");
@ <p>Many <span class="disabled">hyperlinks are disabled.</span><br />
@ Use <a href="%s(g.zTop)/login?anon=1&g=%T(zUrl)">anonymous login</a>
@ to enable hyperlinks.</p>
|
| ︙ | ︙ |
Changes to src/main.c.
| ︙ | ︙ | |||
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
/*
** Maximum number of auxiliary parameters on reports
*/
#define MX_AUX 5
/*
** Holds flags for fossil user permissions.
*/
struct FossilUserPerms {
char Setup; /* s: use Setup screens on web interface */
char Admin; /* a: administrative permission */
char Delete; /* d: delete wiki or tickets */
char Password; /* p: change password */
char Query; /* q: create new reports */
char Write; /* i: xfer inbound. checkin */
char Read; /* o: xfer outbound. checkout */
char History; /* h: access historical information. */
char Clone; /* g: clone */
char RdWiki; /* j: view wiki via web */
char NewWiki; /* f: create new wiki via web */
char ApndWiki; /* m: append to wiki via web */
char WrWiki; /* k: edit wiki via web */
char RdTkt; /* r: view tickets via web */
char NewTkt; /* n: create new tickets */
char ApndTkt; /* c: append to tickets via the web */
char WrTkt; /* w: make changes to tickets via web */
char Attach; /* b: add attachments */
char TktFmt; /* t: create new ticket report formats */
char RdAddr; /* e: read email addresses or other private data */
char Zip; /* z: download zipped artifact via /zip URL */
char Private; /* x: can send and receive private content */
};
#ifdef FOSSIL_ENABLE_TCL
/*
** All Tcl related context information is in this structure. This structure
** definition has been copied from and should be kept in sync with the one in
** "th_tcl.c".
| > > > > > > > > > | 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
/*
** Maximum number of auxiliary parameters on reports
*/
#define MX_AUX 5
/*
** Holds flags for fossil user permissions.
**
** History enables various hyperlinks directly, with an href= attribute
** in the HTML. Link puts an id= attribute in HTML and then adds the
** href= attribute using javascript. The Link option is designed to make
** it harder for bots and spiders to follow hyperlinks, and yet give the
** same experience to users. the Hyperlink permission is a composite which
** is enabled if either History or Hyperlink is turned on.
*/
struct FossilUserPerms {
char Setup; /* s: use Setup screens on web interface */
char Admin; /* a: administrative permission */
char Delete; /* d: delete wiki or tickets */
char Password; /* p: change password */
char Query; /* q: create new reports */
char Write; /* i: xfer inbound. checkin */
char Read; /* o: xfer outbound. checkout */
char History; /* h: access historical information. */
char Link; /* l: enable href= using javascript */
char Clone; /* g: clone */
char RdWiki; /* j: view wiki via web */
char NewWiki; /* f: create new wiki via web */
char ApndWiki; /* m: append to wiki via web */
char WrWiki; /* k: edit wiki via web */
char RdTkt; /* r: view tickets via web */
char NewTkt; /* n: create new tickets */
char ApndTkt; /* c: append to tickets via the web */
char WrTkt; /* w: make changes to tickets via web */
char Attach; /* b: add attachments */
char TktFmt; /* t: create new ticket report formats */
char RdAddr; /* e: read email addresses or other private data */
char Zip; /* z: download zipped artifact via /zip URL */
char Private; /* x: can send and receive private content */
char Hyperlink; /* "h" or "l" */
};
#ifdef FOSSIL_ENABLE_TCL
/*
** All Tcl related context information is in this structure. This structure
** definition has been copied from and should be kept in sync with the one in
** "th_tcl.c".
|
| ︙ | ︙ |
Changes to src/printf.c.
| ︙ | ︙ | |||
45 46 47 48 49 50 51 52 53 54 55 56 57 58 | #define etHTTPIZE 17 /* Make text safe for HTTP. "/" encoded as %2f */ #define etURLIZE 18 /* Make text safe for HTTP. "/" not encoded */ #define etFOSSILIZE 19 /* The fossil header encoding format. */ #define etPATH 20 /* Path type */ #define etWIKISTR 21 /* Wiki text rendered from a char*: %w */ #define etWIKIBLOB 22 /* Wiki text rendered from a Blob*: %W */ #define etSTRINGID 23 /* String with length limit for a UUID prefix: %S */ /* ** An "etByte" is an 8-bit unsigned value. */ typedef unsigned char etByte; | > | 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | #define etHTTPIZE 17 /* Make text safe for HTTP. "/" encoded as %2f */ #define etURLIZE 18 /* Make text safe for HTTP. "/" not encoded */ #define etFOSSILIZE 19 /* The fossil header encoding format. */ #define etPATH 20 /* Path type */ #define etWIKISTR 21 /* Wiki text rendered from a char*: %w */ #define etWIKIBLOB 22 /* Wiki text rendered from a Blob*: %W */ #define etSTRINGID 23 /* String with length limit for a UUID prefix: %S */ #define etROOT 24 /* String value of g.zTop: % */ /* ** An "etByte" is an 8-bit unsigned value. */ typedef unsigned char etByte; |
| ︙ | ︙ | |||
91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
{ 'q', 0, 4, etSQLESCAPE, 0, 0 },
{ 'Q', 0, 4, etSQLESCAPE2, 0, 0 },
{ 'b', 0, 2, etBLOB, 0, 0 },
{ 'B', 0, 2, etBLOBSQL, 0, 0 },
{ 'w', 0, 2, etWIKISTR, 0, 0 },
{ 'W', 0, 2, etWIKIBLOB, 0, 0 },
{ 'h', 0, 4, etHTMLIZE, 0, 0 },
{ 't', 0, 4, etHTTPIZE, 0, 0 }, /* "/" -> "%2F" */
{ 'T', 0, 4, etURLIZE, 0, 0 }, /* "/" unchanged */
{ 'F', 0, 4, etFOSSILIZE, 0, 0 },
{ 'S', 0, 4, etSTRINGID, 0, 0 },
{ 'c', 0, 0, etCHARX, 0, 0 },
{ 'o', 8, 0, etRADIX, 0, 2 },
{ 'u', 10, 0, etRADIX, 0, 0 },
| > | 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
{ 'q', 0, 4, etSQLESCAPE, 0, 0 },
{ 'Q', 0, 4, etSQLESCAPE2, 0, 0 },
{ 'b', 0, 2, etBLOB, 0, 0 },
{ 'B', 0, 2, etBLOBSQL, 0, 0 },
{ 'w', 0, 2, etWIKISTR, 0, 0 },
{ 'W', 0, 2, etWIKIBLOB, 0, 0 },
{ 'h', 0, 4, etHTMLIZE, 0, 0 },
{ 'R', 0, 0, etROOT, 0, 0 },
{ 't', 0, 4, etHTTPIZE, 0, 0 }, /* "/" -> "%2F" */
{ 'T', 0, 4, etURLIZE, 0, 0 }, /* "/" unchanged */
{ 'F', 0, 4, etFOSSILIZE, 0, 0 },
{ 'S', 0, 4, etSTRINGID, 0, 0 },
{ 'c', 0, 0, etCHARX, 0, 0 },
{ 'o', 8, 0, etRADIX, 0, 2 },
{ 'u', 10, 0, etRADIX, 0, 0 },
|
| ︙ | ︙ | |||
568 569 570 571 572 573 574 575 576 577 578 579 580 581 |
bufpt[i]='/';
}else{
bufpt[i]=e[i];
}
}
bufpt[length]='\0';
break;
}
case etSTRINGID: {
precision = 16;
/* Fall through */
}
case etSTRING:
case etDYNSTRING: {
| > > > > > | 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 |
bufpt[i]='/';
}else{
bufpt[i]=e[i];
}
}
bufpt[length]='\0';
break;
}
case etROOT: {
bufpt = g.zTop;
length = (int)strlen(bufpt);
break;
}
case etSTRINGID: {
precision = 16;
/* Fall through */
}
case etSTRING:
case etDYNSTRING: {
|
| ︙ | ︙ |
Changes to src/report.c.
| ︙ | ︙ | |||
54 55 56 57 58 59 60 |
}
rn = db_column_int(&q, 0);
cnt++;
blob_appendf(&ril, "<li>");
if( zTitle[0] == '_' ){
blob_appendf(&ril, "%s", zTitle);
} else {
| | | > | > | > | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
}
rn = db_column_int(&q, 0);
cnt++;
blob_appendf(&ril, "<li>");
if( zTitle[0] == '_' ){
blob_appendf(&ril, "%s", zTitle);
} else {
blob_appendf(&ril, "%z%h</a>", href("%R/rptview?rn=%d", rn), zTitle);
}
blob_appendf(&ril, " ");
if( g.perm.Write && zOwner && zOwner[0] ){
blob_appendf(&ril, "(by <i>%h</i></i>) ", zOwner);
}
if( g.perm.TktFmt ){
blob_appendf(&ril, "[%zcopy</a>] ",
href("%R/rptedit?rn=%d&copy=1", rn));
}
if( g.perm.Admin
|| (g.perm.WrTkt && zOwner && fossil_strcmp(g.zLogin,zOwner)==0)
){
blob_appendf(&ril, "[%zedit</a>]",
href("%R/rptedit?rn=%d", rn));
}
if( g.perm.TktFmt ){
blob_appendf(&ril, "[%zsql</a>]",
href("%R/rptsql?rn=%d", rn));
}
blob_appendf(&ril, "</li>\n");
}
Th_Store("report_items", blob_str(&ril));
Th_Render(zScript);
|
| ︙ | ︙ | |||
718 719 720 721 722 723 724 |
for(i=0; i<nArg; i++){
char *zData;
if( i==pState->iBg ) continue;
zData = azArg[i];
if( zData==0 ) zData = "";
if( pState->iNewRow>=0 && i>=pState->iNewRow ){
if( zTid && g.perm.Write ){
| | < < < | < | | 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 |
for(i=0; i<nArg; i++){
char *zData;
if( i==pState->iBg ) continue;
zData = azArg[i];
if( zData==0 ) zData = "";
if( pState->iNewRow>=0 && i>=pState->iNewRow ){
if( zTid && g.perm.Write ){
@ <td valign="top">%z(href("%R/tktedit/%h",zTid))edit</a></td>
zTid = 0;
}
if( zData[0] ){
Blob content;
@ </tr><tr style="background-color:%h(zBg)"><td colspan=%d(pState->nCol)>
blob_init(&content, zData, -1);
wiki_convert(&content, 0, 0);
blob_reset(&content);
}
}else if( azName[i][0]=='#' ){
zTid = zData;
@ <td valign="top">%z(href("%R/tktview?name=%h",zData))%h(zData)</a></td>
}else if( zData[0]==0 ){
@ <td valign="top"> </td>
}else{
@ <td valign="top">
@ %h(zData)
@ </td>
}
}
if( zTid && g.perm.Write ){
@ <td valign="top">%z(href("%R/tktedit/%h",zTid))edit</a></td>
}
@ </tr>
return 0;
}
/*
** Output the text given in the argument. Convert tabs and newlines into
|
| ︙ | ︙ |
Changes to src/setup.c.
| ︙ | ︙ | |||
168 169 170 171 172 173 174 175 176 177 178 179 180 181 |
@ repository history</td></tr>
@ <tr><td valign="top"><b>i</b></td>
@ <td><i>Check-In:</i> Commit new versions in the repository</td></tr>
@ <tr><td valign="top"><b>j</b></td>
@ <td><i>Read-Wiki:</i> View wiki pages</td></tr>
@ <tr><td valign="top"><b>k</b></td>
@ <td><i>Write-Wiki:</i> Edit wiki pages</td></tr>
@ <tr><td valign="top"><b>m</b></td>
@ <td><i>Append-Wiki:</i> Append to wiki pages</td></tr>
@ <tr><td valign="top"><b>n</b></td>
@ <td><i>New-Tkt:</i> Create new tickets</td></tr>
@ <tr><td valign="top"><b>o</b></td>
@ <td><i>Check-Out:</i> Check out versions</td></tr>
@ <tr><td valign="top"><b>p</b></td>
| > > > | 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
@ repository history</td></tr>
@ <tr><td valign="top"><b>i</b></td>
@ <td><i>Check-In:</i> Commit new versions in the repository</td></tr>
@ <tr><td valign="top"><b>j</b></td>
@ <td><i>Read-Wiki:</i> View wiki pages</td></tr>
@ <tr><td valign="top"><b>k</b></td>
@ <td><i>Write-Wiki:</i> Edit wiki pages</td></tr>
@ <tr><td valign="top"><b>l</b></td>
@ <td><i>Link-Late:</i> Use javascript for hyperlinks to
@ discourage bots</td></tr>
@ <tr><td valign="top"><b>m</b></td>
@ <td><i>Append-Wiki:</i> Append to wiki pages</td></tr>
@ <tr><td valign="top"><b>n</b></td>
@ <td><i>New-Tkt:</i> Create new tickets</td></tr>
@ <tr><td valign="top"><b>o</b></td>
@ <td><i>Check-Out:</i> Check out versions</td></tr>
@ <tr><td valign="top"><b>p</b></td>
|
| ︙ | ︙ | |||
246 247 248 249 250 251 252 |
/*
** WEBPAGE: /setup_uedit
*/
void user_edit(void){
const char *zId, *zLogin, *zInfo, *zCap, *zPw;
char *oaa, *oas, *oar, *oaw, *oan, *oai, *oaj, *oao, *oap;
| | | 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 |
/*
** WEBPAGE: /setup_uedit
*/
void user_edit(void){
const char *zId, *zLogin, *zInfo, *zCap, *zPw;
char *oaa, *oas, *oar, *oaw, *oan, *oai, *oaj, *oao, *oap;
char *oak, *oad, *oac, *oaf, *oam, *oah, *oal, *oag, *oae;
char *oat, *oau, *oav, *oab, *oax, *oaz;
const char *zGroup;
const char *zOldLogin;
char *inherit[128];
int doWrite;
int uid;
int higherUser = 0; /* True if user being edited is SETUP and the */
|
| ︙ | ︙ | |||
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 |
int ar = P("ar")!=0;
int as = g.perm.Setup && P("as")!=0;
int aw = P("aw")!=0;
int ac = P("ac")!=0;
int af = P("af")!=0;
int am = P("am")!=0;
int ah = P("ah")!=0;
int ag = P("ag")!=0;
int at = P("at")!=0;
int au = P("au")!=0;
int av = P("av")!=0;
int ax = P("ax")!=0;
int az = P("az")!=0;
if( aa ){ zCap[i++] = 'a'; }
if( ab ){ zCap[i++] = 'b'; }
if( ac ){ zCap[i++] = 'c'; }
if( ad ){ zCap[i++] = 'd'; }
if( ae ){ zCap[i++] = 'e'; }
if( af ){ zCap[i++] = 'f'; }
if( ah ){ zCap[i++] = 'h'; }
if( ag ){ zCap[i++] = 'g'; }
if( ai ){ zCap[i++] = 'i'; }
if( aj ){ zCap[i++] = 'j'; }
if( ak ){ zCap[i++] = 'k'; }
if( am ){ zCap[i++] = 'm'; }
if( an ){ zCap[i++] = 'n'; }
if( ao ){ zCap[i++] = 'o'; }
if( ap ){ zCap[i++] = 'p'; }
if( ar ){ zCap[i++] = 'r'; }
if( as ){ zCap[i++] = 's'; }
if( at ){ zCap[i++] = 't'; }
| > > | 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 |
int ar = P("ar")!=0;
int as = g.perm.Setup && P("as")!=0;
int aw = P("aw")!=0;
int ac = P("ac")!=0;
int af = P("af")!=0;
int am = P("am")!=0;
int ah = P("ah")!=0;
int al = P("al")!=0;
int ag = P("ag")!=0;
int at = P("at")!=0;
int au = P("au")!=0;
int av = P("av")!=0;
int ax = P("ax")!=0;
int az = P("az")!=0;
if( aa ){ zCap[i++] = 'a'; }
if( ab ){ zCap[i++] = 'b'; }
if( ac ){ zCap[i++] = 'c'; }
if( ad ){ zCap[i++] = 'd'; }
if( ae ){ zCap[i++] = 'e'; }
if( af ){ zCap[i++] = 'f'; }
if( ah ){ zCap[i++] = 'h'; }
if( ag ){ zCap[i++] = 'g'; }
if( ai ){ zCap[i++] = 'i'; }
if( aj ){ zCap[i++] = 'j'; }
if( ak ){ zCap[i++] = 'k'; }
if( al ){ zCap[i++] = 'l'; }
if( am ){ zCap[i++] = 'm'; }
if( an ){ zCap[i++] = 'n'; }
if( ao ){ zCap[i++] = 'o'; }
if( ap ){ zCap[i++] = 'p'; }
if( ar ){ zCap[i++] = 'r'; }
if( as ){ zCap[i++] = 's'; }
if( at ){ zCap[i++] = 't'; }
|
| ︙ | ︙ | |||
410 411 412 413 414 415 416 | /* Load the existing information about the user, if any */ zLogin = ""; zInfo = ""; zCap = ""; zPw = ""; | | > | 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 |
/* Load the existing information about the user, if any
*/
zLogin = "";
zInfo = "";
zCap = "";
zPw = "";
oaa = oab = oac = oad = oae = oaf = oag = oah = oai = oaj = oak = oal = oam =
oan = oao = oap = oar = oas = oat = oau = oav = oaw = oax = oaz = "";
if( uid ){
zLogin = db_text("", "SELECT login FROM user WHERE uid=%d", uid);
zInfo = db_text("", "SELECT info FROM user WHERE uid=%d", uid);
zCap = db_text("", "SELECT cap FROM user WHERE uid=%d", uid);
zPw = db_text("", "SELECT pw FROM user WHERE uid=%d", uid);
if( strchr(zCap, 'a') ) oaa = " checked=\"checked\"";
if( strchr(zCap, 'b') ) oab = " checked=\"checked\"";
if( strchr(zCap, 'c') ) oac = " checked=\"checked\"";
if( strchr(zCap, 'd') ) oad = " checked=\"checked\"";
if( strchr(zCap, 'e') ) oae = " checked=\"checked\"";
if( strchr(zCap, 'f') ) oaf = " checked=\"checked\"";
if( strchr(zCap, 'g') ) oag = " checked=\"checked\"";
if( strchr(zCap, 'h') ) oah = " checked=\"checked\"";
if( strchr(zCap, 'i') ) oai = " checked=\"checked\"";
if( strchr(zCap, 'j') ) oaj = " checked=\"checked\"";
if( strchr(zCap, 'k') ) oak = " checked=\"checked\"";
if( strchr(zCap, 'l') ) oal = " checked=\"checked\"";
if( strchr(zCap, 'm') ) oam = " checked=\"checked\"";
if( strchr(zCap, 'n') ) oan = " checked=\"checked\"";
if( strchr(zCap, 'o') ) oao = " checked=\"checked\"";
if( strchr(zCap, 'p') ) oap = " checked=\"checked\"";
if( strchr(zCap, 'r') ) oar = " checked=\"checked\"";
if( strchr(zCap, 's') ) oas = " checked=\"checked\"";
if( strchr(zCap, 't') ) oat = " checked=\"checked\"";
|
| ︙ | ︙ | |||
522 523 524 525 526 527 528 |
}
@ <input type="checkbox" name="aa"%s(oaa) />%s(B('a'))Admin<br />
@ <input type="checkbox" name="ad"%s(oad) />%s(B('d'))Delete<br />
@ <input type="checkbox" name="ae"%s(oae) />%s(B('e'))Email<br />
@ <input type="checkbox" name="ap"%s(oap) />%s(B('p'))Password<br />
@ <input type="checkbox" name="ai"%s(oai) />%s(B('i'))Check-In<br />
@ <input type="checkbox" name="ao"%s(oao) />%s(B('o'))Check-Out<br />
| | > | 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 |
}
@ <input type="checkbox" name="aa"%s(oaa) />%s(B('a'))Admin<br />
@ <input type="checkbox" name="ad"%s(oad) />%s(B('d'))Delete<br />
@ <input type="checkbox" name="ae"%s(oae) />%s(B('e'))Email<br />
@ <input type="checkbox" name="ap"%s(oap) />%s(B('p'))Password<br />
@ <input type="checkbox" name="ai"%s(oai) />%s(B('i'))Check-In<br />
@ <input type="checkbox" name="ao"%s(oao) />%s(B('o'))Check-Out<br />
@ <input type="checkbox" name="ah"%s(oah) />%s(B('h'))Hyperlinks<br />
@ <input type="checkbox" name="al"%s(oal) />%s(B('l'))Links-deferred<br />
@ <input type="checkbox" name="au"%s(oau) />%s(B('u'))Reader<br />
@ <input type="checkbox" name="av"%s(oav) />%s(B('v'))Developer<br />
@ <input type="checkbox" name="ag"%s(oag) />%s(B('g'))Clone<br />
@ <input type="checkbox" name="aj"%s(oaj) />%s(B('j'))Read Wiki<br />
@ <input type="checkbox" name="af"%s(oaf) />%s(B('f'))New Wiki<br />
@ <input type="checkbox" name="am"%s(oam) />%s(B('m'))Append Wiki<br />
@ <input type="checkbox" name="ak"%s(oak) />%s(B('k'))Write Wiki<br />
|
| ︙ | ︙ | |||
623 624 625 626 627 628 629 | @ by anonymous users. This capability is intended for deletion of spam. @ The delete capability is only in effect for 24 hours after the item @ is first posted. The <span class="usertype">Setup</span> user can @ delete anything at any time. @ </p></li> @ @ <li><p> | | | > > | | | 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 | @ by anonymous users. This capability is intended for deletion of spam. @ The delete capability is only in effect for 24 hours after the item @ is first posted. The <span class="usertype">Setup</span> user can @ delete anything at any time. @ </p></li> @ @ <li><p> @ The <span class="capability">Hyperlinks</span> privilege allows a user @ to see most hyperlinks. This is recommended ON for most logged-in users @ but OFF for user "nobody" to avoid problems with spiders trying to walk @ every historical version of every baseline and file. The @ <span class="capability">Link-deferred</span> privilege enables hyperlinks @ using javascript, which makes them harder for bots and spiders to find. @ </p></li> @ @ <li><p> @ The <span class="capability">Zip</span> privilege allows a user to @ see the "download as ZIP" @ hyperlink and permits access to the <tt>/zip</tt> page. This allows @ users to download ZIP archives without granting other rights like @ <span class="capability">Read</span> or @ <span class="capability">Hyperlink</span>. The "z" privilege is recommended @ for user <span class="usertype">nobody</span> so that automatic package @ downloaders can obtain the sources without going through the login @ procedure. @ </p></li> @ @ <li><p> @ The <span class="capability">Check-in</span> privilege allows remote @ users to "push". The <span class="capability">Check-out</span> privilege |
| ︙ | ︙ | |||
702 703 704 705 706 707 708 | @ capabilities of the <span class="usertype">nobody</span> user are @ inherited by all users, regardless of whether or not they are logged in. @ To disable universal access to the repository, make sure no user named @ <span class="usertype">nobody</span> exists or that the @ <span class="usertype">nobody</span> user has no capabilities @ enabled. The password for <span class="usertype">nobody</span> is ignore. @ To avoid problems with spiders overloading the server, it is recommended | | | | 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 | @ capabilities of the <span class="usertype">nobody</span> user are @ inherited by all users, regardless of whether or not they are logged in. @ To disable universal access to the repository, make sure no user named @ <span class="usertype">nobody</span> exists or that the @ <span class="usertype">nobody</span> user has no capabilities @ enabled. The password for <span class="usertype">nobody</span> is ignore. @ To avoid problems with spiders overloading the server, it is recommended @ that the <span class="capability">h</span> (Hyperlinks) capability be @ turned off for the <span class="usertype">nobody</span> user. @ </p></li> @ @ <li><p> @ Login is required for user <span class="usertype">anonymous</span> but the @ password is displayed on the login screen beside the password entry box @ so anybody who can read should be able to login as anonymous. @ On the other hand, spiders and web-crawlers will typically not |
| ︙ | ︙ |
Changes to src/style.c.
| ︙ | ︙ | |||
43 44 45 46 47 48 49 50 51 52 53 54 55 56 | static int headerHasBeenGenerated = 0; /* ** remember, if a sidebox was used */ static int sideboxUsed = 0; /* ** Add a new element to the submenu */ void style_submenu_element( const char *zLabel, const char *zTitle, const char *zLink, | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
static int headerHasBeenGenerated = 0;
/*
** remember, if a sidebox was used
*/
static int sideboxUsed = 0;
/*
** List of hyperlinks that need to be resolved by javascript in
** the footer.
*/
char **aHref = 0;
int nHref = 0;
int nHrefAlloc = 0;
/*
** Generate and return a anchor tag like this:
**
** <a href="URL">
** or <a id="ID">
**
** The form of the anchor tag is determined by the g.perm.History
** variable. The href="URL" form is used if g.perm.History is true.
** If g.perm.History is false and g.perm.Link is true then the
** id="ID" form is used and javascript is generated in the footer to cause
** href values to be inserted after the page has loaded. If both
** g.perm.History and g.perm.Link are false, then the <a id="ID"> form is
** generated but the javascript is not generated so the links never
** activate.
**
** Handling the href="URL" using javascript is a defense against bots.
**
** The name of this routine is deliberately kept short so that can be
** easily used within @-lines. Example:
**
** @ %z(href("%s/artifact/%s",g.zTop,zUuid))%h(zFN)</a>
**
** Note %z format. The string returned by this function is always
** obtained from fossil_malloc().
**
** There are two versions of this routine href() does a plain hyperlink
** and xhref() adds extra attribute text.
*/
char *xhref(const char *zExtra, const char *zFormat, ...){
char *zUrl;
va_list ap;
va_start(ap, zFormat);
zUrl = vmprintf(zFormat, ap);
va_end(ap);
if( g.perm.History ){
return mprintf("<a %s href=\"%z\">", zExtra, zUrl);
}
if( nHref>=nHrefAlloc ){
nHrefAlloc = nHrefAlloc*2 + 10;
aHref = fossil_realloc(aHref, nHrefAlloc*sizeof(aHref[0]));
}
aHref[nHref++] = zUrl;
return mprintf("<a %s id=%d>", zExtra, nHref);
}
char *href(const char *zFormat, ...){
char *zUrl;
va_list ap;
va_start(ap, zFormat);
zUrl = vmprintf(zFormat, ap);
va_end(ap);
if( g.perm.History ){
return mprintf("<a href=\"%z\">", zUrl);
}
if( nHref>=nHrefAlloc ){
nHrefAlloc = nHrefAlloc*2 + 10;
aHref = fossil_realloc(aHref, nHrefAlloc*sizeof(aHref[0]));
}
aHref[nHref++] = zUrl;
return mprintf("<a id=%d>", nHref);
}
/*
** Generate javascript that will set the href= attribute on all anchors.
*/
void style_resolve_href(void){
int i;
if( !g.perm.Link || nHref==0 ) return;
@ <script>
for(i=0; i<nHref; i++){
@ document.getElementById(%d(i+1)).href="%s(aHref[i])";
}
@ </script>
}
/*
** Add a new element to the submenu
*/
void style_submenu_element(
const char *zLabel,
const char *zTitle,
const char *zLink,
|
| ︙ | ︙ | |||
162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
/* Render trace log if TH1 tracing is enabled. */
if( g.thTrace ){
cgi_append_content("<span class=\"thTrace\"><hr />\n", -1);
cgi_append_content(blob_str(&g.thLog), blob_size(&g.thLog));
cgi_append_content("</span>\n", -1);
}
}
/*
** Begin a side-box on the right-hand side of a page. The title and
** the width of the box are given as arguments. The width is usually
** a percentage of total screen width.
*/
| > > > | 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
/* Render trace log if TH1 tracing is enabled. */
if( g.thTrace ){
cgi_append_content("<span class=\"thTrace\"><hr />\n", -1);
cgi_append_content(blob_str(&g.thLog), blob_size(&g.thLog));
cgi_append_content("</span>\n", -1);
}
/* Set the href= field on hyperlinks */
style_resolve_href();
}
/*
** Begin a side-box on the right-hand side of a page. The title and
** the width of the box are given as arguments. The width is usually
** a percentage of total screen width.
*/
|
| ︙ | ︙ |
Changes to src/tag.c.
| ︙ | ︙ | |||
546 547 548 549 550 551 552 |
" AND tagtype=1)"
" AND tagname GLOB 'sym-*'"
" ORDER BY tagname"
);
@ <ul>
while( db_step(&q)==SQLITE_ROW ){
const char *zName = db_column_text(&q, 0);
| | | | 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 |
" AND tagtype=1)"
" AND tagname GLOB 'sym-*'"
" ORDER BY tagname"
);
@ <ul>
while( db_step(&q)==SQLITE_ROW ){
const char *zName = db_column_text(&q, 0);
if( g.perm.Hyperlink ){
@ <li>%z(xhref("class='taglink'","%R/timeline?t=%T",zName))
@ %h(zName)</a></li>
}else{
@ <li><span class="tagDsp">%h(zName)</span></li>
}
}
@ </ul>
db_finalize(&q);
|
| ︙ | ︙ |
Changes to src/timeline.c.
| ︙ | ︙ | |||
45 46 47 48 49 50 51 |
/*
** Generate a hyperlink to a version.
*/
void hyperlink_to_uuid(const char *zUuid){
char z[UUID_SIZE+1];
shorten_uuid(z, zUuid);
| | | | | | | | | | | | 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
/*
** Generate a hyperlink to a version.
*/
void hyperlink_to_uuid(const char *zUuid){
char z[UUID_SIZE+1];
shorten_uuid(z, zUuid);
if( g.perm.Hyperlink ){
@ %z(xhref("class='timelineHistLink'","%R/info/%s",z))[%s(z)]</a>
}else{
@ <span class="timelineHistDsp">[%s(z)]</span>
}
}
/*
** Generate a hyperlink to a diff between two versions.
*/
void hyperlink_to_diff(const char *zV1, const char *zV2){
if( g.perm.Hyperlink ){
if( zV2==0 ){
@ %z(href("%R/diff?v2=%s",zV1))[diff]</a>
}else{
@ %z(href("%R/diff?v1=%s&v2=%s",zV1,zV2))[diff]</a>
}
}
}
/*
** Generate a hyperlink to a date & time.
*/
void hyperlink_to_date(const char *zDate, const char *zSuffix){
if( zSuffix==0 ) zSuffix = "";
if( g.perm.Hyperlink ){
@ %z(href("%R/timeline?c=%T",zDate))%s(zDate)</a>%s(zSuffix)
}else{
@ %s(zDate)%s(zSuffix)
}
}
/*
** Generate a hyperlink to a user. This will link to a timeline showing
** events by that user. If the date+time is specified, then the timeline
** is centered on that date+time.
*/
void hyperlink_to_user(const char *zU, const char *zD, const char *zSuf){
if( zSuf==0 ) zSuf = "";
if( g.perm.Hyperlink ){
if( zD && zD[0] ){
@ %z(href("%R/timeline?c=%T&u=%T",zD,zU))%h(zU)</a>%s(zSuf)
}else{
@ %z(href("%R/timeline?u=%T",zU))%h(zU)</a>%s(zSuf)
}
}else{
@ %s(zU)
}
}
/*
|
| ︙ | ︙ | |||
351 352 353 354 355 356 357 |
}
blob_reset(&comment);
/* Generate the "user: USERNAME" at the end of the comment, together
** with a hyperlink to another timeline for that user.
*/
if( zTagList && zTagList[0]==0 ) zTagList = 0;
| | | < | < | | | | | | 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 |
}
blob_reset(&comment);
/* Generate the "user: USERNAME" at the end of the comment, together
** with a hyperlink to another timeline for that user.
*/
if( zTagList && zTagList[0]==0 ) zTagList = 0;
if( g.perm.Hyperlink && fossil_strcmp(zUser, zThisUser)!=0 ){
char *zLink = mprintf("%R/timeline?u=%h&c=%t&nd", zUser, zDate);
@ (user: %z(href("%z",zLink))%h(zUser)</a>%s(zTagList?",":"\051")
}else{
@ (user: %h(zUser)%s(zTagList?",":"\051")
}
/* Generate a "detail" link for tags. */
if( zType[0]=='g' && g.perm.Hyperlink ){
@ [%z(href("%R/info/%S",zUuid))details</a>]
}
/* Generate the "tags: TAGLIST" at the end of the comment, together
** with hyperlinks to the tag list.
*/
if( zTagList ){
if( g.perm.Hyperlink ){
int i;
const char *z = zTagList;
Blob links;
blob_zero(&links);
while( z && z[0] ){
for(i=0; z[i] && (z[i]!=',' || z[i+1]!=' '); i++){}
if( zThisTag==0 || memcmp(z, zThisTag, i)!=0 || zThisTag[i]!=0 ){
blob_appendf(&links,
"%z%#h</a>%.2s",
href("%R/timeline?r=%#t&nd&c=%s",i,z,zDate), i,z, &z[i]
);
}else{
blob_appendf(&links, "%#h", i+2, z);
}
if( z[i]==0 ) break;
z += i+2;
}
|
| ︙ | ︙ | |||
401 402 403 404 405 406 407 |
/* Generate extra hyperlinks at the end of the comment */
if( xExtra ){
xExtra(rid);
}
/* Generate the file-change list if requested */
| | | 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 |
/* Generate extra hyperlinks at the end of the comment */
if( xExtra ){
xExtra(rid);
}
/* Generate the file-change list if requested */
if( (tmFlags & TIMELINE_FCHANGES)!=0 && zType[0]=='c' && g.perm.Hyperlink ){
int inUl = 0;
if( !fchngQueryInit ){
db_prepare(&fchngQuery,
"SELECT (pid==0) AS isnew,"
" (fid==0) AS isdel,"
" (SELECT name FROM filename WHERE fnid=mlink.fnid) AS name,"
" (SELECT uuid FROM blob WHERE rid=fid),"
|
| ︙ | ︙ | |||
431 432 433 434 435 436 437 |
const char *zNew = db_column_text(&fchngQuery, 3);
if( !inUl ){
@ <ul class="filelist">
inUl = 1;
}
if( isNew ){
@ <li> %h(zFilename) (new file)
| | | | | | | | 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 |
const char *zNew = db_column_text(&fchngQuery, 3);
if( !inUl ){
@ <ul class="filelist">
inUl = 1;
}
if( isNew ){
@ <li> %h(zFilename) (new file)
@ %z(xhref("target='diffwindow'","%R/artifact/%S",zNew))
@ [view]</a></li>
}else if( isDel ){
@ <li> %h(zFilename) (deleted)</li>
}else if( fossil_strcmp(zOld,zNew)==0 && zOldName!=0 ){
@ <li> %h(zOldName) → %h(zFilename)
@ %z(xhref("target='diffwindow'","%R/artifact/%S",zNew))
@ [view]</a></li>
}else{
if( zOldName!=0 ){
@ <li> %h(zOldName) → %h(zFilename)
}else{
@ <li> %h(zFilename)
}
@ %z(xhref("target='diffwindow'","%R/fdiff?v1=%S&v2=%S",zOld,zNew))
@ [diff]</a></li>
}
}
db_reset(&fchngQuery);
if( inUl ){
@ </ul>
}
}
|
| ︙ | ︙ | |||
972 973 974 975 976 977 978 |
while( p ){
blob_appendf(&sql, ",%d", p->rid);
p = p->u.pTo;
}
blob_append(&sql, ")", -1);
path_reset();
blob_append(&desc, "All nodes on the path from ", -1);
| < < < | < < < < | < | 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 |
while( p ){
blob_appendf(&sql, ",%d", p->rid);
p = p->u.pTo;
}
blob_append(&sql, ")", -1);
path_reset();
blob_append(&desc, "All nodes on the path from ", -1);
blob_appendf(&desc, "%z%h</a>", href("%R/info/%h", zFrom), zFrom);
blob_append(&desc, " and ", -1);
blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h",zTo), zTo);
tmFlags |= TIMELINE_DISJOINT;
db_multi_exec("%s", blob_str(&sql));
}else if( (p_rid || d_rid) && g.perm.Read ){
/* If p= or d= is present, ignore all other parameters other than n= */
char *zUuid;
int np, nd;
|
| ︙ | ︙ | |||
1019 1020 1021 1022 1023 1024 1025 |
if( np>0 ){
if( nd>0 ) blob_appendf(&desc, " and ");
blob_appendf(&desc, "%d ancestors", np);
db_multi_exec("%s", blob_str(&sql));
}
if( d_rid==0 && useDividers ) timeline_add_dividers(0, p_rid);
}
| < | | < < < < < < < | < | 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 |
if( np>0 ){
if( nd>0 ) blob_appendf(&desc, " and ");
blob_appendf(&desc, "%d ancestors", np);
db_multi_exec("%s", blob_str(&sql));
}
if( d_rid==0 && useDividers ) timeline_add_dividers(0, p_rid);
}
blob_appendf(&desc, " of %z[%.10s]</a>",
href("%R/info/%s", zUuid), zUuid);
}else if( f_rid && g.perm.Read ){
/* If f= is present, ignore all other parameters other than n= */
char *zUuid;
db_multi_exec(
"CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY);"
"INSERT INTO ok VALUES(%d);"
"INSERT OR IGNORE INTO ok SELECT pid FROM plink WHERE cid=%d;"
"INSERT OR IGNORE INTO ok SELECT cid FROM plink WHERE pid=%d;",
f_rid, f_rid, f_rid
);
blob_appendf(&sql, " AND event.objid IN ok");
db_multi_exec("%s", blob_str(&sql));
if( useDividers ) timeline_add_dividers(0, f_rid);
blob_appendf(&desc, "Parents and children of check-in ");
zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid);
blob_appendf(&desc, "%z[%.10s]</a>", href("%R/info/%s", zUuid), zUuid);
}else{
/* Otherwise, a timeline based on a span of time */
int n;
const char *zEType = "timeline item";
char *zDate;
char *zNEntry = mprintf("%d", nEntry);
url_add_parameter(&url, "n", zNEntry);
|
| ︙ | ︙ | |||
1217 1218 1219 1220 1221 1222 1223 |
blob_appendf(&desc, " occurring on or before %h.<br />", zBefore);
}else if( zCirca ){
blob_appendf(&desc, " occurring around %h.<br />", zCirca);
}
if( zSearch ){
blob_appendf(&desc, " matching \"%h\"", zSearch);
}
| | | 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 |
blob_appendf(&desc, " occurring on or before %h.<br />", zBefore);
}else if( zCirca ){
blob_appendf(&desc, " occurring around %h.<br />", zCirca);
}
if( zSearch ){
blob_appendf(&desc, " matching \"%h\"", zSearch);
}
if( g.perm.Hyperlink ){
if( zAfter || n==nEntry ){
zDate = db_text(0, "SELECT min(timestamp) FROM timeline /*scan*/");
timeline_submenu(&url, "Older", "b", zDate, "a");
free(zDate);
}
if( zBefore || (zAfter && n==nEntry) ){
zDate = db_text(0, "SELECT max(timestamp) FROM timeline /*scan*/");
|
| ︙ | ︙ | |||
1621 1622 1623 1624 1625 1626 1627 |
/*
** WEBPAGE: test_timewarps
*/
void test_timewarp_page(void){
Stmt q;
login_check_credentials();
| | | 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 |
/*
** WEBPAGE: test_timewarps
*/
void test_timewarp_page(void){
Stmt q;
login_check_credentials();
if( !g.perm.Read || !g.perm.Hyperlink ){ login_needed(); return; }
style_header("Instances of timewarp");
@ <ul>
db_prepare(&q,
"SELECT blob.uuid "
" FROM plink p, plink c, blob"
" WHERE p.cid=c.pid AND p.mtime>c.mtime"
" AND blob.rid=c.cid"
|
| ︙ | ︙ |
Changes to src/tkt.c.
| ︙ | ︙ | |||
303 304 305 306 307 308 309 |
login_check_credentials();
if( !g.perm.RdTkt ){ login_needed(); return; }
if( g.perm.WrTkt || g.perm.ApndTkt ){
style_submenu_element("Edit", "Edit The Ticket", "%s/tktedit?name=%T",
g.zTop, PD("name",""));
}
| | | 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 |
login_check_credentials();
if( !g.perm.RdTkt ){ login_needed(); return; }
if( g.perm.WrTkt || g.perm.ApndTkt ){
style_submenu_element("Edit", "Edit The Ticket", "%s/tktedit?name=%T",
g.zTop, PD("name",""));
}
if( g.perm.Hyperlink ){
style_submenu_element("History", "History Of This Ticket",
"%s/tkthistory/%T", g.zTop, zUuid);
style_submenu_element("Timeline", "Timeline Of This Ticket",
"%s/tkttimeline/%T", g.zTop, zUuid);
style_submenu_element("Check-ins", "Check-ins Of This Ticket",
"%s/tkttimeline/%T?y=ci", g.zTop, zUuid);
}
|
| ︙ | ︙ | |||
351 352 353 354 355 356 357 |
const char *zUser = db_column_text(&q, 2);
if( cnt==0 ){
@ <hr /><h2>Attachments:</h2>
@ <ul>
}
cnt++;
@ <li>
| | | | | 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 |
const char *zUser = db_column_text(&q, 2);
if( cnt==0 ){
@ <hr /><h2>Attachments:</h2>
@ <ul>
}
cnt++;
@ <li>
if( g.perm.Read && g.perm.Hyperlink ){
@ %z(href("%R/attachview?tkt=%s&file=%t",zFullName,zFile))
@ %h(zFile)</a>
}else{
@ %h(zFile)
}
@ added by %h(zUser) on
hyperlink_to_date(zDate, ".");
if( g.perm.WrTkt && g.perm.Attach ){
@ [%z(href("%R/attachdelete?tkt=%s&file=%t&from=%R/tktview%%3fname=%s",zFullName,zFile,zFullName))delete</a>]
}
@ </li>
}
if( cnt ){
@ </ul>
}
db_finalize(&q);
|
| ︙ | ︙ | |||
660 661 662 663 664 665 666 | const char *zUuid; char *zFullUuid; int tagid; char zGlobPattern[50]; const char *zType; login_check_credentials(); | | | 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 |
const char *zUuid;
char *zFullUuid;
int tagid;
char zGlobPattern[50];
const char *zType;
login_check_credentials();
if( !g.perm.Hyperlink || !g.perm.RdTkt ){ login_needed(); return; }
zUuid = PD("name","");
zType = PD("y","a");
if( zType[0]!='c' ){
style_submenu_element("Check-ins", "Check-ins",
"%s/tkttimeline?name=%T&y=ci", g.zTop, zUuid);
}else{
style_submenu_element("Timeline", "Timeline",
|
| ︙ | ︙ | |||
734 735 736 737 738 739 740 |
void tkthistory_page(void){
Stmt q;
char *zTitle;
const char *zUuid;
int tagid;
login_check_credentials();
| | | 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 |
void tkthistory_page(void){
Stmt q;
char *zTitle;
const char *zUuid;
int tagid;
login_check_credentials();
if( !g.perm.Hyperlink || !g.perm.RdTkt ){ login_needed(); return; }
zUuid = PD("name","");
zTitle = mprintf("History Of Ticket %h", zUuid);
style_submenu_element("Status", "Status",
"%s/info/%s", g.zTop, zUuid);
style_submenu_element("Check-ins", "Check-ins",
"%s/tkttimeline?name=%s&y=ci", g.zTop, zUuid);
style_submenu_element("Timeline", "Timeline",
|
| ︙ | ︙ | |||
784 785 786 787 788 789 790 |
if( zSrc==0 || zSrc[0]==0 ){
@
@ <p>Delete attachment "%h(zFile)"
}else{
@
@ <p>Add attachment "%h(zFile)"
}
| | | | 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 |
if( zSrc==0 || zSrc[0]==0 ){
@
@ <p>Delete attachment "%h(zFile)"
}else{
@
@ <p>Add attachment "%h(zFile)"
}
@ [%z(href("%R/artifact/%T",zChngUuid))%s(zShort)</a>]
@ (rid %d(rid)) by
hyperlink_to_user(zUser,zDate," on");
hyperlink_to_date(zDate, ".</p>");
}else{
pTicket = manifest_get(rid, CFTYPE_TICKET);
if( pTicket ){
@
@ <p>Ticket change
@ [%z(href("%R/artifact/%T",zChngUuid))%s(zShort)</a>]
@ (rid %d(rid)) by
hyperlink_to_user(pTicket->zUser,zDate," on");
hyperlink_to_date(zDate, ":");
@ </p>
ticket_output_change_artifact(pTicket);
}
manifest_destroy(pTicket);
|
| ︙ | ︙ |
Changes to src/wiki.c.
| ︙ | ︙ | |||
102 103 104 105 106 107 108 |
g.isHome = 1;
wiki_page();
return;
}
style_header("Home");
@ <p>This is a stub home-page for the project.
@ To fill in this page, first go to
| | | 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
g.isHome = 1;
wiki_page();
return;
}
style_header("Home");
@ <p>This is a stub home-page for the project.
@ To fill in this page, first go to
@ %z(href("%R/setup_config"))setup/config</a>
@ and establish a "Project Name". Then create a
@ wiki page with that name. The content of that wiki page
@ will be displayed in place of this message.</p>
style_footer();
}
/*
|
| ︙ | ︙ | |||
140 141 142 143 144 145 146 |
if( !g.perm.RdWiki ){ login_needed(); return; }
zPageName = P("name");
if( zPageName==0 ){
style_header("Wiki");
@ <ul>
{ char *zHomePageName = db_get("project-name",0);
if( zHomePageName ){
| | | < | < | | | | | 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
if( !g.perm.RdWiki ){ login_needed(); return; }
zPageName = P("name");
if( zPageName==0 ){
style_header("Wiki");
@ <ul>
{ char *zHomePageName = db_get("project-name",0);
if( zHomePageName ){
@ <li> %z(href("%R/wiki?name=%t",zHomePageName))
@ %h(zHomePageName)</a> wiki home page.</li>
}
}
@ <li> %z(href("%R/timeline?y=w"))Recent changes</a> to wiki pages.</li>
@ <li> %z(href("%R/wiki_rules"))Formatting rules</a> for wiki.</li>
@ <li> Use the %z(href("%R/wiki?name=Sandbox"))Sandbox</a>
@ to experiment.</li>
if( g.perm.NewWiki ){
@ <li> Create a %z(href("%R/wikinew"))new wiki page</a>.</li>
if( g.perm.Write ){
@ <li> Create a %z(href("%R/eventedit"))new event</a>.</li>
}
}
@ <li> %z(href("%R/wcontent"))List of All Wiki Pages</a>
@ available on this server.</li>
@ <li> <form method="get" action="%s(g.zTop)/wfind"><div>
@ Search wiki titles: <input type="text" name="title"/>
@ <input type="submit" /></div></form>
@ </li>
@ </ul>
style_footer();
|
| ︙ | ︙ | |||
197 198 199 200 201 202 203 |
"%s/attachadd?page=%T&from=%s/wiki%%3fname=%T",
g.zTop, zPageName, g.zTop, zPageName);
}
if( rid && g.perm.ApndWiki ){
style_submenu_element("Append", "Add A Comment", "%s/wikiappend?name=%T",
g.zTop, zPageName);
}
| | | 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
"%s/attachadd?page=%T&from=%s/wiki%%3fname=%T",
g.zTop, zPageName, g.zTop, zPageName);
}
if( rid && g.perm.ApndWiki ){
style_submenu_element("Append", "Add A Comment", "%s/wikiappend?name=%T",
g.zTop, zPageName);
}
if( g.perm.Hyperlink ){
style_submenu_element("History", "History", "%s/whistory?name=%T",
g.zTop, zPageName);
}
}
style_header(zPageName);
blob_init(&wiki, zBody, -1);
wiki_convert(&wiki, 0, 0);
|
| ︙ | ︙ | |||
223 224 225 226 227 228 229 |
const char *zUser = db_column_text(&q, 2);
if( cnt==0 ){
@ <hr /><h2>Attachments:</h2>
@ <ul>
}
cnt++;
@ <li>
| | | | | 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
const char *zUser = db_column_text(&q, 2);
if( cnt==0 ){
@ <hr /><h2>Attachments:</h2>
@ <ul>
}
cnt++;
@ <li>
if( g.perm.Hyperlink && g.perm.Read ){
@ %z(href("%R/attachview?page=%T&file=%t",zPageName,zFile))
@ %h(zFile)</a>
}else{
@ %h(zFile)
}
@ added by %h(zUser) on
hyperlink_to_date(zDate, ".");
if( g.perm.WrWiki && g.perm.Attach ){
@ [%z(href("%R/attachdelete?page=%t&file=%t&from=%R/wiki%%3fname=%f",zPageName,zFile,zPageName))delete</a>]
}
@ </li>
}
if( cnt ){
@ </ul>
}
db_finalize(&q);
|
| ︙ | ︙ | |||
542 543 544 545 546 547 548 |
/*
** Function called to output extra text at the end of each line in
** a wiki history listing.
*/
static void wiki_history_extra(int rid){
if( db_exists("SELECT 1 FROM tagxref WHERE rid=%d", rid) ){
| | | | 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 |
/*
** Function called to output extra text at the end of each line in
** a wiki history listing.
*/
static void wiki_history_extra(int rid){
if( db_exists("SELECT 1 FROM tagxref WHERE rid=%d", rid) ){
@ %z(href("%R/wdiff?name=%t&a=%d",zWikiPageName,rid))[diff]</a>
}
}
/*
** WEBPAGE: whistory
** URL: /whistory?name=PAGENAME
**
** Show the complete change history for a single wiki page.
*/
void whistory_page(void){
Stmt q;
char *zTitle;
char *zSQL;
const char *zPageName;
login_check_credentials();
if( !g.perm.Hyperlink ){ login_needed(); return; }
zPageName = PD("name","");
zTitle = mprintf("History Of %s", zPageName);
style_header(zTitle);
free(zTitle);
zSQL = mprintf("%s AND event.objid IN "
" (SELECT rid FROM tagxref WHERE tagid="
|
| ︙ | ︙ | |||
595 596 597 598 599 600 601 |
const char *zPageName;
Manifest *pW1, *pW2 = 0;
Blob w1, w2, d;
int diffFlags;
login_check_credentials();
rid1 = atoi(PD("a","0"));
| | | 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 |
const char *zPageName;
Manifest *pW1, *pW2 = 0;
Blob w1, w2, d;
int diffFlags;
login_check_credentials();
rid1 = atoi(PD("a","0"));
if( !g.perm.Hyperlink ){ login_needed(); return; }
if( rid1==0 ) fossil_redirect_home();
rid2 = atoi(PD("b","0"));
zPageName = PD("name","");
zTitle = mprintf("Changes To %s", zPageName);
style_header(zTitle);
free(zTitle);
|
| ︙ | ︙ | |||
672 673 674 675 676 677 678 |
}
@ <ul>
wiki_prepare_page_list(&q);
while( db_step(&q)==SQLITE_ROW ){
const char *zName = db_column_text(&q, 0);
int size = db_column_int(&q, 1);
if( size>0 ){
| | | | 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 |
}
@ <ul>
wiki_prepare_page_list(&q);
while( db_step(&q)==SQLITE_ROW ){
const char *zName = db_column_text(&q, 0);
int size = db_column_int(&q, 1);
if( size>0 ){
@ <li>%z(href("%R/wiki?name=%T",zName))%h(zName)</a></li>
}else if( showAll ){
@ <li>%z(href("%R/wiki?name=%T",zName))<s>%h(zName)</s></a></li>
}
}
db_finalize(&q);
@ </ul>
style_footer();
}
|
| ︙ | ︙ | |||
702 703 704 705 706 707 708 |
@ <ul>
db_prepare(&q,
"SELECT substr(tagname, 6, 1000) FROM tag WHERE tagname like 'wiki-%%%q%%'"
" ORDER BY lower(tagname) /*sort*/" ,
zTitle);
while( db_step(&q)==SQLITE_ROW ){
const char *zName = db_column_text(&q, 0);
| | | 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 |
@ <ul>
db_prepare(&q,
"SELECT substr(tagname, 6, 1000) FROM tag WHERE tagname like 'wiki-%%%q%%'"
" ORDER BY lower(tagname) /*sort*/" ,
zTitle);
while( db_step(&q)==SQLITE_ROW ){
const char *zName = db_column_text(&q, 0);
@ <li>%z(href("%R/wiki?name=%T",zName))%h(zName)</a></li>
}
db_finalize(&q);
@ </ul>
style_footer();
}
/*
|
| ︙ | ︙ |
Changes to src/wikiformat.c.
| ︙ | ︙ | |||
1047 1048 1049 1050 1051 1052 1053 |
}else if( zTarget[0]=='/' ){
if( 1 /* g.perm.History */ ){
blob_appendf(p->pOut, "<a href=\"%s%h\">", g.zTop, zTarget);
}else{
zTerm = "";
}
}else if( zTarget[0]=='.' || zTarget[0]=='#' ){
| | | | | | | < < | | | 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 |
}else if( zTarget[0]=='/' ){
if( 1 /* g.perm.History */ ){
blob_appendf(p->pOut, "<a href=\"%s%h\">", g.zTop, zTarget);
}else{
zTerm = "";
}
}else if( zTarget[0]=='.' || zTarget[0]=='#' ){
if( 1 ){
blob_appendf(p->pOut, "<a href=\"%h\">", zTarget);
}else{
zTerm = "";
}
}else if( is_valid_uuid(zTarget) ){
int isClosed = 0;
if( is_ticket(zTarget, &isClosed) ){
/* Special display processing for tickets. Display the hyperlink
** as crossed out if the ticket is closed.
*/
if( isClosed ){
if( g.perm.Hyperlink ){
blob_appendf(p->pOut,
"%z<span class=\"wikiTagCancelled\">[",
href("%R/info/%s",zTarget)
);
zTerm = "]</span></a>";
}else{
blob_appendf(p->pOut,"<span class=\"wikiTagCancelled\">[");
zTerm = "]</span>";
}
}else{
if( g.perm.Hyperlink ){
blob_appendf(p->pOut,"%z[", href("%R/info/%s", zTarget));
zTerm = "]</a>";
}else{
blob_appendf(p->pOut, "[");
zTerm = "]";
}
}
}else if( !in_this_repo(zTarget) ){
blob_appendf(p->pOut, "<span class=\"brokenlink\">[", zTarget);
zTerm = "]</span>";
}else if( g.perm.Hyperlink ){
blob_appendf(p->pOut, "%z[",href("%R/info/%s", zTarget));
zTerm = "]</a>";
}
}else if( strlen(zTarget)>=10 && fossil_isdigit(zTarget[0]) && zTarget[4]=='-'
&& db_int(0, "SELECT datetime(%Q) NOT NULL", zTarget) ){
blob_appendf(p->pOut, "<a href=\"%s/timeline?c=%T\">", g.zTop, zTarget);
}else if( strncmp(zTarget, "wiki:", 5)==0
&& wiki_name_is_wellformed((const unsigned char*)zTarget) ){
|
| ︙ | ︙ |