4 * WebcitAuth; Handles authentication of users to a Citadel server.
11 extern uint32_t hashlittle( const void *key, size_t length, uint32_t initval);
13 void display_reg(int during_login);
16 * Access level definitions. This is initialized from a function rather than a
17 * static array so that the strings may be localized.
21 void initialize_axdefs(void) {
22 axdefs[0] = _("Deleted"); /* an erased user */
23 axdefs[1] = _("New User"); /* a new user */
24 axdefs[2] = _("Problem User"); /* a trouble maker */
25 axdefs[3] = _("Local User"); /* user with normal privileges */
26 axdefs[4] = _("Network User"); /* a user that may access network resources */
27 axdefs[5] = _("Preferred User");/* a moderator */
28 axdefs[6] = _("Aide"); /* chief */
34 * Display the login screen
35 * mesg = the error message if last attempt failed.
37 void display_login(void)
40 output_headers(1, 0, 0, 0, 1, 0);
41 do_template("login", NULL);
49 * Display the openid-enabled login screen
50 * mesg = the error message if last attempt failed.
52 void display_openid_login(char *mesg)
55 output_headers(1, 0, 0, 0, 1, 0);
56 do_template("openid_login", NULL);
61 void display_openid_name_request(const StrBuf *claimed_id, const StrBuf *username)
65 output_headers(1, 1, 2, 0, 0, 0);
66 wprintf("<div id=\"login_screen\">\n");
68 Buf = NewStrBufPlain(NULL, StrLength(claimed_id));
69 StrEscAppend(Buf, claimed_id, NULL, 0, 0);
70 svprintf(HKEY("VERIFIED"), WCS_STRING, _("Your OpenID <tt>%s</tt> was successfully verified."),
72 SVPutBuf("CLAIMED_ID", Buf, 0);
75 if (StrLength(username) > 0) {
76 Buf = NewStrBufPlain(NULL, StrLength(username));
77 StrEscAppend(Buf, claimed_id, NULL, 0, 0);
78 svprintf(HKEY("REASON"), WCS_STRING,
79 _("However, the user name '%s' conflicts with an existing user."),
84 svput("REASON", WCS_STRING, "");
87 svput("ACTION_REQUESTED", WCS_STRING, _("Please specify the user name you would like to use."));
89 svput("USERNAME_BOX", WCS_STRING, _("User name:"));
90 svput("NEWUSER_BUTTON", WCS_STRING, _("New User"));
91 svput("EXIT_BUTTON", WCS_STRING, _("Exit"));
93 svprintf(HKEY("BOXTITLE"), WCS_STRING, _("%s - powered by <a href=\"http://www.citadel.org\">Citadel</a>"),
94 ChrPtr(WC->serv_info->serv_humannode));
96 do_template("openid_manual_create", NULL);
102 /* Initialize the session
104 * This function needs to get called whenever the session changes from
105 * not-logged-in to logged-in, either by an explicit login by the user or
106 * by a timed-out session automatically re-establishing with a little help
107 * from the browser cookie. Either way, we need to load access controls and
108 * preferences from the server.
112 * serv_response The parameters returned from a Citadel USER or NEWU command
114 void become_logged_in(const StrBuf *user, const StrBuf *pass, StrBuf *serv_response)
122 if (WCC->wc_fullname == NULL)
123 WCC->wc_fullname = NewStrBufPlain(NULL, StrLength(serv_response));
124 StrBufExtract_token(WCC->wc_fullname, serv_response, 0, '|');
125 StrBufCutLeft(WCC->wc_fullname, 4 );
127 if (WCC->wc_username == NULL)
128 WCC->wc_username = NewStrBufDup(user);
130 FlushStrBuf(WCC->wc_username);
131 StrBufAppendBuf(WCC->wc_username, user, 0);
134 if (WCC->wc_password == NULL)
135 WCC->wc_password = NewStrBufDup(pass);
137 FlushStrBuf(WCC->wc_password);
138 StrBufAppendBuf(WCC->wc_password, pass, 0);
141 WCC->axlevel = StrBufExtract_int(serv_response, 1, '|');
142 if (WCC->axlevel >= 6) { /* TODO: make this a define, else it might trick us later */
150 StrBuf_ServGetln(Buf);
151 if (GetServerStatus(Buf, NULL) == 2) {
154 pch = ChrPtr(Buf) + 4;
155 WCC->new_mail = StrBufExtractNext_long(Buf, &pch, '|');
156 WCC->need_regi = StrBufExtractNext_long(Buf, &pch, '|');
157 WCC->need_vali = StrBufExtractNext_long(Buf, &pch, '|');
158 if (WCC->cs_inet_email == NULL)
159 WCC->cs_inet_email = NewStrBuf();
160 StrBufExtract_NextToken(WCC->cs_inet_email, Buf, &pch, '|');
162 get_preference("floordiv_expanded", &FloorDiv);
163 WCC->floordiv_expanded = FloorDiv;
169 * Perform authentication using a user name and password
176 if (havebstr("language")) {
177 set_selected_language(bstr("language"));
178 go_selected_language();
181 if (havebstr("exit_action")) {
186 if (havebstr("login_action")) {
187 serv_printf("USER %s", bstr("name"));
188 StrBuf_ServGetln(Buf);
189 if (GetServerStatus(Buf, NULL) == 3) {
190 serv_printf("PASS %s", bstr("pass"));
191 StrBuf_ServGetln(Buf);
192 if (GetServerStatus(Buf, NULL) == 2) {
193 become_logged_in(sbstr("name"), sbstr("pass"), Buf);
195 snprintf(WCC->ImportantMessage,
196 sizeof (WCC->ImportantMessage),
204 snprintf(WCC->ImportantMessage,
205 sizeof (WCC->ImportantMessage),
213 if (havebstr("newuser_action")) {
214 if (!havebstr("pass")) {
215 snprintf(WCC->ImportantMessage,
216 sizeof (WCC->ImportantMessage),
218 _("Blank passwords are not allowed."));
223 serv_printf("NEWU %s", bstr("name"));
224 StrBuf_ServGetln(Buf);
225 if (GetServerStatus(Buf, NULL) == 2) {
226 become_logged_in(sbstr("name"), sbstr("pass"), Buf);
227 serv_printf("SETP %s", bstr("pass"));
228 StrBuf_ServGetln(Buf); /* Don't care? */
230 snprintf(WCC->ImportantMessage,
231 sizeof (WCC->ImportantMessage),
239 if (WCC->logged_in) {
240 if (WCC->need_regi) {
242 } else if (WCC->need_vali) {
248 snprintf(WCC->ImportantMessage,
249 sizeof (WCC->ImportantMessage),
251 _("Your password was not accepted."));
258 * Try to create an account manually after an OpenID was verified
260 void openid_manual_create(void)
264 if (havebstr("exit_action")) {
269 if (havebstr("newuser_action")) {
271 serv_printf("OIDC %s", bstr("name"));
272 StrBuf_ServGetln(Buf);
273 if (GetServerStatus(Buf, NULL) == 2) {
277 serv_puts("SETP GENERATE_RANDOM_PASSWORD");
278 StrBuf_ServGetln(gpass);
279 StrBufCutLeft(gpass, 4);
280 become_logged_in(sbstr("name"), gpass, Buf);
289 } else if (WC->need_vali) {
295 display_openid_name_request(sbstr("openid_url"), sbstr("name"));
302 * Perform authentication using OpenID
303 * assemble the checkid_setup request and then redirect to the user's identity provider
305 void do_openid_login(void)
310 if (havebstr("language")) {
311 set_selected_language(bstr("language"));
312 go_selected_language();
315 if (havebstr("exit_action")) {
319 if (havebstr("login_action")) {
320 snprintf(buf, sizeof buf,
321 "OIDS %s|%s://%s/finalize_openid_login|%s://%s",
323 (is_https ? "https" : "http"), ChrPtr(WCC->Hdr->HR.http_host),
324 (is_https ? "https" : "http"), ChrPtr(WCC->Hdr->HR.http_host)
328 serv_getln(buf, sizeof buf);
330 lprintf(CTDL_DEBUG, "OpenID server contacted; redirecting to %s\n", &buf[4]);
331 http_redirect(&buf[4]);
335 display_openid_login(&buf[4]);
340 /* If we get to this point then something failed. */
341 display_openid_login(_("Your password was not accepted."));
345 * Complete the authentication using OpenID
346 * This function handles the positive or negative assertion from the user's Identity Provider
348 void finalize_openid_login(void)
352 int already_logged_in = (WCC->logged_in) ;
354 StrBuf *result = NULL;
355 StrBuf *username = NULL;
356 StrBuf *password = NULL;
357 StrBuf *logged_in_response = NULL;
358 StrBuf *claimed_id = NULL;
360 if (havebstr("openid.mode")) {
361 if (!strcasecmp(bstr("openid.mode"), "id_res")) {
364 StrBuf_ServGetln(Buf);
365 if (GetServerStatus(Buf, NULL) == 8) {
372 Cursor = GetNewHashPos (WCC->Hdr->urlstrings, 0);
373 while (GetNextHashPos(WCC->Hdr->urlstrings, Cursor, &HKLen, &HKey, &U)) {
375 if (!strncasecmp(u->url_key, "openid.", 7)) {
376 serv_printf("%s|%s", &u->url_key[7], ChrPtr(u->url_data));
383 while (StrBuf_ServGetln(Buf), strcmp(ChrPtr(Buf), "000"))
385 if (linecount == 0) result = NewStrBufDup(Buf);
386 if (!strcasecmp(ChrPtr(result), "authenticate")) {
387 if (linecount == 1) {
388 username = NewStrBufDup(Buf);
390 else if (linecount == 2) {
391 password = NewStrBufDup(Buf);
393 else if (linecount == 3) {
394 logged_in_response = NewStrBufDup(Buf);
397 else if (!strcasecmp(ChrPtr(result), "verify_only")) {
398 if (linecount == 1) {
399 claimed_id = NewStrBufDup(Buf);
401 if (linecount == 2) {
402 username = NewStrBufDup(Buf);
412 /* If we were already logged in, this was an attempt to associate an OpenID account */
413 if (already_logged_in) {
416 FreeStrBuf(&username);
417 FreeStrBuf(&password);
418 FreeStrBuf(&claimed_id);
419 FreeStrBuf(&logged_in_response);
423 /* If this operation logged us in, either by connecting with an existing account or by
424 * auto-creating one using Simple Registration Extension, we're already on our way.
426 if (!strcasecmp(ChrPtr(result), "authenticate")) {
427 become_logged_in(username, password, logged_in_response);
430 /* The specified OpenID was verified but the desired user name was either not specified via SRI
431 * or conflicts with an existing user. Either way the user will need to specify a new name.
434 else if (!strcasecmp(ChrPtr(result), "verify_only")) {
435 display_openid_name_request(claimed_id, username);
438 /* Did we manage to log in? If so, continue with the normal flow... */
446 display_openid_login(_("Your password was not accepted."));
450 FreeStrBuf(&username);
451 FreeStrBuf(&password);
452 FreeStrBuf(&claimed_id);
453 FreeStrBuf(&logged_in_response);
458 * Display a welcome screen to the user.
460 * If this is the first time login, and the web based setup is enabled,
461 * lead the user through the setup routines
463 void do_welcome(void)
466 #ifdef XXX_NOT_FINISHED_YET_XXX
471 * See if we have to run the first-time setup wizard
476 sprintf(wizard_filename, "setupwiz.%s.%s",
478 len = strlen(wizard_filename);
479 for (i=0; i<len; ++i) {
480 if ( (wizard_filename[i]==' ')
481 || (wizard_filename[i] == '/')
483 wizard_filename[i] = '_';
487 fp = fopen(wizard_filename, "r");
489 fgets(buf, sizeof buf, fp);
490 buf[strlen(buf)-1] = 0;
492 if (atoi(buf) == serv_info.serv_rev_level) {
493 setup_wizard = 1; /**< already run */
499 http_redirect("setup_wizard");
505 * Go to the user's preferred start page
507 if (!get_preference("startpage", &Buf)) {
509 StrBufPrintf(Buf, "dotskip?room=_BASEROOM_");
510 set_preference("startpage", Buf, 1);
512 if (ChrPtr(Buf)[0] == '/') {
513 StrBufCutLeft(Buf, 1);
515 if (StrLength(Buf) == 0) {
516 StrBufAppendBufPlain(Buf, "dotgoto?room=_BASEROOM_", -1, 0);
518 lprintf(9, "Redirecting to user's start page: %s\n", ChrPtr(Buf));
519 http_redirect(ChrPtr(Buf));
524 * Disconnect from the Citadel server, and end this WebCit session
526 void end_webcit_session(void) {
530 /* close() of citadel socket will be done by do_housekeeping() */
541 FlushStrBuf(WCC->wc_username);
542 FlushStrBuf(WCC->wc_password);
543 FlushStrBuf(WCC->wc_roomname);
544 FlushStrBuf(WCC->wc_fullname);
546 /* FIXME: this is to suppress the iconbar displaying, because we aren't
547 actually logged out yet */
550 /** Calling output_headers() this way causes the cookies to be un-set */
551 output_headers(1, 1, 0, 1, 0, 0);
553 wprintf("<div id=\"logout_screen\">");
554 wprintf("<div class=\"box\">");
555 wprintf("<div class=\"boxlabel\">");
556 wprintf(_("Log off"));
557 wprintf("</div><div class=\"boxcontent\">");
558 serv_puts("MESG goodbye");
559 serv_getln(buf, sizeof buf);
561 if (WCC->serv_sock >= 0) {
565 wprintf("Goodbye\n");
569 wprintf(_("This program was unable to connect or stay "
570 "connected to the Citadel server. Please report "
571 "this problem to your system administrator.")
573 wprintf("<a href=\"http://www.citadel.org/doku.php/"
574 "faq:mastering_your_os:net#netstat\">%s</a>",
578 wprintf("<hr /><div class=\"buttons\"> "
579 "<span class=\"button_link\"><a href=\".\">");
580 wprintf(_("Log in again"));
581 wprintf("</a></span>");
583 /* The "close window" link is commented out because some browsers don't
586 wprintf(" <span class=\"button_link\">"
587 "<a href=\"javascript:window.close();\">");
588 wprintf(_("Close window"));
589 wprintf("</a></span>");
592 wprintf("</div></div></div></div>\n");
594 end_webcit_session();
608 output_headers(1, 1, 2, 0, 0, 0);
609 wprintf("<div id=\"banner\">\n");
611 wprintf(_("Validate new users"));
615 wprintf("<div id=\"content\" class=\"service\">\n");
617 /* If the user just submitted a validation, process it... */
618 safestrncpy(buf, bstr("user"), sizeof buf);
619 if (!IsEmptyStr(buf)) {
620 if (havebstr("axlevel")) {
621 serv_printf("VALI %s|%s", buf, bstr("axlevel"));
622 serv_getln(buf, sizeof buf);
624 wprintf("<b>%s</b><br>\n", &buf[4]);
629 /* Now see if any more users require validation. */
631 serv_getln(buf, sizeof buf);
634 wprintf(_("No users require validation at this time."));
635 wprintf("</b><br>\n");
640 wprintf("<b>%s</b><br>\n", &buf[4]);
645 wprintf("<div class=\"fix_scrollbar_bug\">"
646 "<table class=\"auth_validate\"><tr><td>\n");
647 wprintf("<div id=\"validate\">");
649 safestrncpy(user, &buf[4], sizeof user);
650 serv_printf("GREG %s", user);
651 serv_getln(cmd, sizeof cmd);
655 serv_getln(buf, sizeof buf);
658 wprintf("#%s<br><H1>%s</H1>",
667 while (!IsEmptyStr(pch))
671 else if (isalpha(*pch))
682 pch = _("very weak");
695 wprintf("PW: %s<br>\n", pch);
698 wprintf("%s<br>\n", buf);
700 wprintf("%s<br>\n", buf);
702 wprintf("%s, ", buf);
706 wprintf("%s<br>\n", buf);
708 wprintf("%s<br>\n", buf);
710 wprintf(_("Current access level: %d (%s)\n"),
711 atoi(buf), axdefs[atoi(buf)]);
712 } while (strcmp(buf, "000"));
714 wprintf("<H1>%s</H1>%s<br />\n", user, &cmd[4]);
718 wprintf(_("Select access level for this user:"));
720 for (a = 0; a <= 6; ++a) {
721 wprintf("<a href=\"validate?nonce=%d?user=", WC->nonce);
723 wprintf("&axlevel=%d\">%s</A> \n",
729 wprintf("</td></tr></table></div>\n");
736 * Display form for registration.
738 * (Set during_login to 1 if this registration is being performed during
739 * new user login and will require chaining to the proper screen.)
741 void display_reg(int during_login)
744 message_summary *VCMsg = NULL;
745 wc_mime_attachment *VCAtt = NULL;
749 if (goto_config_room(Buf) != 0) {
750 lprintf(9, "display_reg() exiting because goto_config_room() failed\n");
762 vcard_msgnum = locate_user_vcard_in_this_room(&VCMsg, &VCAtt);
763 if (vcard_msgnum < 0L) {
764 lprintf(9, "display_reg() exiting because locate_user_vcard_in_this_room() failed\n");
775 do_edit_vcard(vcard_msgnum, "1", VCMsg, VCAtt, "do_welcome", USERCONFIGROOM);
779 ReturnTo = NewStrBufPlain(HKEY("display_main_menu?gotofirst="));
780 StrBufAppendBuf(ReturnTo, WC->wc_roomname, 0);
781 lprintf(9, "
\e[32mwc_roomname: %s
\e[0m\n", ChrPtr(WC->wc_roomname));
782 lprintf(9, "
\e[31m ReturnTo: %s
\e[0m\n", ChrPtr(ReturnTo));
783 do_edit_vcard(vcard_msgnum, "1", VCMsg, VCAtt, ChrPtr(ReturnTo), USERCONFIGROOM);
784 FreeStrBuf(&ReturnTo);
789 1. don't we have to free VCMsg and VCAtt ??
799 * display form for changing your password
801 void display_changepw(void)
803 WCTemplputParams SubTP;
806 output_headers(1, 1, 1, 0, 0, 0);
808 Buf = NewStrBufPlain(_("Change your password"), -1);
809 memset(&SubTP, 0, sizeof(WCTemplputParams));
810 SubTP.Filter.ContextType = CTX_STRBUF;
812 DoTemplate(HKEY("beginbox"), NULL, &SubTP);
816 if (!IsEmptyStr(WC->ImportantMessage)) {
817 wprintf("<span class=\"errormsg\">"
818 "%s</span><br />\n", WC->ImportantMessage);
819 safestrncpy(WC->ImportantMessage, "", sizeof WC->ImportantMessage);
822 serv_puts("MESG changepw");
823 serv_getln(buf, sizeof buf);
828 wprintf("<form name=\"changepwform\" action=\"changepw\" method=\"post\">\n");
829 wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
830 wprintf("<table class=\"altern\" ");
831 wprintf("<tr class=\"even\"><td>");
832 wprintf(_("Enter new password:"));
833 wprintf("</td><td>");
834 wprintf("<input type=\"password\" name=\"newpass1\" value=\"\" maxlength=\"20\"></td></tr>\n");
835 wprintf("<tr class=\"odd\"><td>");
836 wprintf(_("Enter it again to confirm:"));
837 wprintf("</td><td>");
838 wprintf("<input type=\"password\" name=\"newpass2\" value=\"\" maxlength=\"20\"></td></tr>\n");
839 wprintf("</table>\n");
841 wprintf("<div class=\"buttons\">\n");
842 wprintf("<input type=\"submit\" name=\"change_action\" value=\"%s\">", _("Change password"));
844 wprintf("<input type=\"submit\" name=\"cancel_action\" value=\"%s\">\n", _("Cancel"));
846 wprintf("</form>\n");
848 do_template("endbox", NULL);
854 * if passwords match, propagate it to citserver.
859 char newpass1[32], newpass2[32];
861 if (!havebstr("change_action")) {
862 safestrncpy(WC->ImportantMessage,
863 _("Cancelled. Password was not changed."),
864 sizeof WC->ImportantMessage);
869 safestrncpy(newpass1, bstr("newpass1"), sizeof newpass1);
870 safestrncpy(newpass2, bstr("newpass2"), sizeof newpass2);
872 if (strcasecmp(newpass1, newpass2)) {
873 safestrncpy(WC->ImportantMessage,
874 _("They don't match. Password was not changed."),
875 sizeof WC->ImportantMessage);
880 if (IsEmptyStr(newpass1)) {
881 safestrncpy(WC->ImportantMessage,
882 _("Blank passwords are not allowed."),
883 sizeof WC->ImportantMessage);
888 serv_printf("SETP %s", newpass1);
889 serv_getln(buf, sizeof buf);
890 sprintf(WC->ImportantMessage, "%s", &buf[4]);
892 if (WC->wc_password == NULL)
893 WC->wc_password = NewStrBufPlain(buf, -1);
895 FlushStrBuf(WC->wc_password);
896 StrBufAppendBufPlain(WC->wc_password, buf, -1, 0);
905 int ConditionalAide(StrBuf *Target, WCTemplputParams *TP)
908 return (WCC != NULL)? (WC->is_aide == 0) : 0;
911 int ConditionalRoomAide(StrBuf *Target, WCTemplputParams *TP)
914 return (WCC != NULL)? (WCC->is_room_aide == 0) : 0;
918 int ConditionalIsLoggedIn(StrBuf *Target, WCTemplputParams *TP)
921 return (WCC != NULL)? (WCC->logged_in == 0) : 0;
925 int ConditionalRoomAcessDelete(StrBuf *Target, WCTemplputParams *TP)
928 return (WCC != NULL)? ( (WCC->is_room_aide) || (WCC->is_mailbox) || (WCC->room_flags2 & QR2_COLLABDEL) ) : 0;
932 void _display_openid_login(void) {
933 display_openid_login(NULL);
937 void _display_reg(void) {
942 void Header_HandleAuth(StrBuf *Line, ParsedHttpHdrs *hdr)
944 if (hdr->HR.got_auth == NO_AUTH) /* don't override cookie auth... */
946 if (strncasecmp(ChrPtr(Line), "Basic", 5) == 0) {
947 StrBufCutLeft(Line, 6);
948 StrBufDecodeBase64(Line);
949 hdr->HR.plainauth = Line;
950 hdr->HR.got_auth = AUTH_BASIC;
953 lprintf(1, "Authentication scheme not supported! [%s]\n", ChrPtr(Line));
957 void CheckAuthBasic(ParsedHttpHdrs *hdr)
960 todo: enable this if we can have other sessions than authenticated ones.
961 if (hdr->DontNeedAuth)
964 StrBufAppendBufPlain(hdr->HR.plainauth, HKEY(":"), 0);
965 StrBufAppendBuf(hdr->HR.plainauth, hdr->HR.user_agent, 0);
966 hdr->HR.SessionKey = hashlittle(SKEY(hdr->HR.plainauth), 89479832);
970 void GetAuthBasic(ParsedHttpHdrs *hdr)
972 const char *Pos = NULL;
973 if (hdr->c_username == NULL)
974 hdr->c_username = NewStrBufPlain(HKEY(DEFAULT_HTTPAUTH_USER));
975 if (hdr->c_password == NULL)
976 hdr->c_password = NewStrBufPlain(HKEY(DEFAULT_HTTPAUTH_PASS));
977 StrBufExtract_NextToken(hdr->c_username, hdr->HR.plainauth, &Pos, ':');
978 StrBufExtract_NextToken(hdr->c_password, hdr->HR.plainauth, &Pos, ':');
981 void Header_HandleCookie(StrBuf *Line, ParsedHttpHdrs *hdr)
985 todo: enable this if we can have other sessions than authenticated ones.
986 if (hdr->DontNeedAuth)
989 pch = strstr(ChrPtr(Line), "webcit=");
994 hdr->HR.RawCookie = Line;
995 StrBufCutLeft(hdr->HR.RawCookie, (pch - ChrPtr(hdr->HR.RawCookie)) + 7);
996 StrBufDecodeHex(hdr->HR.RawCookie);
998 cookie_to_stuff(Line, &hdr->HR.desired_session,
1004 hdr->HR.got_auth = AUTH_COOKIE;
1009 (ParsedHttpHdrs *httpreq)
1011 httpreq->c_username = NewStrBufPlain(HKEY(DEFAULT_HTTPAUTH_USER));
1012 httpreq->c_password = NewStrBufPlain(HKEY(DEFAULT_HTTPAUTH_PASS));
1013 httpreq->c_roomname = NewStrBuf();
1014 httpreq->c_language = NewStrBuf();
1017 HttpDetachModule_AUTH
1018 (ParsedHttpHdrs *httpreq)
1020 FLUSHStrBuf(httpreq->c_username);
1021 FLUSHStrBuf(httpreq->c_password);
1022 FLUSHStrBuf(httpreq->c_roomname);
1023 FLUSHStrBuf(httpreq->c_language);
1027 HttpDestroyModule_AUTH
1028 (ParsedHttpHdrs *httpreq)
1030 FreeStrBuf(&httpreq->c_username);
1031 FreeStrBuf(&httpreq->c_password);
1032 FreeStrBuf(&httpreq->c_roomname);
1033 FreeStrBuf(&httpreq->c_language);
1040 RegisterHeaderHandler(HKEY("COOKIE"), Header_HandleCookie);
1041 RegisterHeaderHandler(HKEY("AUTHORIZATION"), Header_HandleAuth);
1043 WebcitAddUrlHandler(HKEY(""), do_welcome, ANONYMOUS|COOKIEUNNEEDED); /* no url pattern at all? Show login. */
1044 WebcitAddUrlHandler(HKEY("do_welcome"), do_welcome, ANONYMOUS|COOKIEUNNEEDED);
1045 WebcitAddUrlHandler(HKEY("login"), do_login, ANONYMOUS|COOKIEUNNEEDED);
1046 WebcitAddUrlHandler(HKEY("display_openid_login"), _display_openid_login, ANONYMOUS);
1047 WebcitAddUrlHandler(HKEY("openid_login"), do_openid_login, ANONYMOUS);
1048 WebcitAddUrlHandler(HKEY("finalize_openid_login"), finalize_openid_login, ANONYMOUS);
1049 WebcitAddUrlHandler(HKEY("openid_manual_create"), openid_manual_create, ANONYMOUS);
1050 WebcitAddUrlHandler(HKEY("do_logout"), do_logout, ANONYMOUS|COOKIEUNNEEDED|FORCE_SESSIONCLOSE);
1051 WebcitAddUrlHandler(HKEY("validate"), validate, 0);
1052 WebcitAddUrlHandler(HKEY("display_reg"), _display_reg, 0);
1053 WebcitAddUrlHandler(HKEY("display_changepw"), display_changepw, 0);
1054 WebcitAddUrlHandler(HKEY("changepw"), changepw, 0);
1055 WebcitAddUrlHandler(HKEY("termquit"), do_logout, 0);
1057 RegisterConditional(HKEY("COND:AIDE"), 2, ConditionalAide, CTX_NONE);
1058 RegisterConditional(HKEY("COND:ROOMAIDE"), 2, ConditionalRoomAide, CTX_NONE);
1059 RegisterConditional(HKEY("COND:ACCESS:DELETE"), 2, ConditionalRoomAcessDelete, CTX_NONE);
1060 RegisterConditional(HKEY("COND:LOGGEDIN"), 2, ConditionalIsLoggedIn, CTX_NONE);
1067 SessionDestroyModule_AUTH
1070 FreeStrBuf(&sess->wc_username);
1071 FreeStrBuf(&sess->wc_fullname);
1072 FreeStrBuf(&sess->wc_password);
1073 FreeStrBuf(&sess->wc_roomname);
1074 FreeStrBuf(&sess->httpauth_pass);
1075 FreeStrBuf(&sess->cs_inet_email);