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)
119 StrBuf *Language = NULL;
123 if (WCC->wc_fullname == NULL)
124 WCC->wc_fullname = NewStrBufPlain(NULL, StrLength(serv_response));
125 StrBufExtract_token(WCC->wc_fullname, serv_response, 0, '|');
126 StrBufCutLeft(WCC->wc_fullname, 4 );
128 if (WCC->wc_username == NULL)
129 WCC->wc_username = NewStrBufDup(user);
131 FlushStrBuf(WCC->wc_username);
132 StrBufAppendBuf(WCC->wc_username, user, 0);
135 if (WCC->wc_password == NULL)
136 WCC->wc_password = NewStrBufDup(pass);
138 FlushStrBuf(WCC->wc_password);
139 StrBufAppendBuf(WCC->wc_password, pass, 0);
142 WCC->axlevel = StrBufExtract_int(serv_response, 1, '|');
143 if (WCC->axlevel >= 6) { /* TODO: make this a define, else it might trick us later */
151 StrBuf_ServGetln(Buf);
152 if (GetServerStatus(Buf, NULL) == 2) {
155 pch = ChrPtr(Buf) + 4;
156 WCC->new_mail = StrBufExtractNext_long(Buf, &pch, '|');
157 WCC->need_regi = StrBufExtractNext_long(Buf, &pch, '|');
158 WCC->need_vali = StrBufExtractNext_long(Buf, &pch, '|');
159 if (WCC->cs_inet_email == NULL)
160 WCC->cs_inet_email = NewStrBuf();
161 StrBufExtract_NextToken(WCC->cs_inet_email, Buf, &pch, '|');
163 if (havebstr("language"))
164 set_preference("language", NewStrBufDup(SBSTR("language")), 1);
166 get_preference("language", &Language);
167 if (Language != NULL) {
168 set_selected_language(ChrPtr(Language));
169 go_selected_language(); /* set locale */
172 get_preference("floordiv_expanded", &FloorDiv);
173 WCC->floordiv_expanded = FloorDiv;
179 * Perform authentication using a user name and password
186 if (havebstr("language")) {
187 set_selected_language(bstr("language"));
188 go_selected_language();
191 if (havebstr("exit_action")) {
196 if (havebstr("login_action")) {
197 serv_printf("USER %s", bstr("name"));
198 StrBuf_ServGetln(Buf);
199 if (GetServerStatus(Buf, NULL) == 3) {
200 serv_printf("PASS %s", bstr("pass"));
201 StrBuf_ServGetln(Buf);
202 if (GetServerStatus(Buf, NULL) == 2) {
203 become_logged_in(sbstr("name"), sbstr("pass"), Buf);
205 snprintf(WCC->ImportantMessage,
206 sizeof (WCC->ImportantMessage),
214 snprintf(WCC->ImportantMessage,
215 sizeof (WCC->ImportantMessage),
223 if (havebstr("newuser_action")) {
224 if (!havebstr("pass")) {
225 snprintf(WCC->ImportantMessage,
226 sizeof (WCC->ImportantMessage),
228 _("Blank passwords are not allowed."));
233 serv_printf("NEWU %s", bstr("name"));
234 StrBuf_ServGetln(Buf);
235 if (GetServerStatus(Buf, NULL) == 2) {
236 become_logged_in(sbstr("name"), sbstr("pass"), Buf);
237 serv_printf("SETP %s", bstr("pass"));
238 StrBuf_ServGetln(Buf); /* Don't care? */
240 snprintf(WCC->ImportantMessage,
241 sizeof (WCC->ImportantMessage),
249 if (WCC->logged_in) {
250 if (WCC->need_regi) {
252 } else if (WCC->need_vali) {
258 snprintf(WCC->ImportantMessage,
259 sizeof (WCC->ImportantMessage),
261 _("Your password was not accepted."));
268 * Try to create an account manually after an OpenID was verified
270 void openid_manual_create(void)
274 if (havebstr("exit_action")) {
279 if (havebstr("newuser_action")) {
281 serv_printf("OIDC %s", bstr("name"));
282 StrBuf_ServGetln(Buf);
283 if (GetServerStatus(Buf, NULL) == 2) {
287 serv_puts("SETP GENERATE_RANDOM_PASSWORD");
288 StrBuf_ServGetln(gpass);
289 StrBufCutLeft(gpass, 4);
290 become_logged_in(sbstr("name"), gpass, Buf);
299 } else if (WC->need_vali) {
305 display_openid_name_request(sbstr("openid_url"), sbstr("name"));
312 * Perform authentication using OpenID
313 * assemble the checkid_setup request and then redirect to the user's identity provider
315 void do_openid_login(void)
320 if (havebstr("language")) {
321 set_selected_language(bstr("language"));
322 go_selected_language();
325 if (havebstr("exit_action")) {
329 if (havebstr("login_action")) {
330 snprintf(buf, sizeof buf,
331 "OIDS %s|%s://%s/finalize_openid_login|%s://%s",
333 (is_https ? "https" : "http"), ChrPtr(WCC->Hdr->http_host),
334 (is_https ? "https" : "http"), ChrPtr(WCC->Hdr->http_host)
338 serv_getln(buf, sizeof buf);
340 lprintf(CTDL_DEBUG, "OpenID server contacted; redirecting to %s\n", &buf[4]);
341 http_redirect(&buf[4]);
345 display_openid_login(&buf[4]);
350 /* If we get to this point then something failed. */
351 display_openid_login(_("Your password was not accepted."));
355 * Complete the authentication using OpenID
356 * This function handles the positive or negative assertion from the user's Identity Provider
358 void finalize_openid_login(void)
362 int already_logged_in = (WCC->logged_in) ;
364 StrBuf *result = NULL;
365 StrBuf *username = NULL;
366 StrBuf *password = NULL;
367 StrBuf *logged_in_response = NULL;
368 StrBuf *claimed_id = NULL;
370 if (havebstr("openid.mode")) {
371 if (!strcasecmp(bstr("openid.mode"), "id_res")) {
374 StrBuf_ServGetln(Buf);
375 if (GetServerStatus(Buf, NULL) == 8) {
382 Cursor = GetNewHashPos (WCC->Hdr->urlstrings, 0);
383 while (GetNextHashPos(WCC->Hdr->urlstrings, Cursor, &HKLen, &HKey, &U)) {
385 if (!strncasecmp(u->url_key, "openid.", 7)) {
386 serv_printf("%s|%s", &u->url_key[7], ChrPtr(u->url_data));
393 while (StrBuf_ServGetln(Buf), strcmp(ChrPtr(Buf), "000"))
395 if (linecount == 0) result = NewStrBufDup(Buf);
396 if (!strcasecmp(ChrPtr(result), "authenticate")) {
397 if (linecount == 1) {
398 username = NewStrBufDup(Buf);
400 else if (linecount == 2) {
401 password = NewStrBufDup(Buf);
403 else if (linecount == 3) {
404 logged_in_response = NewStrBufDup(Buf);
407 else if (!strcasecmp(ChrPtr(result), "verify_only")) {
408 if (linecount == 1) {
409 claimed_id = NewStrBufDup(Buf);
411 if (linecount == 2) {
412 username = NewStrBufDup(Buf);
422 /* If we were already logged in, this was an attempt to associate an OpenID account */
423 if (already_logged_in) {
426 FreeStrBuf(&username);
427 FreeStrBuf(&password);
428 FreeStrBuf(&claimed_id);
429 FreeStrBuf(&logged_in_response);
433 /* If this operation logged us in, either by connecting with an existing account or by
434 * auto-creating one using Simple Registration Extension, we're already on our way.
436 if (!strcasecmp(ChrPtr(result), "authenticate")) {
437 become_logged_in(username, password, logged_in_response);
440 /* The specified OpenID was verified but the desired user name was either not specified via SRI
441 * or conflicts with an existing user. Either way the user will need to specify a new name.
444 else if (!strcasecmp(ChrPtr(result), "verify_only")) {
445 display_openid_name_request(claimed_id, username);
448 /* Did we manage to log in? If so, continue with the normal flow... */
456 display_openid_login(_("Your password was not accepted."));
460 FreeStrBuf(&username);
461 FreeStrBuf(&password);
462 FreeStrBuf(&claimed_id);
463 FreeStrBuf(&logged_in_response);
468 * Display a welcome screen to the user.
470 * If this is the first time login, and the web based setup is enabled,
471 * lead the user through the setup routines
473 void do_welcome(void)
476 #ifdef XXX_NOT_FINISHED_YET_XXX
481 * See if we have to run the first-time setup wizard
486 sprintf(wizard_filename, "setupwiz.%s.%s",
488 len = strlen(wizard_filename);
489 for (i=0; i<len; ++i) {
490 if ( (wizard_filename[i]==' ')
491 || (wizard_filename[i] == '/')
493 wizard_filename[i] = '_';
497 fp = fopen(wizard_filename, "r");
499 fgets(buf, sizeof buf, fp);
500 buf[strlen(buf)-1] = 0;
502 if (atoi(buf) == serv_info.serv_rev_level) {
503 setup_wizard = 1; /**< already run */
509 http_redirect("setup_wizard");
515 * Go to the user's preferred start page
517 if (!get_preference("startpage", &Buf)) {
519 StrBufPrintf(Buf, "dotskip&room=_BASEROOM_");
520 set_preference("startpage", Buf, 1);
522 if (ChrPtr(Buf)[0] == '/') {
523 StrBufCutLeft(Buf, 1);
525 if (StrLength(Buf) == 0)
526 StrBufAppendBufPlain(Buf, "dotgoto?room=_BASEROOM_", -1, 0);
527 http_redirect(ChrPtr(Buf));
532 * Disconnect from the Citadel server, and end this WebCit session
534 void end_webcit_session(void) {
538 /* close() of citadel socket will be done by do_housekeeping() */
549 FlushStrBuf(WCC->wc_username);
550 FlushStrBuf(WCC->wc_password);
551 FlushStrBuf(WCC->wc_roomname);
552 FlushStrBuf(WCC->wc_fullname);
554 /* FIXME: this is to suppress the iconbar displaying, because we aren't
555 actually logged out yet */
558 /** Calling output_headers() this way causes the cookies to be un-set */
559 output_headers(1, 1, 0, 1, 0, 0);
561 wprintf("<div id=\"logout_screen\">");
562 wprintf("<div class=\"box\">");
563 wprintf("<div class=\"boxlabel\">");
564 wprintf(_("Log off"));
565 wprintf("</div><div class=\"boxcontent\">");
566 serv_puts("MESG goodbye");
567 serv_getln(buf, sizeof buf);
569 if (WCC->serv_sock >= 0) {
573 wprintf("Goodbye\n");
577 wprintf(_("This program was unable to connect or stay "
578 "connected to the Citadel server. Please report "
579 "this problem to your system administrator.")
581 wprintf("<a href=\"http://www.citadel.org/doku.php/"
582 "faq:mastering_your_os:net#netstat\">%s</a>",
586 wprintf("<hr /><div class=\"buttons\"> "
587 "<span class=\"button_link\"><a href=\".\">");
588 wprintf(_("Log in again"));
589 wprintf("</a></span>");
591 /* The "close window" link is commented out because some browsers don't
594 wprintf(" <span class=\"button_link\">"
595 "<a href=\"javascript:window.close();\">");
596 wprintf(_("Close window"));
597 wprintf("</a></span>");
600 wprintf("</div></div></div></div>\n");
602 end_webcit_session();
616 output_headers(1, 1, 2, 0, 0, 0);
617 wprintf("<div id=\"banner\">\n");
619 wprintf(_("Validate new users"));
623 wprintf("<div id=\"content\" class=\"service\">\n");
625 /* If the user just submitted a validation, process it... */
626 safestrncpy(buf, bstr("user"), sizeof buf);
627 if (!IsEmptyStr(buf)) {
628 if (havebstr("axlevel")) {
629 serv_printf("VALI %s|%s", buf, bstr("axlevel"));
630 serv_getln(buf, sizeof buf);
632 wprintf("<b>%s</b><br>\n", &buf[4]);
637 /* Now see if any more users require validation. */
639 serv_getln(buf, sizeof buf);
642 wprintf(_("No users require validation at this time."));
643 wprintf("</b><br>\n");
648 wprintf("<b>%s</b><br>\n", &buf[4]);
653 wprintf("<div class=\"fix_scrollbar_bug\">"
654 "<table class=\"auth_validate\"><tr><td>\n");
655 wprintf("<div id=\"validate\">");
657 safestrncpy(user, &buf[4], sizeof user);
658 serv_printf("GREG %s", user);
659 serv_getln(cmd, sizeof cmd);
663 serv_getln(buf, sizeof buf);
666 wprintf("#%s<br><H1>%s</H1>",
675 while (!IsEmptyStr(pch))
679 else if (isalpha(*pch))
690 pch = _("very weak");
703 wprintf("PW: %s<br>\n", pch);
706 wprintf("%s<br>\n", buf);
708 wprintf("%s<br>\n", buf);
710 wprintf("%s, ", buf);
714 wprintf("%s<br>\n", buf);
716 wprintf("%s<br>\n", buf);
718 wprintf(_("Current access level: %d (%s)\n"),
719 atoi(buf), axdefs[atoi(buf)]);
720 } while (strcmp(buf, "000"));
722 wprintf("<H1>%s</H1>%s<br />\n", user, &cmd[4]);
726 wprintf(_("Select access level for this user:"));
728 for (a = 0; a <= 6; ++a) {
729 wprintf("<a href=\"validate?nonce=%d?user=", WC->nonce);
731 wprintf("&axlevel=%d\">%s</A> \n",
737 wprintf("</td></tr></table></div>\n");
744 * Display form for registration.
746 * (Set during_login to 1 if this registration is being performed during
747 * new user login and will require chaining to the proper screen.)
749 void display_reg(int during_login)
752 message_summary *VCMsg;
753 wc_mime_attachment *VCAtt;
757 if (goto_config_room(Buf) != 0) {
758 if (during_login) do_welcome();
759 else display_main_menu();
765 vcard_msgnum = locate_user_vcard_in_this_room(&VCMsg, &VCAtt);
766 if (vcard_msgnum < 0L) {
767 if (during_login) do_welcome();
768 else display_main_menu();
773 do_edit_vcard(vcard_msgnum, "1", VCMsg, VCAtt, "do_welcome", USERCONFIGROOM);
776 do_edit_vcard(vcard_msgnum, "1", VCMsg, VCAtt, "display_main_menu", USERCONFIGROOM);
785 * display form for changing your password
787 void display_changepw(void)
789 WCTemplputParams SubTP;
792 output_headers(1, 1, 1, 0, 0, 0);
794 Buf = NewStrBufPlain(_("Change your password"), -1);
795 memset(&SubTP, 0, sizeof(WCTemplputParams));
796 SubTP.Filter.ContextType = CTX_STRBUF;
798 DoTemplate(HKEY("beginbox"), NULL, &SubTP);
802 if (!IsEmptyStr(WC->ImportantMessage)) {
803 wprintf("<span class=\"errormsg\">"
804 "%s</span><br />\n", WC->ImportantMessage);
805 safestrncpy(WC->ImportantMessage, "", sizeof WC->ImportantMessage);
808 serv_puts("MESG changepw");
809 serv_getln(buf, sizeof buf);
814 wprintf("<form name=\"changepwform\" action=\"changepw\" method=\"post\">\n");
815 wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
816 wprintf("<table class=\"altern\" ");
817 wprintf("<tr class=\"even\"><td>");
818 wprintf(_("Enter new password:"));
819 wprintf("</td><td>");
820 wprintf("<input type=\"password\" name=\"newpass1\" value=\"\" maxlength=\"20\"></td></tr>\n");
821 wprintf("<tr class=\"odd\"><td>");
822 wprintf(_("Enter it again to confirm:"));
823 wprintf("</td><td>");
824 wprintf("<input type=\"password\" name=\"newpass2\" value=\"\" maxlength=\"20\"></td></tr>\n");
825 wprintf("</table>\n");
827 wprintf("<div class=\"buttons\">\n");
828 wprintf("<input type=\"submit\" name=\"change_action\" value=\"%s\">", _("Change password"));
830 wprintf("<input type=\"submit\" name=\"cancel_action\" value=\"%s\">\n", _("Cancel"));
832 wprintf("</form>\n");
834 do_template("endbox", NULL);
840 * if passwords match, propagate it to citserver.
845 char newpass1[32], newpass2[32];
847 if (!havebstr("change_action")) {
848 safestrncpy(WC->ImportantMessage,
849 _("Cancelled. Password was not changed."),
850 sizeof WC->ImportantMessage);
855 safestrncpy(newpass1, bstr("newpass1"), sizeof newpass1);
856 safestrncpy(newpass2, bstr("newpass2"), sizeof newpass2);
858 if (strcasecmp(newpass1, newpass2)) {
859 safestrncpy(WC->ImportantMessage,
860 _("They don't match. Password was not changed."),
861 sizeof WC->ImportantMessage);
866 if (IsEmptyStr(newpass1)) {
867 safestrncpy(WC->ImportantMessage,
868 _("Blank passwords are not allowed."),
869 sizeof WC->ImportantMessage);
874 serv_printf("SETP %s", newpass1);
875 serv_getln(buf, sizeof buf);
876 sprintf(WC->ImportantMessage, "%s", &buf[4]);
878 if (WC->wc_password == NULL)
879 WC->wc_password = NewStrBufPlain(buf, -1);
881 FlushStrBuf(WC->wc_password);
882 StrBufAppendBufPlain(WC->wc_password, buf, -1, 0);
891 int ConditionalAide(StrBuf *Target, WCTemplputParams *TP)
893 return (WC->is_aide == 0);
896 int ConditionalRoomAide(StrBuf *Target, WCTemplputParams *TP)
898 return (WC->is_room_aide == 0);
901 int ConditionalIsLoggedIn(StrBuf *Target, WCTemplputParams *TP) {
902 return (WC->logged_in == 0);
904 int ConditionalRoomAcessDelete(StrBuf *Target, WCTemplputParams *TP)
907 return ( (WCC->is_room_aide) || (WCC->is_mailbox) || (WCC->room_flags2 & QR2_COLLABDEL) );
912 void _display_openid_login(void) {display_openid_login(NULL);}
913 void _display_reg(void) {display_reg(0);}
915 void Header_HandleAuth(StrBuf *Line, ParsedHttpHdrs *hdr)
917 if (hdr->got_auth == NO_AUTH) /* don't override cookie auth... */
919 if (strncasecmp(ChrPtr(Line), "Basic", 5) == 0) {
920 StrBufCutLeft(Line, 6);
921 StrBufDecodeBase64(Line);
922 hdr->plainauth = Line;
923 hdr->got_auth = AUTH_BASIC;
926 lprintf(1, "Authentication scheme not supported! [%s]\n", ChrPtr(Line));
930 void CheckAuthBasic(ParsedHttpHdrs *hdr)
933 todo: enable this if we can have other sessions than authenticated ones.
934 if (hdr->DontNeedAuth)
937 StrBufAppendBufPlain(hdr->plainauth, HKEY(":"), 0);
938 StrBufAppendBuf(hdr->plainauth, hdr->user_agent, 0);
939 hdr->SessionKey = hashlittle(SKEY(hdr->plainauth), 89479832);
943 void GetAuthBasic(ParsedHttpHdrs *hdr)
945 const char *Pos = NULL;
946 if (hdr->c_username == NULL)
947 hdr->c_username = NewStrBufPlain(HKEY(DEFAULT_HTTPAUTH_USER));
948 if (hdr->c_password == NULL)
949 hdr->c_password = NewStrBufPlain(HKEY(DEFAULT_HTTPAUTH_PASS));
950 StrBufExtract_NextToken(hdr->c_username, hdr->plainauth, &Pos, ':');
951 StrBufExtract_NextToken(hdr->c_password, hdr->plainauth, &Pos, ':');
954 void Header_HandleCookie(StrBuf *Line, ParsedHttpHdrs *hdr)
958 todo: enable this if we can have other sessions than authenticated ones.
959 if (hdr->DontNeedAuth)
962 pch = strstr(ChrPtr(Line), "webcit=");
967 hdr->RawCookie = Line;
968 StrBufCutLeft(hdr->RawCookie, (pch - ChrPtr(hdr->RawCookie)) + 7);
969 StrBufDecodeHex(hdr->RawCookie);
971 if (hdr->c_username == NULL)
972 hdr->c_username = NewStrBufPlain(HKEY(DEFAULT_HTTPAUTH_USER));
973 if (hdr->c_password == NULL)
974 hdr->c_password = NewStrBufPlain(HKEY(DEFAULT_HTTPAUTH_PASS));
975 if (hdr->c_roomname == NULL)
976 hdr->c_roomname = NewStrBuf();
977 cookie_to_stuff(Line, &hdr->desired_session,
981 hdr->got_auth = AUTH_COOKIE;
990 RegisterHeaderHandler(HKEY("COOKIE"), Header_HandleCookie);
991 RegisterHeaderHandler(HKEY("AUTHORIZATION"), Header_HandleAuth);
993 WebcitAddUrlHandler(HKEY(""), do_welcome, ANONYMOUS|COOKIEUNNEEDED); /* no url pattern at all? Show login. */
994 WebcitAddUrlHandler(HKEY("do_welcome"), do_welcome, ANONYMOUS|COOKIEUNNEEDED);
995 WebcitAddUrlHandler(HKEY("login"), do_login, ANONYMOUS|COOKIEUNNEEDED);
996 WebcitAddUrlHandler(HKEY("display_openid_login"), _display_openid_login, ANONYMOUS);
997 WebcitAddUrlHandler(HKEY("openid_login"), do_openid_login, ANONYMOUS);
998 WebcitAddUrlHandler(HKEY("finalize_openid_login"), finalize_openid_login, ANONYMOUS);
999 WebcitAddUrlHandler(HKEY("openid_manual_create"), openid_manual_create, ANONYMOUS);
1000 WebcitAddUrlHandler(HKEY("do_logout"), do_logout, ANONYMOUS|COOKIEUNNEEDED|FORCE_SESSIONCLOSE);
1001 WebcitAddUrlHandler(HKEY("validate"), validate, 0);
1002 WebcitAddUrlHandler(HKEY("display_reg"), _display_reg, 0);
1003 WebcitAddUrlHandler(HKEY("display_changepw"), display_changepw, 0);
1004 WebcitAddUrlHandler(HKEY("changepw"), changepw, 0);
1005 WebcitAddUrlHandler(HKEY("termquit"), do_logout, 0);
1007 RegisterConditional(HKEY("COND:AIDE"), 2, ConditionalAide, CTX_NONE);
1008 RegisterConditional(HKEY("COND:ROOMAIDE"), 2, ConditionalRoomAide, CTX_NONE);
1009 RegisterConditional(HKEY("COND:ACCESS:DELETE"), 2, ConditionalRoomAcessDelete, CTX_NONE);
1010 RegisterConditional(HKEY("COND:LOGGEDIN"), 2, ConditionalIsLoggedIn, CTX_NONE);
1017 SessionDestroyModule_AUTH
1020 FreeStrBuf(&sess->wc_username);
1021 FreeStrBuf(&sess->wc_fullname);
1022 FreeStrBuf(&sess->wc_password);
1023 FreeStrBuf(&sess->wc_roomname);
1024 FreeStrBuf(&sess->httpauth_pass);
1025 FreeStrBuf(&sess->cs_inet_email);