4 * This file contains code which relates to authentication of users to Citadel.
16 void display_login_page() {
18 printf("HTTP/1.0 200 OK\n");
21 wprintf("<HTML><HEAD><TITLE>Please log in</TITLE></HEAD><BODY>\n");
22 wprintf("<TABLE border=0><TR><TD>\n");
23 wprintf("<IMG SRC=\"/static/velma.gif\">\n");
25 wprintf("<H1>"Velma"</H1><H2>(next generation WebCit)</H2>");
26 wprintf("Please log in...<BR>\n");
29 wprintf("<FORM ACTION=\"/login\" METHOD=\"POST\">\n");
30 wprintf("<TABLE border><TR><TD>");
31 wprintf("User Name:</TD><TD><INPUT TYPE=\"text\" NAME=\"name\" MAXLENGTH=\"25\" >\n");
32 wprintf("</TD></TR><TD>");
33 wprintf("Password:</TD><TD><INPUT TYPE=\"password\" NAME=\"pass\" MAXLENGTH=\"20\">");
34 wprintf("</TD></TR></TABLE>\n");
35 wprintf("<INPUT type=\"submit\" NAME=\"action\" VALUE=\"Login\">\n");
36 wprintf("<INPUT type=\"submit\" NAME=\"action\" VALUE=\"New User\">\n");
37 wprintf("<INPUT type=\"submit\" NAME=\"action\" VALUE=\"Exit\">\n");
40 wprintf("</TD></TR></TABLE>\n");
41 wprintf("</BODY></HTML>\n");
49 void output_frameset() {
50 printf("HTTP/1.0 200 OK\n");
53 wprintf("<HTML><HEAD><TITLE>FrameSet</TITLE></HEAD>\n");
54 wprintf("<FRAMESET cols=\"20%, 80%\">\n");
55 wprintf(" <FRAME src=\"/static/velma.gif\">\n");
56 wprintf(" <FRAME src=\"/thepage\">\n");
57 wprintf("<NOFRAMES>\n");
58 wprintf("ooo! no frames! too bad!\n");
59 wprintf("</NOFRAMES>\n");
60 wprintf("</FRAMESET></HTML>\n");
69 if (!strcasecmp(bstr("action"), "Login")) {
70 serv_printf("USER %s", bstr("name"));
73 serv_printf("PASS %s", bstr("pass"));
85 printf("HTTP/1.0 200 OK\n");
87 wprintf("<HTML><HEAD><TITLE>Nope</TITLE></HEAD><BODY>\n");
88 wprintf("Your password was not accepted.\n");
89 wprintf("<HR><A HREF=\"/\">Try again</A>\n");
90 wprintf("</BODY></HTML>\n");