589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
|
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
|
-
+
|
@ </pre></blockquote>
@ </p>
table_of_public_phantoms();
@ </li>
}
@ </ol>
style_finish_page("secaudit");
style_finish_page();
}
/*
** WEBPAGE: takeitprivate
**
** Disable anonymous access to this website
*/
|
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
|
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
|
-
+
|
@ <p>Click the "Cancel" button to leave things as they are.</p>
@
@ <form action="%s(g.zPath)" method="post">
@ <input type="submit" name="apply" value="Make It Private">
@ <input type="submit" name="cancel" value="Cancel">
@ </form>
style_finish_page("takeitprivate");
style_finish_page();
}
/*
** The maximum number of bytes of log to show
*/
#define MXSHOWLOG 50000
|
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
|
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
|
-
+
-
+
-
+
-
+
|
@ </pre></blockquote>
@ <li><p>
@ If the server is running using one of
@ the "fossil http" or "fossil server" commands then add
@ a command-line option "--errorlog <i>FILENAME</i>" to that
@ command.
@ </ol>
style_finish_page("errorlog");
style_finish_page();
return;
}
if( P("truncate1") && cgi_csrf_safe(1) ){
fclose(fopen(g.zErrlog,"w"));
}
if( P("download") ){
Blob log;
blob_read_from_file(&log, g.zErrlog, ExtFILE);
cgi_set_content_type("text/plain");
cgi_set_content(&log);
return;
}
szFile = file_size(g.zErrlog, ExtFILE);
if( P("truncate") ){
@ <form action="%R/errorlog" method="POST">
@ <p>Confirm that you want to truncate the %,lld(szFile)-byte error log:
@ <input type="submit" name="truncate1" value="Confirm">
@ <input type="submit" name="cancel" value="Cancel">
@ </form>
style_finish_page("errorlog");
style_finish_page();
return;
}
@ <p>The server error log at "%h(g.zErrlog)" is %,lld(szFile) bytes in size.
style_submenu_element("Download", "%R/errorlog?download");
style_submenu_element("Truncate", "%R/errorlog?truncate");
in = fossil_fopen(g.zErrlog, "rb");
if( in==0 ){
@ <p class='generalError'>Unable to open that file for reading!</p>
style_finish_page("errorlog");
style_finish_page();
return;
}
if( szFile>MXSHOWLOG && P("all")==0 ){
@ <form action="%R/errorlog" method="POST">
@ <p>Only the last %,d(MXSHOWLOG) bytes are shown.
@ <input type="submit" name="all" value="Show All">
@ </form>
fseek(in, -MXSHOWLOG, SEEK_END);
}
@ <hr>
@ <pre>
while( fgets(z, sizeof(z), in) ){
@ %h(z)\
}
fclose(in);
@ </pre>
style_finish_page("errorlog");
style_finish_page();
}
|