74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
"Configure the trouble-ticketing system for this repository");
setup_menu_entry("CSS", "setup_editcss",
"Edit the Cascading Style Sheet used by all pages of this repository");
setup_menu_entry("Header", "setup_header",
"Edit HTML text inserted at the top of every page");
setup_menu_entry("Footer", "setup_footer",
"Edit HTML text inserted at the bottom of every page");
setup_menu_entry("Shunned", "shun",
"Show artifacts that are shunned by this repository");
setup_menu_entry("Log", "rcvfromlist",
"A record of received artifacts and their sources");
setup_menu_entry("Stats", "stat",
"Display repository statistics");
@ </table>
|
>
>
|
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
"Configure the trouble-ticketing system for this repository");
setup_menu_entry("CSS", "setup_editcss",
"Edit the Cascading Style Sheet used by all pages of this repository");
setup_menu_entry("Header", "setup_header",
"Edit HTML text inserted at the top of every page");
setup_menu_entry("Footer", "setup_footer",
"Edit HTML text inserted at the bottom of every page");
setup_menu_entry("Logo", "setup_logo",
"Change the logo image for the server");
setup_menu_entry("Shunned", "shun",
"Show artifacts that are shunned by this repository");
setup_menu_entry("Log", "rcvfromlist",
"A record of received artifacts and their sources");
setup_menu_entry("Stats", "stat",
"Display repository statistics");
@ </table>
|
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
|
@ <input type="submit" name="clear" value="Revert To Default">
@ </form>
@ <hr>
@ Here is the default page footer:
@ <blockquote><pre>
@ %h(zDefaultFooter)
@ </pre></blockquote>
style_footer();
db_end_transaction(0);
}
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
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
1041
1042
1043
1044
1045
1046
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
|
@ <input type="submit" name="clear" value="Revert To Default">
@ </form>
@ <hr>
@ Here is the default page footer:
@ <blockquote><pre>
@ %h(zDefaultFooter)
@ </pre></blockquote>
style_footer();
db_end_transaction(0);
}
/*
** WEBPAGE: setup_logo
*/
void setup_logo(void){
const char *zMime = "image/gif";
const char *aImg = P("im");
int szImg = atoi(PD("im:bytes","0"));
if( szImg>0 ){
zMime = PD("im:mimetype","image/gif");
}
login_check_credentials();
if( !g.okSetup ){
login_needed();
}
db_begin_transaction();
if( P("set")!=0 && zMime && zMime[0] && szImg>0 ){
Blob img;
Stmt ins;
blob_init(&img, aImg, szImg);
db_prepare(&ins,
"REPLACE INTO config(name, value)"
" VALUES('logo-image',:bytes)"
);
db_bind_blob(&ins, ":bytes", &img);
db_step(&ins);
db_finalize(&ins);
db_multi_exec(
"REPLACE INTO config(name, value) VALUES('logo-mimetype',%Q)",
zMime
);
}else if( P("clr")!=0 ){
db_multi_exec(
"DELETE FROM config WHERE name GLOB 'logo-*'"
);
}
style_header("Edit Project Logo");
@ <p>The current project logo has a MIME-Type of <b>%h(zMime)</b> and looks
@ like this:</p>
@ <blockquote><img src="/logo" alt="logo"></blockquote>
@
@ <form action="%s(g.zBaseURL)/setup_logo" method="POST"
@ enctype="multipart/form-data">
@ <p>The logo is accessible to all users at this URL:
@ <a href="%s(g.zBaseURL)/logo">%s(g.zBaseURL)/logo</a>.
@ To set a new logo image, select a file to use as the logo using
@ the entry box below and then press the "Change Logo" button.</p>
login_insert_csrf_secret();
@ Logo Image file:
@ <input type="file" name="im" size="60" accepts="image/*"><br>
@ <input type="submit" name="set" value="Change Logo">
@ <input type="submit" name="clr" value="Revert To Default">
@ </form>
style_footer();
db_end_transaction(0);
}
|