From: Wilfried Goesgens Date: Mon, 9 Jul 2012 18:04:45 +0000 (+0200) Subject: WHQ: templatize editing of user; fix handling of output after edit. X-Git-Tag: v8.13~14 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=27f31d9ff191502221640f91534bf34f39722bbe WHQ: templatize editing of user; fix handling of output after edit. --- diff --git a/webcit/static/t/who/edit.html b/webcit/static/t/who/edit.html new file mode 100644 index 000000000..90345f015 --- /dev/null +++ b/webcit/static/t/who/edit.html @@ -0,0 +1,52 @@ + + +
+ + +
+ +
+ + + + + + + + + + + + + + + + +
+ + + + +"> +
+ + + + +"> +
+ + + + + "> +
+"> +
+
+ diff --git a/webcit/who.c b/webcit/who.c index 9fdd9a90b..1c2984584 100644 --- a/webcit/who.c +++ b/webcit/who.c @@ -131,77 +131,25 @@ void edit_me(void) { char buf[SIZ]; + output_headers(1, 0, 0, 0, 0, 0); if (havebstr("change_room_name_button")) { serv_printf("RCHG %s", bstr("fake_roomname")); serv_getln(buf, sizeof buf); - http_redirect("who"); + do_template("who"); } else if (havebstr("change_host_name_button")) { serv_printf("HCHG %s", bstr("fake_hostname")); serv_getln(buf, sizeof buf); - http_redirect("who"); + do_template("who"); } else if (havebstr("change_user_name_button")) { serv_printf("UCHG %s", bstr("fake_username")); serv_getln(buf, sizeof buf); - http_redirect("who"); + do_template("who"); } else if (havebstr("cancel_button")) { - http_redirect("who"); + do_template("who"); } else { - output_headers(1, 1, 0, 0, 0, 0); - - wc_printf("
\n"); - wc_printf("
"); - wc_printf(""); - wc_printf(_("Edit your session display")); - wc_printf("
\n"); - wc_printf("
\n
\n"); - - wc_printf(_("This screen allows you to change the way your " - "session appears in the 'Who is online' listing. " - "To turn off any 'fake' name you've previously " - "set, simply click the appropriate 'change' button " - "without typing anything in the corresponding box. ")); - wc_printf("
\n"); - - wc_printf("
\n"); - wc_printf("\n", WC->nonce); - - wc_printf("\n"); - - wc_printf("\n\n\n\n"); - - wc_printf("\n\n\n"); - - if (WC->is_aide) { - wc_printf("\n\n\n"); - } - wc_printf("
"); - wc_printf(_("Room name:")); - wc_printf(""); - wc_printf("\n"); - wc_printf(""); - wc_printf("", - _("Change room name")); - wc_printf("
"); - wc_printf(_("Host name:")); - wc_printf(""); - wc_printf("\n"); - wc_printf(""); - wc_printf("", - _("Change host name")); - wc_printf("
"); - wc_printf(_("User name:")); - wc_printf(""); - wc_printf("\n"); - wc_printf(""); - wc_printf("", - _("Change user name")); - wc_printf("
"); - wc_printf("", - _("Cancel")); - wc_printf("
\n"); - wc_printf("
\n"); - wDumpContent(1); + do_template("who_edit"); } + end_burst(); } void _terminate_session(void) {