*/
void display_openid_login(char *mesg)
{
- char buf[SIZ];
-
- output_headers(1, 1, 2, 0, 0, 0);
- wprintf("<div id=\"login_screen\">\n");
-
- if ((mesg != NULL) && (!IsEmptyStr(mesg))) {
- stresc(buf, SIZ, mesg, 0, 0);
- svprintf(HKEY("MESG"), WCS_STRING, "%s", buf);
- }
-
- svprintf(HKEY("LOGIN_INSTRUCTIONS"), WCS_STRING,
- _("<ul>"
- "<li>Enter your OpenID URL and click "Login"."
- "<li><a href=\"http://www.citadel.org/doku.php/documentation:openid\">"
- "Click here to learn what OpenID is and how Citadel is using it.</a>"
- "<li>Please log off properly when finished. "
- "<li>You must use a browser that supports <i>frames</i> and "
- "<i>cookies</i>. "
- "<li>Also keep in mind that if your browser is "
- "configured to block pop-up windows, you will not be able "
- "to receive any instant messages.<br>"
- "</ul>")
- );
-
- svput("HELLO", WCS_SERVCMD, "MESG hello");
-
- svprintf(HKEY("OFFER_CONVENTIONAL_LOGIN"), WCS_STRING,
- "<div id=\"convlogin\">"
- "<a href=\"display_login\">"
- "%s</a>"
- "</div>"
- ,
- "Log in using a user name and password"
- );
-
- do_template("openid_login", NULL);
- wDumpContent(2);
+ begin_burst();
+ output_headers(1, 0, 0, 0, 1, 0);
+ do_template("openid_login", NULL);
+ end_burst();
}
svput("EXIT_BUTTON", WCS_STRING, _("Exit"));
svprintf(HKEY("BOXTITLE"), WCS_STRING, _("%s - powered by <a href=\"http://www.citadel.org\">Citadel</a>"),
- ChrPtr(serv_info.serv_humannode));
+ ChrPtr(WC->serv_info->serv_humannode));
do_template("openid_manual_create", NULL);
wDumpContent(2);
void become_logged_in(const StrBuf *user, const StrBuf *pass, StrBuf *serv_response)
{
wcsession *WCC = WC;
- char buf[SIZ];
+ StrBuf *Buf;
StrBuf *FloorDiv;
+ StrBuf *Language = NULL;
- WC->logged_in = 1;
+ WCC->logged_in = 1;
if (WCC->wc_fullname == NULL)
WCC->wc_fullname = NewStrBufPlain(NULL, StrLength(serv_response));
load_preferences();
+ Buf = NewStrBuf();
serv_puts("CHEK");
- serv_getln(buf, sizeof buf);
- if (buf[0] == '2') {
- WC->new_mail = extract_int(&buf[4], 0);
- WC->need_regi = extract_int(&buf[4], 1);
- WC->need_vali = extract_int(&buf[4], 2);
- extract_token(WC->cs_inet_email, &buf[4], 3, '|', sizeof WC->cs_inet_email);
+ StrBuf_ServGetln(Buf);
+ if (GetServerStatus(Buf, NULL) == 2) {
+ const char *pch;
+
+ pch = ChrPtr(Buf) + 4;
+ 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)
+ WCC->cs_inet_email = NewStrBuf();
+ StrBufExtract_NextToken(WCC->cs_inet_email, Buf, &pch, '|');
+ }
+ if (havebstr("language"))
+ set_preference("language", NewStrBufDup(SBSTR("language")), 1);
+ else {
+ get_preference("language", &Language);
+ if (Language != NULL) {
+ set_selected_language(ChrPtr(Language));
+ go_selected_language(); /* set locale */
+ }
}
-
get_preference("floordiv_expanded", &FloorDiv);
- WC->floordiv_expanded = FloorDiv;
+ WCC->floordiv_expanded = FloorDiv;
+ FreeStrBuf(&Buf);
}
}
}
if (WCC->logged_in) {
- set_preference("language", NewStrBufPlain(bstr("language"), -1), 1);
if (WCC->need_regi) {
display_reg(1);
} else if (WCC->need_vali) {
serv_puts("000");
linecount = 0;
- while (StrBuf_ServGetln(Buf),
- (StrLength(Buf)==3) &&
- !strcmp(ChrPtr(Buf), "000"))
+ while (StrBuf_ServGetln(Buf), strcmp(ChrPtr(Buf), "000"))
{
if (linecount == 0) result = NewStrBufDup(Buf);
if (!strcasecmp(ChrPtr(result), "authenticate")) {
*/
void do_logout(void)
{
+ wcsession *WCC = WC;
char buf[SIZ];
- FlushStrBuf(WC->wc_username);
- FlushStrBuf(WC->wc_password);
- FlushStrBuf(WC->wc_roomname);
- FlushStrBuf(WC->wc_fullname);
+ FlushStrBuf(WCC->wc_username);
+ FlushStrBuf(WCC->wc_password);
+ FlushStrBuf(WCC->wc_roomname);
+ FlushStrBuf(WCC->wc_fullname);
/* FIXME: this is to suppress the iconbar displaying, because we aren't
actually logged out yet */
- WC->logged_in = 0;
+ WCC->logged_in = 0;
/** Calling output_headers() this way causes the cookies to be un-set */
output_headers(1, 1, 0, 1, 0, 0);
serv_puts("MESG goodbye");
serv_getln(buf, sizeof buf);
- if (WC->serv_sock >= 0) {
+ if (WCC->serv_sock >= 0) {
if (buf[0] == '1') {
fmout("CENTER");
} else {
*/
void display_reg(int during_login)
{
+ message_summary *VCMsg;
+ wc_mime_attachment *VCAtt;
long vcard_msgnum;
if (goto_config_room() != 0) {
return;
}
- vcard_msgnum = locate_user_vcard_in_this_room();
+ vcard_msgnum = locate_user_vcard_in_this_room(&VCMsg, &VCAtt);
if (vcard_msgnum < 0L) {
if (during_login) do_welcome();
else display_main_menu();
}
if (during_login) {
- do_edit_vcard(vcard_msgnum, "1", "do_welcome", USERCONFIGROOM);
+ do_edit_vcard(vcard_msgnum, "1", VCMsg, VCAtt, "do_welcome", USERCONFIGROOM);
}
else {
- do_edit_vcard(vcard_msgnum, "1", "display_main_menu", USERCONFIGROOM);
+ do_edit_vcard(vcard_msgnum, "1", VCMsg, VCAtt, "display_main_menu", USERCONFIGROOM);
}
}