]> code.citadel.org Git - citadel.git/blob - webcit/auth.c
Temporarily disable OpenID functionality for release
[citadel.git] / webcit / auth.c
1 /*
2  * $Id$
3  *
4  * WebcitAuth; Handles authentication of users to a Citadel server.
5  */
6
7 #include "webcit.h"
8 #include "webserver.h"
9
10 /*
11  * Access level definitions.  This is initialized from a function rather than a
12  * static array so that the strings may be localized.
13  */
14 char *axdefs[7]; 
15
16 void initialize_axdefs(void) {
17         axdefs[0] = _("Deleted");       /* an erased user */
18         axdefs[1] = _("New User");      /* a new user */
19         axdefs[2] = _("Problem User");  /* a trouble maker */
20         axdefs[3] = _("Local User");    /* user with normal privileges */
21         axdefs[4] = _("Network User");  /* a user that may access network resources */
22         axdefs[5] = _("Preferred User");/* a moderator */
23         axdefs[6] = _("Aide");          /* chief */
24 }
25
26
27
28
29 /* 
30  * Display the login screen
31  * mesg = the error message if last attempt failed.
32  */
33 void display_login(char *mesg)
34 {
35         char buf[SIZ];
36
37         output_headers(1, 1, 2, 0, 0, 0);
38         wprintf("<div id=\"login_screen\">\n");
39
40         if (mesg != NULL) if (!IsEmptyStr(mesg)) {
41                         stresc(buf, SIZ,  mesg, 0, 0);
42                         svprintf(HKEY("MESG"), WCS_STRING, "%s", buf);
43         }
44
45         svprintf(HKEY("LOGIN_INSTRUCTIONS"), WCS_STRING,
46                 _("<ul>"
47                 "<li><b>If you already have an account on %s</b>, "
48                 "enter your user name and password and click &quot;Login.&quot; "
49                 "<li><b>If you are a new user</b>, enter the name and password "
50                 "you wish to use, "
51                 "and click &quot;New User.&quot; "
52                 "<li>Please log off properly when finished. "
53                 "<li>You must use a browser that supports <i>frames</i> and "
54                 "<i>cookies</i>. "
55                 "<li>Also keep in mind that if your browser is "
56                 "configured to block pop-up windows, you will not be able "
57                 "to receive any instant messages.<br />"
58                 "</ul>"),
59                 serv_info.serv_humannode
60         );
61
62         svput("USERNAME_BOX", WCS_STRING, _("User name:"));
63         svput("PASSWORD_BOX", WCS_STRING, _("Password:"));
64         svput("LANGUAGE_BOX", WCS_STRING, _("Language:"));
65         svput("LOGIN_BUTTON", WCS_STRING, _("Login"));
66         svput("NEWUSER_BUTTON", WCS_STRING, _("New User"));
67         svput("EXIT_BUTTON", WCS_STRING, _("Exit"));
68         svput("HELLO", WCS_SERVCMD, "MESG hello");
69         svprintf(HKEY("BOXTITLE"), WCS_STRING, _("%s - powered by <a href=\"http://www.citadel.org\">Citadel</a>"),
70                 serv_info.serv_humannode);
71         svcallback("DO_LANGUAGE_BOX", offer_languages);
72         if (serv_info.serv_newuser_disabled) {
73                 svput("NEWUSER_BUTTON_PRE", WCS_STRING, "<div style=\"display:none;\">");
74                 svput("NEWUSER_BUTTON_POST", WCS_STRING, "</div>");
75         }
76         else {
77                 svput("NEWUSER_BUTTON_PRE", WCS_STRING, "");
78                 svput("NEWUSER_BUTTON_POST", WCS_STRING, "");
79         }
80
81 #if 0
82                 svprintf(HKEY("OFFER_OPENID_LOGIN"), WCS_STRING,
83                         "<div align=center>"
84                         "<a href=\"display_openid_login\">"
85                         "<img src=\"static/openid-small.gif\" border=0 valign=middle>"
86                         "%s</a>"
87                         "</div>"
88                         ,
89                         "Log in using OpenID"
90                 );
91 #else
92                 svput("OFFER_OPENID_LOGIN", WCS_STRING, "");
93 #endif
94
95         do_template("login");
96
97         wDumpContent(2);
98 }
99
100
101
102 /* 
103  * Display the openid-enabled login screen
104  * mesg = the error message if last attempt failed.
105  */
106 void display_openid_login(char *mesg)
107 {
108         char buf[SIZ];
109
110         output_headers(1, 1, 2, 0, 0, 0);
111         wprintf("<div id=\"login_screen\">\n");
112
113         if (mesg != NULL) if (!IsEmptyStr(mesg)) {
114                         stresc(buf, SIZ,  mesg, 0, 0);
115                         svprintf(HKEY("MESG"), WCS_STRING, "%s", buf);
116         }
117
118         svprintf(HKEY("LOGIN_INSTRUCTIONS"), WCS_STRING,
119                 _("<ul>"
120                 "<li>Enter your OpenID URL and click &quot;Login&quot;."
121                 "<li>Please log off properly when finished. "
122                 "<li>You must use a browser that supports <i>frames</i> and "
123                 "<i>cookies</i>. "
124                 "<li>Also keep in mind that if your browser is "
125                 "configured to block pop-up windows, you will not be able "
126                 "to receive any instant messages.<br />"
127                 "</ul>")
128         );
129
130         svput("OPENID_BOX", WCS_STRING, _("OpenID URL:"));
131         svput("LANGUAGE_BOX", WCS_STRING, _("Language:"));
132         svput("LOGIN_BUTTON", WCS_STRING, _("Login"));
133         svput("EXIT_BUTTON", WCS_STRING, _("Exit"));
134         svput("HELLO", WCS_SERVCMD, "MESG hello");
135         svprintf(HKEY("BOXTITLE"), WCS_STRING, _("%s - powered by <a href=\"http://www.citadel.org\">Citadel</a>"),
136                 serv_info.serv_humannode);
137         svcallback("DO_LANGUAGE_BOX", offer_languages);
138
139         svprintf(HKEY("OFFER_CONVENTIONAL_LOGIN"), WCS_STRING,
140                 "<div align=center>"
141                 "<a href=\"display_login\">"
142                 "%s</a>"
143                 "</div>"
144                 ,
145                 "Log in using a user name and password"
146         );
147
148         do_template("openid_login");
149         wDumpContent(2);
150 }
151
152
153
154
155 /* Initialize the session
156  *
157  * This function needs to get called whenever the session changes from
158  * not-logged-in to logged-in, either by an explicit login by the user or
159  * by a timed-out session automatically re-establishing with a little help
160  * from the browser cookie.  Either way, we need to load access controls and
161  * preferences from the server.
162  *
163  * user                 the username
164  * pass                 his password
165  * serv_response        The parameters returned from a Citadel USER or NEWU command
166  */
167 void become_logged_in(char *user, char *pass, char *serv_response)
168 {
169         char buf[SIZ];
170
171         WC->logged_in = 1;
172         extract_token(WC->wc_fullname, &serv_response[4], 0, '|', sizeof WC->wc_fullname);
173         safestrncpy(WC->wc_username, user, sizeof WC->wc_username);
174         safestrncpy(WC->wc_password, pass, sizeof WC->wc_password);
175         WC->axlevel = extract_int(&serv_response[4], 1);
176         if (WC->axlevel >= 6) {
177                 WC->is_aide = 1;
178         }
179
180         load_preferences();
181
182         serv_puts("CHEK");
183         serv_getln(buf, sizeof buf);
184         if (buf[0] == '2') {
185                 WC->new_mail = extract_int(&buf[4], 0);
186                 WC->need_regi = extract_int(&buf[4], 1);
187                 WC->need_vali = extract_int(&buf[4], 2);
188                 extract_token(WC->cs_inet_email, &buf[4], 3, '|', sizeof WC->cs_inet_email);
189         }
190
191         get_preference("current_iconbar", buf, sizeof buf);
192         WC->current_iconbar = atoi(buf);
193
194         get_preference("floordiv_expanded", WC->floordiv_expanded, sizeof WC->floordiv_expanded);
195 }
196
197
198 /* 
199  * Perform authentication using a user name and password
200  */
201 void do_login(void)
202 {
203         char buf[SIZ];
204
205         if (havebstr("language")) {
206                 set_selected_language(bstr("language"));
207                 go_selected_language();
208         }
209
210         if (havebstr("exit_action")) {
211                 do_logout();
212                 return;
213         }
214         if (havebstr("login_action")) {
215                 serv_printf("USER %s", bstr("name"));
216                 serv_getln(buf, sizeof buf);
217                 if (buf[0] == '3') {
218                         serv_printf("PASS %s", bstr("pass"));
219                         serv_getln(buf, sizeof buf);
220                         if (buf[0] == '2') {
221                                 become_logged_in(bstr("name"),
222                                                  bstr("pass"), buf);
223                         } else {
224                                 display_login(&buf[4]);
225                                 return;
226                         }
227                 } else {
228                         display_login(&buf[4]);
229                         return;
230                 }
231         }
232         if (havebstr("newuser_action")) {
233                 if (!havebstr("pass")) {
234                         display_login(_("Blank passwords are not allowed."));
235                         return;
236                 }
237                 serv_printf("NEWU %s", bstr("name"));
238                 serv_getln(buf, sizeof buf);
239                 if (buf[0] == '2') {
240                         become_logged_in(bstr("name"), bstr("pass"), buf);
241                         serv_printf("SETP %s", bstr("pass"));
242                         serv_getln(buf, sizeof buf);
243                 } else {
244                         display_login(&buf[4]);
245                         return;
246                 }
247         }
248         if (WC->logged_in) {
249                 if (WC->need_regi) {
250                         display_reg(1);
251                 } else if (WC->need_vali) {
252                         validate();
253                 } else {
254                         do_welcome();
255                 }
256         } else {
257                 display_login(_("Your password was not accepted."));
258         }
259
260 }
261
262
263 /* 
264  * Perform authentication using OpenID
265  * assemble the checkid_setup request and then redirect to the user's identity provider
266  */
267 void do_openid_login(void)
268 {
269         char buf[4096];
270
271         if (havebstr("language")) {
272                 set_selected_language(bstr("language"));
273                 go_selected_language();
274         }
275
276         if (havebstr("exit_action")) {
277                 do_logout();
278                 return;
279         }
280         if (havebstr("login_action")) {
281                 snprintf(buf, sizeof buf,
282                         "OIDS %s|%s://%s/finalize_openid_login|%s://%s",
283                         bstr("openid_url"),
284                         (is_https ? "https" : "http"), WC->http_host,
285                         (is_https ? "https" : "http"), WC->http_host
286                 );
287
288                 serv_puts(buf);
289                 serv_getln(buf, sizeof buf);
290                 if (buf[0] == '2') {
291                         lprintf(CTDL_DEBUG, "OpenID server contacted; redirecting to %s\n", &buf[4]);
292                         http_redirect(&buf[4]);
293                         return;
294                 }
295                 else {
296                         display_openid_login(&buf[4]);
297                         return;
298                 }
299         }
300
301         /* If we get to this point then something failed. */
302         display_openid_login(_("Your password was not accepted."));
303 }
304
305 /* 
306  * Complete the authentication using OpenID
307  * This function handles the positive or negative assertion from the user's Identity Provider
308  */
309 void finalize_openid_login(void)
310 {
311         char buf[1024];
312         struct wcsession *WCC = WC;
313         int already_logged_in = (WCC->logged_in) ;
314
315         if (havebstr("openid.mode")) {
316                 if (!strcasecmp(bstr("openid.mode"), "id_res")) {
317
318                         // FIXME id accepted but the code isn't finished
319                         serv_puts("OIDF");
320                         serv_getln(buf, sizeof buf);
321
322                         if (buf[0] == '8') {
323                                 urlcontent *u;
324                                 void *U;
325                                 long HKLen;
326                                 char *HKey;
327                                 HashPos *Cursor;
328                                 
329                                 Cursor = GetNewHashPos ();
330                                 while (GetNextHashPos(WCC->urlstrings, Cursor, &HKLen, &HKey, &U)) {
331                                         u = (urlcontent*) U;
332                                         if (!strncasecmp(u->url_key, "openid.", 7)) {
333                                                 serv_printf("%s|%s", &u->url_key[7], u->url_data);
334                                         }
335                                 }
336
337                                 serv_puts("000");
338
339                                 while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
340                                         // FIXME
341                                 }
342                         }
343                 }
344         }
345
346         /* If we were already logged in, this was an attempt to associate an OpenID account */
347         if (already_logged_in) {
348                 display_openids();
349                 return;
350         }
351
352         /* Otherwise the user is probably attempting to log in using OpenID */
353         if (WC->logged_in) {
354                 if (WC->need_regi) {
355                         display_reg(1);
356                 } else {
357                         do_welcome();
358                 }
359         } else {
360                 display_openid_login(_("Your password was not accepted."));
361         }
362
363 }
364
365
366 /*
367  * Display a welcome screen to the user.
368  *
369  * If this is the first time login, and the web based setup is enabled, 
370  * lead the user through the setup routines
371  */
372 void do_welcome(void)
373 {
374         char buf[SIZ];
375 #ifdef XXX_NOT_FINISHED_YET_XXX
376         FILE *fp;
377         int i;
378
379         /**
380          * See if we have to run the first-time setup wizard
381          */
382         if (WC->is_aide) {
383                 if (!setup_wizard) {
384                         int len;
385                         sprintf(wizard_filename, "setupwiz.%s.%s",
386                                 ctdlhost, ctdlport);
387                         len = strlen(wizard_filename);
388                         for (i=0; i<len; ++i) {
389                                 if (    (wizard_filename[i]==' ')
390                                         || (wizard_filename[i] == '/')
391                                 ) {
392                                         wizard_filename[i] = '_';
393                                 }
394                         }
395         
396                         fp = fopen(wizard_filename, "r");
397                         if (fp != NULL) {
398                                 fgets(buf, sizeof buf, fp);
399                                 buf[strlen(buf)-1] = 0;
400                                 fclose(fp);
401                                 if (atoi(buf) == serv_info.serv_rev_level) {
402                                         setup_wizard = 1; /**< already run */
403                                 }
404                         }
405                 }
406
407                 if (!setup_wizard) {
408                         http_redirect("setup_wizard");
409                 }
410         }
411 #endif
412
413         /*
414          * Go to the user's preferred start page
415          */
416         get_preference("startpage", buf, sizeof buf);
417         if (IsEmptyStr(buf)) {
418                 safestrncpy(buf, "dotskip&room=_BASEROOM_", sizeof buf);
419                 set_preference("startpage", buf, 1);
420         }
421         if (buf[0] == '/') {
422                 strcpy(buf, &buf[1]);
423         }
424         http_redirect(buf);
425 }
426
427
428 /*
429  * Disconnect from the Citadel server, and end this WebCit session
430  */
431 void end_webcit_session(void) {
432         char buf[256];
433
434         if (WC->logged_in) {
435                 sprintf(buf, "%d", WC->current_iconbar);
436                 set_preference("current_iconbar", buf, 0);
437                 set_preference("floordiv_expanded", WC->floordiv_expanded, 1);
438         }
439
440         serv_puts("QUIT");
441         WC->killthis = 1;
442         /* close() of citadel socket will be done by do_housekeeping() */
443 }
444
445 /* 
446  * execute the logout
447  */
448 void do_logout(void)
449 {
450         char buf[SIZ];
451
452         safestrncpy(WC->wc_username, "", sizeof WC->wc_username);
453         safestrncpy(WC->wc_password, "", sizeof WC->wc_password);
454         safestrncpy(WC->wc_roomname, "", sizeof WC->wc_roomname);
455         safestrncpy(WC->wc_fullname, "", sizeof WC->wc_fullname);
456
457         /** Calling output_headers() this way causes the cookies to be un-set */
458         output_headers(1, 1, 0, 1, 0, 0);
459
460         wprintf("<div id=\"logout_screen\">");
461         wprintf("<div class=\"box\">");
462         wprintf("<div class=\"boxlabel\">");
463         wprintf(_("Log off"));
464         wprintf("</div><div class=\"boxcontent\">");    
465         serv_puts("MESG goodbye");
466         serv_getln(buf, sizeof buf);
467
468         if (WC->serv_sock >= 0) {
469                 if (buf[0] == '1') {
470                         fmout("CENTER");
471                 } else {
472                         wprintf("Goodbye\n");
473                 }
474         }
475         else {
476                 wprintf(_("This program was unable to connect or stay "
477                         "connected to the Citadel server.  Please report "
478                         "this problem to your system administrator.")
479                 );
480                 wprintf("<a href=\"http://www.citadel.org/doku.php/"
481                         "faq:mastering_your_os:net#netstat\">%s</a>", 
482                         _("Read More..."));
483         }
484
485         wprintf("<hr /><div class=\"buttons\"> "
486                 "<span class=\"button_link\"><a href=\".\">");
487         wprintf(_("Log in again"));
488         wprintf("</a></span>&nbsp;&nbsp;&nbsp;<span class=\"button_link\">"
489                 "<a href=\"javascript:window.close();\">");
490         wprintf(_("Close window"));
491         wprintf("</a></span></div></div></div></div>\n");
492         wDumpContent(2);
493         end_webcit_session();
494 }
495
496
497 /*
498  * validate new users
499  */
500 void validate(void)
501 {
502         char cmd[SIZ];
503         char user[SIZ];
504         char buf[SIZ];
505         int a;
506
507         output_headers(1, 1, 2, 0, 0, 0);
508         wprintf("<div id=\"banner\">\n");
509         wprintf("<h1>");
510         wprintf(_("Validate new users"));
511         wprintf("</h1>");
512         wprintf("</div>\n");
513
514         wprintf("<div id=\"content\" class=\"service\">\n");
515
516         /* If the user just submitted a validation, process it... */
517         safestrncpy(buf, bstr("user"), sizeof buf);
518         if (!IsEmptyStr(buf)) {
519                 if (havebstr("axlevel")) {
520                         serv_printf("VALI %s|%s", buf, bstr("axlevel"));
521                         serv_getln(buf, sizeof buf);
522                         if (buf[0] != '2') {
523                                 wprintf("<b>%s</b><br />\n", &buf[4]);
524                         }
525                 }
526         }
527
528         /* Now see if any more users require validation. */
529         serv_puts("GNUR");
530         serv_getln(buf, sizeof buf);
531         if (buf[0] == '2') {
532                 wprintf("<b>");
533                 wprintf(_("No users require validation at this time."));
534                 wprintf("</b><br />\n");
535                 wDumpContent(1);
536                 return;
537         }
538         if (buf[0] != '3') {
539                 wprintf("<b>%s</b><br />\n", &buf[4]);
540                 wDumpContent(1);
541                 return;
542         }
543
544         wprintf("<div class=\"fix_scrollbar_bug\">"
545                 "<table class=\"auth_validate\"><tr><td>\n");
546         wprintf("<center>");
547
548         safestrncpy(user, &buf[4], sizeof user);
549         serv_printf("GREG %s", user);
550         serv_getln(cmd, sizeof cmd);
551         if (cmd[0] == '1') {
552                 a = 0;
553                 do {
554                         serv_getln(buf, sizeof buf);
555                         ++a;
556                         if (a == 1)
557                                 wprintf("#%s<br /><H1>%s</H1>",
558                                         buf, &cmd[4]);
559                         if (a == 2)
560                                 wprintf("PW: %s<br />\n", buf);
561                         if (a == 3)
562                                 wprintf("%s<br />\n", buf);
563                         if (a == 4)
564                                 wprintf("%s<br />\n", buf);
565                         if (a == 5)
566                                 wprintf("%s, ", buf);
567                         if (a == 6)
568                                 wprintf("%s ", buf);
569                         if (a == 7)
570                                 wprintf("%s<br />\n", buf);
571                         if (a == 8)
572                                 wprintf("%s<br />\n", buf);
573                         if (a == 9)
574                                 wprintf(_("Current access level: %d (%s)\n"),
575                                         atoi(buf), axdefs[atoi(buf)]);
576                 } while (strcmp(buf, "000"));
577         } else {
578                 wprintf("<H1>%s</H1>%s<br />\n", user, &cmd[4]);
579         }
580
581         wprintf("<hr />");
582         wprintf(_("Select access level for this user:"));
583         wprintf("<br />\n");
584         for (a = 0; a <= 6; ++a) {
585                 wprintf("<a href=\"validate?nonce=%ld?user=", WC->nonce);
586                 urlescputs(user);
587                 wprintf("&axlevel=%d\">%s</A>&nbsp;&nbsp;&nbsp;\n",
588                         a, axdefs[a]);
589         }
590         wprintf("<br />\n");
591
592         wprintf("</CENTER>\n");
593         wprintf("</td></tr></table></div>\n");
594         wDumpContent(1);
595 }
596
597
598
599 /*
600  * Display form for registration.
601  *
602  * (Set during_login to 1 if this registration is being performed during
603  * new user login and will require chaining to the proper screen.)
604  */
605 void display_reg(int during_login)
606 {
607         long vcard_msgnum;
608
609         if (goto_config_room() != 0) {
610                 if (during_login) do_welcome();
611                 else display_main_menu();
612                 return;
613         }
614
615         vcard_msgnum = locate_user_vcard(WC->wc_fullname, -1);
616         if (vcard_msgnum < 0L) {
617                 if (during_login) do_welcome();
618                 else display_main_menu();
619                 return;
620         }
621
622         if (during_login) {
623                 do_edit_vcard(vcard_msgnum, "1", "do_welcome", USERCONFIGROOM);
624         }
625         else {
626                 do_edit_vcard(vcard_msgnum, "1", "display_main_menu", USERCONFIGROOM);
627         }
628
629 }
630
631
632
633
634 /*
635  * display form for changing your password
636  */
637 void display_changepw(void)
638 {
639         char buf[SIZ];
640
641         output_headers(1, 1, 1, 0, 0, 0);
642
643         svput("BOXTITLE", WCS_STRING, _("Change your password"));
644         do_template("beginbox");
645
646         if (!IsEmptyStr(WC->ImportantMessage)) {
647                 wprintf("<span class=\"errormsg\">"
648                         "%s</span><br />\n", WC->ImportantMessage);
649                 safestrncpy(WC->ImportantMessage, "", sizeof WC->ImportantMessage);
650         }
651
652         serv_puts("MESG changepw");
653         serv_getln(buf, sizeof buf);
654         if (buf[0] == '1') {
655                 fmout("CENTER");
656         }
657
658         wprintf("<form name=\"changepwform\" action=\"changepw\" method=\"post\">\n");
659         wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%ld\">\n", WC->nonce);
660         wprintf("<table class=\"altern\" ");
661         wprintf("<tr class=\"even\"><td>");
662         wprintf(_("Enter new password:"));
663         wprintf("</td><td>");
664         wprintf("<input type=\"password\" name=\"newpass1\" value=\"\" maxlength=\"20\"></td></tr>\n");
665         wprintf("<tr class=\"odd\"><td>");
666         wprintf(_("Enter it again to confirm:"));
667         wprintf("</td><td>");
668         wprintf("<input type=\"password\" name=\"newpass2\" value=\"\" maxlength=\"20\"></td></tr>\n");
669         wprintf("</table>\n");
670
671         wprintf("<div class=\"buttons\">\n");
672         wprintf("<input type=\"submit\" name=\"change_action\" value=\"%s\">", _("Change password"));
673         wprintf("&nbsp;");
674         wprintf("<input type=\"submit\" name=\"cancel_action\" value=\"%s\">\n", _("Cancel"));
675         wprintf("</div>\n");
676         wprintf("</form>\n");
677
678         do_template("endbox");
679         wDumpContent(1);
680 }
681
682 /*
683  * change password
684  * if passwords match, propagate it to citserver.
685  */
686 void changepw(void)
687 {
688         char buf[SIZ];
689         char newpass1[32], newpass2[32];
690
691         if (!havebstr("change_action")) {
692                 safestrncpy(WC->ImportantMessage, 
693                         _("Cancelled.  Password was not changed."),
694                         sizeof WC->ImportantMessage);
695                 display_main_menu();
696                 return;
697         }
698
699         safestrncpy(newpass1, bstr("newpass1"), sizeof newpass1);
700         safestrncpy(newpass2, bstr("newpass2"), sizeof newpass2);
701
702         if (strcasecmp(newpass1, newpass2)) {
703                 safestrncpy(WC->ImportantMessage, 
704                         _("They don't match.  Password was not changed."),
705                         sizeof WC->ImportantMessage);
706                 display_changepw();
707                 return;
708         }
709
710         if (IsEmptyStr(newpass1)) {
711                 safestrncpy(WC->ImportantMessage, 
712                         _("Blank passwords are not allowed."),
713                         sizeof WC->ImportantMessage);
714                 display_changepw();
715                 return;
716         }
717
718         serv_printf("SETP %s", newpass1);
719         serv_getln(buf, sizeof buf);
720         sprintf(WC->ImportantMessage, "%s", &buf[4]);
721         if (buf[0] == '2') {
722                 safestrncpy(WC->wc_password, buf, sizeof WC->wc_password);
723                 display_main_menu();
724         }
725         else {
726                 display_changepw();
727         }
728 }
729
730
731
732 void InitModule_AUTH(void)
733 {
734         WebcitAddUrlHandler(HKEY("do_welcome"), do_welcome, 0);
735         return ;
736 }