From: Wilfried Göesgens Date: Tue, 2 Sep 2008 12:38:58 +0000 (+0000) Subject: * move serverrestart to templates X-Git-Tag: v7.86~1974 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=a10ba3853dbe320fd66cec0e4df40c9cf988ff3f;p=citadel.git * move serverrestart to templates * make it return to the aide menu instead of knrooms --- diff --git a/webcit/mainmenu.c b/webcit/mainmenu.c index 816c5683f..5693329b0 100644 --- a/webcit/mainmenu.c +++ b/webcit/mainmenu.c @@ -357,75 +357,60 @@ void display_shutdown(void) char *when; when=bstr("when"); - if (!strcmp(when, "now")){ + if (strcmp(when, "now") == 0){ serv_printf("DOWN 1"); serv_getln(buf, sizeof buf); if (atol(buf) == 500) { /* upsie. maybe the server is not running as daemon? */ - wprintf("Attention: %s", &buf[4]); - - } - else { - wprintf("\n" - "\n" - "\n" - "\n" - "\n" - " %s " - "\n\n", - _("Please wait while the Citadel server is restarted... ") - ); + + safestrncpy(WC->ImportantMessage, + &buf[4], + sizeof WC->ImportantMessage); } - wDumpContent(0); + begin_burst(); + output_headers(1, 0, 0, 0, 1, 0); + DoTemplate(HKEY("display_serverrestart"), NULL, NULL); + end_burst(); lingering_close(WC->http_sock); sleeeeeeeeeep(10); serv_printf("NOOP"); serv_printf("NOOP"); } - else if (!strcmp(when, "page")) { + else if (strcmp(when, "page") == 0) { char *message; message = bstr("message"); if ((message == NULL) || (IsEmptyStr(message))) { - output_headers(1, 1, 1, 0, 0, 0); - svput("BOXTITLE", WCS_STRING, _("Message to your Users:")); - do_template("beginbox", NULL); - wprintf("
\n" - "\n" - "\n" - "\n" - "
\n", - _("The citadel server has to be restarted. It 'll be back in a minute.") - ); - do_template("endbox", NULL); - wDumpContent(1); - - + begin_burst(); + output_headers(1, 0, 0, 0, 1, 0); + DoTemplate(HKEY("display_serverrestartpage"), NULL, NULL); + end_burst(); } else { - // TODO: page the users... wait longer... serv_printf("SEXP broadcast|%s", message); serv_getln(buf, sizeof buf); // should we care? - wprintf("\n" - "\n" - "\n" - "\n" - "\n" - " %s " - "\n\n", - _("Please wait while your users are being paged, the citadel server will be restarted after that... ")); - + begin_burst(); + output_headers(1, 0, 0, 0, 1, 0); + DoTemplate(HKEY("display_serverrestartpagedo"), NULL, NULL); + end_burst(); } } else if (!strcmp(when, "idle")) { serv_printf("SCDN 3"); serv_getln(buf, sizeof buf); - if (atol(buf) == 500) { - /* oops ... maybe the server is not running as a daemon? */ - wprintf("Attention: %s", &buf[4]); + + if (atol(buf) == 500) + { /* upsie. maybe the server is not running as daemon? */ + safestrncpy(WC->ImportantMessage, + &buf[4], + sizeof WC->ImportantMessage); } + begin_burst(); + output_headers(1, 0, 0, 0, 1, 0); + DoTemplate(HKEY("display_aide_menu"), NULL, NULL); + end_burst(); } } diff --git a/webcit/static/t/box_serverrestart.html b/webcit/static/t/box_serverrestart.html new file mode 100644 index 000000000..d09bfb3b4 --- /dev/null +++ b/webcit/static/t/box_serverrestart.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/webcit/static/t/box_serverrestartpage.html b/webcit/static/t/box_serverrestartpage.html new file mode 100644 index 000000000..c6ffba0bb --- /dev/null +++ b/webcit/static/t/box_serverrestartpage.html @@ -0,0 +1,24 @@ +
+
+
+
+
+ + + +
+
+
+
+ +
+
+
+
+
+
+
+
+
+ +
diff --git a/webcit/static/t/box_serverrestartpagedo.html b/webcit/static/t/box_serverrestartpagedo.html new file mode 100644 index 000000000..971de7411 --- /dev/null +++ b/webcit/static/t/box_serverrestartpagedo.html @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/webcit/static/t/display_serverrestart.html b/webcit/static/t/display_serverrestart.html new file mode 100644 index 000000000..e534ddffe --- /dev/null +++ b/webcit/static/t/display_serverrestart.html @@ -0,0 +1,32 @@ + + + +<?CURRENT_USER> - <?SERV_HUMANNODE> + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ +
+ diff --git a/webcit/static/t/display_serverrestartpage.html b/webcit/static/t/display_serverrestartpage.html new file mode 100644 index 000000000..26bf8d980 --- /dev/null +++ b/webcit/static/t/display_serverrestartpage.html @@ -0,0 +1,6 @@ + + +
+ +
+ diff --git a/webcit/static/t/display_serverrestartpagedo.html b/webcit/static/t/display_serverrestartpagedo.html new file mode 100644 index 000000000..a5c03ea11 --- /dev/null +++ b/webcit/static/t/display_serverrestartpagedo.html @@ -0,0 +1,32 @@ + + + +<?CURRENT_USER> - <?SERV_HUMANNODE> + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ +
+ diff --git a/webcit/static/t/subject_serverrestartpage.html b/webcit/static/t/subject_serverrestartpage.html new file mode 100644 index 000000000..a12b331dc --- /dev/null +++ b/webcit/static/t/subject_serverrestartpage.html @@ -0,0 +1 @@ +