const char *pch;
pch = ChrPtr(Buf) + 4;
- WCC->new_mail = StrBufExtractNext_long(Buf, &pch, '|');
+ /*WCC->new_mail =*/ StrBufExtractNext_long(Buf, &pch, '|');
WCC->need_regi = StrBufExtractNext_long(Buf, &pch, '|');
WCC->need_vali = StrBufExtractNext_long(Buf, &pch, '|');
if (WCC->cs_inet_email == NULL)
{
wcsession *WCC = WC;
StrBuf *Buf;
+ long ret, rc;
if (havebstr("language")) {
set_selected_language(bstr("language"));
if (havebstr("login_action")) {
serv_printf("USER %s", bstr("name"));
StrBuf_ServGetln(Buf);
- if (GetServerStatus(Buf, NULL) == 3) {
+ rc = GetServerStatus(Buf, &ret);
+ StrBufCutLeft(Buf, 4);
+ switch (rc) {
+ case 3:
serv_printf("PASS %s", bstr("pass"));
StrBuf_ServGetln(Buf);
if (GetServerStatus(Buf, NULL) == 2) {
become_logged_in(sbstr("name"), sbstr("pass"), Buf);
} else {
- snprintf(WCC->ImportantMessage,
- sizeof (WCC->ImportantMessage),
- "%s",
- &(ChrPtr(Buf))[4]);
+ StrBufCutLeft(Buf, 4);
+ AppendImportantMessage(SKEY(Buf));
display_login();
FreeStrBuf(&Buf);
return;
}
- } else {
- snprintf(WCC->ImportantMessage,
- sizeof (WCC->ImportantMessage),
- "%s",
- &(ChrPtr(Buf))[4]);
+ break;
+ case 5:
+ if (ret == 541)
+ {
+ AppendImportantMessage(SKEY(Buf));
+ display_main_menu();
+ return;
+ }
+ default:
+ AppendImportantMessage(SKEY(Buf));
display_login();
FreeStrBuf(&Buf);
return;
}
if (havebstr("newuser_action")) {
if (!havebstr("pass")) {
- snprintf(WCC->ImportantMessage,
- sizeof (WCC->ImportantMessage),
- "%s",
- _("Blank passwords are not allowed."));
+ AppendImportantMessage(_("Blank passwords are not allowed."), -1);
display_login();
FreeStrBuf(&Buf);
return;
serv_printf("SETP %s", bstr("pass"));
StrBuf_ServGetln(Buf); /* Don't care? */
} else {
- snprintf(WCC->ImportantMessage,
- sizeof (WCC->ImportantMessage),
- "%s",
- &(ChrPtr(Buf))[4]);
+ StrBufCutLeft(Buf, 4);
+ AppendImportantMessage(SKEY(Buf));
display_login();
FreeStrBuf(&Buf);
return;
do_welcome();
}
} else {
- snprintf(WCC->ImportantMessage,
- sizeof (WCC->ImportantMessage),
- "%s",
- _("Your password was not accepted."));
+ AppendImportantMessage(_("Your password was not accepted."), -1);
display_login();
}
FreeStrBuf(&Buf);
}
}
+int ConditionalHaveAccessCreateRoom(StrBuf *Target, WCTemplputParams *TP)
+{
+ StrBuf *Buf;
+
+ Buf = NewStrBuf();
+ serv_puts("CRE8 0");
+ StrBuf_ServGetln(Buf);
+
+ if (GetServerStatus(Buf, NULL) == 2) {
+ StrBufCutLeft(Buf, 4);
+ AppendImportantMessage(SKEY(Buf));
+ FreeStrBuf(&Buf);
+ return 0;
+ }
+ FreeStrBuf(&Buf);
+ return 1;
+}
+
int ConditionalAide(StrBuf *Target, WCTemplputParams *TP)
{
wcsession *WCC = WC;
RegisterConditional(HKEY("COND:AIDE"), 2, ConditionalAide, CTX_NONE);
RegisterConditional(HKEY("COND:LOGGEDIN"), 2, ConditionalIsLoggedIn, CTX_NONE);
-
+ RegisterConditional(HKEY("COND:MAY_CREATE_ROOM"), 2, ConditionalHaveAccessCreateRoom, CTX_NONE);
return ;
}