403
404
405
406
407
408
409
410
411
412
413
414
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
448
449
450
451
452
453
454
455
456
457
|
db_unprotect(PROTECT_ALL);
db_set("ssh-command", g.zSshCmd, 0);
db_protect_pop();
}
}
/*
** WEBPAGE: download
**
** Provide a simple page that enables newbies to download the latest tarball or
** ZIP archive, and provides instructions on how to clone.
*/
void download_page(void){
login_check_credentials();
cgi_check_for_malice();
style_header("Download Page");
if( !g.perm.Zip ){
@ <p>Bummer. You do not have permission to download.
if( g.zLogin==0 || g.zLogin[0]==0 ){
@ Maybe it would work better if you
@ %z(href("%R/login"))logged in</a>.
}else{
@ Contact the site administrator and ask them to give
@ you "Download Zip" privileges.
}
}else{
const char *zDLTag = db_get("download-tag","trunk");
const char *zNm = db_get("short-project-name","download");
char *zUrl = href("%R/zip/%t/%t.zip", zDLTag, zNm);
@ <p>ZIP Archive: %z(zUrl)%h(zNm).zip</a>
zUrl = href("%R/tarball/%t/%t.tar.gz", zDLTag, zNm);
@ <p>Tarball: %z(zUrl)%h(zNm).tar.gz</a>
if( g.zLogin!=0 ){
zUrl = href("%R/sqlar/%t/%t.sqlar", zDLTag, zNm);
@ <p>SQLite Archive: %z(zUrl)%h(zNm).sqlar</a>
}
}
if( !g.perm.Clone ){
@ <p>You are not authorized to clone this repository.
if( g.zLogin==0 || g.zLogin[0]==0 ){
@ Maybe you would be able to clone if you
@ %z(href("%R/login"))logged in</a>.
}else{
@ Contact the site administrator and ask them to give
@ you "Clone" privileges in order to clone.
}
}else{
const char *zNm = db_get("short-project-name","clone");
@ <p>Clone the repository using this command:
@ <blockquote><pre>
@ fossil clone %s(g.zBaseURL) %h(zNm).fossil
@ </pre></blockquote>
}
style_finish_page();
}
|
|
<
|
|
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
>
>
|
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
|
db_unprotect(PROTECT_ALL);
db_set("ssh-command", g.zSshCmd, 0);
db_protect_pop();
}
}
/*
** WEBPAGE: howtoclone
**
** Provide instructions on how to clone this repository.
*/
void howtoclone_page(void){
login_check_credentials();
cgi_check_for_malice();
style_header("How To Clone This Repository");
if( !g.perm.Clone ){
@ <p>You are not authorized to clone this repository.
if( g.zLogin==0 || g.zLogin[0]==0 ){
@ Maybe you would be able to clone if you
@ %z(href("%R/login"))logged in</a>.
}else{
@ Contact the site administrator and ask them to give
@ you "Clone" privileges in order to clone.
}
}else{
const char *zNm = db_get("short-project-name","clone");
@ <p>Clone this repository by running a command like the following:
@ <blockquote><pre>
@ fossil clone %s(g.zBaseURL) %h(zNm).fossil
@ </pre></blockquote>
@ <p>Do a web search for "fossil clone" or similar to find additional
@ information about using a cloned Fossil repository.
}
style_finish_page();
}
|