From: Wilfried Goesgens Date: Sun, 25 Mar 2012 23:17:06 +0000 (+0200) Subject: fmout: removed. X-Git-Tag: v8.11~114 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=5d04fea41af83718edc10083a943285715483912 fmout: removed. - templatize the logout screen; it doesn't need the old fmout now anymore. - templatize the change password dialog; it doesn't need the old fmout now anymore. - remove fmout --- diff --git a/webcit/auth.c b/webcit/auth.c index e5275104d..45c78592d 100644 --- a/webcit/auth.c +++ b/webcit/auth.c @@ -498,45 +498,7 @@ void do_logout(void) /* Calling output_headers() this way causes the cookies to be un-set */ output_headers(1, 1, 0, 1, 0, 0); - - /* For sites in guest mode, redirect to the landing page after we're logged out */ - if (WC->serv_info->serv_supports_guest) { - wc_printf(" " - ); - } - - wc_printf("
"); - wc_printf("
"); - wc_printf("
"); - wc_printf(_("Log off")); - wc_printf("
"); - serv_puts("MESG goodbye"); - serv_getln(buf, sizeof buf); - - if (WCC->serv_sock >= 0) { - if (buf[0] == '1') { - fmout("'CENTER'"); - } else { - wc_printf("Goodbye\n"); - } - } - else { - wc_printf(_("This program was unable to connect or stay " - "connected to the Citadel server. Please report " - "this problem to your system administrator.") - ); - wc_printf("%s", - _("Read More...")); - } - - wc_printf("
\n"); + do_template("logout"); if (WC->serv_info->serv_supports_guest) { display_default_landing_page(); return; @@ -761,62 +723,6 @@ void display_reg(int during_login) } - -/* - * display form for changing your password - */ -void display_changepw(void) -{ - wcsession *WCC = WC; - WCTemplputParams SubTP; - char buf[SIZ]; - StrBuf *Buf; - output_headers(1, 1, 1, 0, 0, 0); - - Buf = NewStrBufPlain(_("Change your password"), -1); - memset(&SubTP, 0, sizeof(WCTemplputParams)); - SubTP.Filter.ContextType = CTX_STRBUF; - SubTP.Context = Buf; - DoTemplate(HKEY("box_begin"), NULL, &SubTP); - - FreeStrBuf(&Buf); - - if (StrLength(WCC->ImportantMsg) > 0) { - wc_printf("" - "%s
\n", ChrPtr(WCC->ImportantMsg)); - FlushStrBuf(WCC->ImportantMsg); - } - - serv_puts("MESG changepw"); - serv_getln(buf, sizeof buf); - if (buf[0] == '1') { - fmout("CENTER"); - } - - wc_printf("
\n"); - wc_printf("\n", WC->nonce); - wc_printf("\n"); - wc_printf("\n"); - wc_printf("
"); - wc_printf(_("Enter new password:")); - wc_printf(""); - wc_printf("
"); - wc_printf(_("Enter it again to confirm:")); - wc_printf(""); - wc_printf("
\n"); - - wc_printf("
\n"); - wc_printf("", _("Change password")); - wc_printf(" "); - wc_printf("\n", _("Cancel")); - wc_printf("
\n"); - wc_printf("
\n"); - - do_template("box_end"); - wDumpContent(1); -} - /* * change password * if passwords match, propagate it to citserver. @@ -837,13 +743,13 @@ void changepw(void) if (strcasecmp(newpass1, newpass2)) { AppendImportantMessage(_("They don't match. Password was not changed."), -1); - display_changepw(); + do_template("menu_change_pw"); return; } if (IsEmptyStr(newpass1)) { AppendImportantMessage(_("Blank passwords are not allowed."), -1); - display_changepw(); + do_template("menu_change_pw"); return; } @@ -864,7 +770,7 @@ void changepw(void) display_main_menu(); } else { - display_changepw(); + do_template("menu_change_pw"); } FreeStrBuf(&Line); } @@ -1036,7 +942,6 @@ InitModule_AUTH WebcitAddUrlHandler(HKEY("validate"), "", 0, validate, 0); WebcitAddUrlHandler(HKEY("do_welcome"), "", 0, do_welcome, 0); WebcitAddUrlHandler(HKEY("display_reg"), "", 0, _display_reg, 0); - WebcitAddUrlHandler(HKEY("display_changepw"), "", 0, display_changepw, 0); WebcitAddUrlHandler(HKEY("changepw"), "", 0, changepw, 0); WebcitAddUrlHandler(HKEY("termquit"), "", 0, do_logout, 0); WebcitAddUrlHandler(HKEY("do_logout"), "", 0, do_logout, ANONYMOUS|COOKIEUNNEEDED|FORCE_SESSIONCLOSE); diff --git a/webcit/serv_func.c b/webcit/serv_func.c index 0158ca1fb..6d7dc34c3 100644 --- a/webcit/serv_func.c +++ b/webcit/serv_func.c @@ -254,55 +254,6 @@ int GetConnected (void) return 0; } -/* - * Read Citadel variformat text and spit it out as HTML. - * align html align string - */ -inline void fmout(const char *align) -{ - _fmout(WC->WBuf, align); -} - -void _fmout(StrBuf *Target, const char *align) -{ - int intext = 0; - int bq = 0; - char buf[SIZ]; - - StrBufAppendPrintf(Target, "
\n", align); - while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) { - - if ((intext == 1) && (isspace(buf[0]))) { - wc_printf("
"); - } - intext = 1; - - /* - * Quoted text should be displayed in italics and in a - * different colour. This code understands Citadel-style - * " >" quotes and will convert to
tags. - */ - if ((bq == 0) && (!strncmp(buf, " >", 2))) { - StrBufAppendBufPlain(Target, HKEY("
"), 0); - bq = 1; - } else if ((bq == 1) && (strncmp(buf, " >", 2))) { - StrBufAppendBufPlain(Target, HKEY("
"), 0); - bq = 0; - } - if ((bq == 1) && (!strncmp(buf, " >", 2))) { - strcpy(buf, &buf[2]); - } - /* Activate embedded URL's */ - url(buf, sizeof(buf)); - - escputs(buf); - StrBufAppendBufPlain(Target, HKEY("\n"), 0); - } - if (bq == 1) { - wc_printf(""); - } - wc_printf("

\n"); -} void FmOut(StrBuf *Target, const char *align, const StrBuf *Source) { diff --git a/webcit/static/t/logout.html b/webcit/static/t/logout.html new file mode 100644 index 000000000..60c86c34a --- /dev/null +++ b/webcit/static/t/logout.html @@ -0,0 +1,18 @@ + + + + + +
+
+
+
+ + +
+ + + +
diff --git a/webcit/static/t/menu/change_pw.html b/webcit/static/t/menu/change_pw.html new file mode 100644 index 000000000..fbacd71ac --- /dev/null +++ b/webcit/static/t/menu/change_pw.html @@ -0,0 +1,32 @@ + + + +
+ + + + + + +
+ + + + + + + + + + + +
+ +
+"> +  +"> +
+
+ + diff --git a/webcit/static/t/menu/your_info.html b/webcit/static/t/menu/your_info.html index 350d361c9..fb3af7926 100644 --- a/webcit/static/t/menu/your_info.html +++ b/webcit/static/t/menu/your_info.html @@ -1,7 +1,7 @@
  • -
  • +
  • diff --git a/webcit/webcit.h b/webcit/webcit.h index 62f9ba204..ef976ec93 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -692,8 +692,6 @@ void CreateMimeStr(void); void pop_destination(void); -void fmout(const char *align); -void _fmout(StrBuf *Targt, const char *align); void FmOut(StrBuf *Target, const char *align, const StrBuf *Source); void wDumpContent(int);