]> code.citadel.org Git - citadel.git/commitdiff
Got lots of goto, ungoto, skip, etc. working
authorArt Cancro <ajc@citadel.org>
Fri, 4 Dec 1998 02:09:29 +0000 (02:09 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 4 Dec 1998 02:09:29 +0000 (02:09 +0000)
Advanced menu is in place

webcit/auth.c
webcit/mainmenu.c
webcit/webcit.c
webcit/webcit.h

index 9296e8a9c569f7815dc4d62be7937eaf244d7c69..f48a44d414f2267d17843aa666c2efe5e3d2199e 100644 (file)
 /*
  * This function needs to get called whenever a PASS or NEWU succeeds
  */
-void become_logged_in(char *user, char *pass) {
-
+void become_logged_in(char *user, char *pass, char *serv_response) {
        logged_in = 1;
-       strcpy(wc_username, user);
+       extract(wc_username, &serv_response[4], 0);
        strcpy(wc_password, pass);
-       
+       axlevel = extract_int(&serv_response[4], 1);
+       if (axlevel >=6) is_aide = 1;
        }
 
 
@@ -37,8 +37,8 @@ void do_login() {
                        serv_printf("PASS %s", bstr("pass"));
                        serv_gets(buf);
                        if (buf[0]=='2') {
-                               extract(actual_username, &buf[4], 0);
-                               become_logged_in(actual_username, bstr("pass"));
+                               become_logged_in(bstr("name"),
+                                       bstr("pass"), buf);
                                }
                        }
                }
index 64ac83f56b7ab3ee21cf5b85b85da4ac7eb28d09..0ead5a93b65e7cd8551ab33872eee8883a38253e 100644 (file)
@@ -21,21 +21,19 @@ void embed_main_menu() {
        wprintf("List known rooms</B></A><BR>\n");
        wprintf("Where can I go from here?</LI>\n");
        
-       wprintf("<LI><B><A HREF=\"/gotonext\">\n");
+       wprintf("<LI><B><A HREF=\"/gotonext\" TARGET=\"top\">\n");
        wprintf("Goto next room</B></A><BR>\n");
        wprintf("...with <EM>unread</EM> messages</LI>\n");
        
-       wprintf("<LI><B><A HREF=\"/skip\">\n");
+       wprintf("<LI><B><A HREF=\"/skip\" TARGET=\"top\">\n");
        wprintf("Skip to next room</B></A><BR>\n");
        wprintf("(come back here later)</LI>\n");
        
-       /* ungoto not supported yet
-       if ( (strlen(ugname)>0) && (strucmp(ugname,room_name)) ) {
-               wprintf("<LI><B><A HREF=\"/ungoto\">\n");
+       if ( (strlen(ugname)>0) && (strcasecmp(ugname,wc_roomname)) ) {
+               wprintf("<LI><B><A HREF=\"/ungoto\" TARGET=\"top\">\n");
                wprintf("Ungoto</B></A><BR>\n");
                wprintf("(oops! Back to %s)</LI>\n",ugname);
                }
-       */
        
        wprintf("</UL>\n");
        
@@ -73,6 +71,120 @@ void embed_main_menu() {
        wprintf("</CENTER>\n");
        }
 
+/*
+ * advanced options
+ */
+void embed_advanced_menu() {
+
+wprintf("<TABLE WIDTH=100%><TR VALIGN=TOP><TD>");
+
+
+wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
+wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
+wprintf("<B>Interaction</B>\n");
+wprintf("</FONT></TD></TR></TABLE>\n");
+
+wprintf("<UL>");
+wprintf("<LI><A HREF=\"/display_page\">\n");
+wprintf("Page another user</A>\n");
+
+wprintf("<LI><A HREF=\"/chat\">");
+wprintf("Chat with other online users</A>\n");
+
+wprintf("</UL>\n");
+
+wprintf("</TD><TD>");
+
+wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
+wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
+wprintf("<B>Your info</B>\n");
+wprintf("</FONT></TD></TR></TABLE>\n");
+
+wprintf("<UL>");
+wprintf("<LI><A HREF=\"/display_editbio\">\n");
+wprintf("Enter your 'bio' (a few words about yourself)</A>\n");
+
+wprintf("<LI><A HREF=\"/display_editpic\">\n");
+wprintf("Edit your online photo</A>\n");
+
+wprintf("<LI><A HREF=\"/display_reg\">\n");
+wprintf("Re-enter your registration info (name, address, etc.)</A>\n");
+
+wprintf("<LI><A HREF=\"/display_changepw\">\n");
+wprintf("Change your password</A>\n");
+
+wprintf("</UL>\n");
+
+
+wprintf("</TD></TR><TR VALIGN=TOP><TD>");
+
+wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
+wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
+wprintf("<B>Advanced room commands</B>\n");
+wprintf("</FONT></TD></TR></TABLE>\n");
+
+wprintf("<UL>");
+wprintf("<LI><A HREF=\"/display_private\">\n");
+wprintf("Go to a 'hidden' room</A>\n");
+
+wprintf("<LI><A HREF=\"/display_entroom\">");
+wprintf("Create a new room</A>\n");
+
+wprintf("<LI><A HREF=\"/display_zap\">");
+wprintf("Zap (forget) this room (%s)</A>\n", wc_roomname);
+
+wprintf("<LI><A HREF=\"/zapped_list\">");
+wprintf("List all forgotten rooms</A>\n");
+
+wprintf("</UL>\n");
+
+wprintf("</TD><TD>");
+
+if ((axlevel>=6) || (is_room_aide)) {
+       wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007777><TR><TD>");
+       wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
+       wprintf("<B>Administrative functions</B>\n");
+       wprintf("</FONT></TD></TR></TABLE>\n");
+
+       wprintf("<UL>");
+       wprintf("<LI><A HREF=\"/display_editroom\">\n");
+       wprintf("Edit this room</A>\n");
+       
+       wprintf("<LI><A HREF=\"/confirm_delete_room\">\n");
+       wprintf("Delete this room</A>\n");
+       
+       wprintf("<LI><A HREF=\"/display_editroompic\">\n");
+       wprintf("Set or change the graphic for this room's banner</A>\n");
+
+       wprintf("<LI><A HREF=\"/display_editinfo\">\n");
+       wprintf("Edit this room's Info file</A>\n");
+
+       if (axlevel>=6) {
+               wprintf("<LI><A HREF=\"/validate\">\n");
+               wprintf("Validate new users</A>\n");
+
+               wprintf("<LI><A HREF=\"/display_editfloorpic\">\n");
+               wprintf("Set or change a floor label graphic</A>\n");
+
+               wprintf("<LI><A HREF=\"/display_netconf\">\n");
+               wprintf("Configure networking with other systems</A>\n");
+               }
+
+       wprintf("</UL>\n");
+       }
+
+wprintf("</TD></TR></TABLE>");
+
+wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770077><TR><TD>");
+wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
+wprintf("<B>Basic commands</B>\n");
+wprintf("</FONT></TD></TR></TABLE>\n");
+
+       }
+
+
+
+
 /*
  * menu of commands (as a page)
  */
@@ -84,3 +196,14 @@ void display_main_menu() {
        wprintf("</BODY></HTML>\n");
        wDumpContent();
        }
+
+
+void display_advanced_menu() {
+       printf("HTTP/1.0 200 OK\n");
+       output_headers();
+       wprintf("<HTML><HEAD><TITLE>WebCit main menu</TITLE></HEAD><BODY>\n");
+       embed_advanced_menu();
+       embed_main_menu();
+       wprintf("</BODY></HTML>\n");
+       wDumpContent();
+       }
index 9a44d5692bd341189f4669bcc0e1ed26184a34b8..95a7146993db92a991f916637a106e5d7de9684b 100644 (file)
@@ -25,6 +25,7 @@ char wc_roomname[256];
 int TransactionCount = 0;
 int connected = 0;
 int logged_in = 0;
+int axlevel;
 
 struct webcontent *wlist = NULL;
 struct webcontent *wlast = NULL;
@@ -422,8 +423,7 @@ void session_loop() {
                        serv_printf("PASS %s", c_password);
                        serv_gets(buf);
                        if (buf[0]=='2') {
-                               extract(c_username, &buf[4], 0);
-                               become_logged_in(c_username, c_password);
+                               become_logged_in(c_username, c_password, buf);
                                }
                        }
                }
@@ -472,6 +472,10 @@ void session_loop() {
                display_main_menu();
                }
 
+       else if (!strncasecmp(cmd, "GET /advanced", 13)) {
+               display_advanced_menu();
+               }
+
        else if (!strncasecmp(cmd, "GET /whobbs", 11)) {
                whobbs();
                }
@@ -481,6 +485,11 @@ void session_loop() {
                }
 
        else if (!strncasecmp(cmd, "GET /gotonext", 13)) {
+               slrp_highest();
+               gotonext();
+               }
+
+       else if (!strncasecmp(cmd, "GET /skip", 9)) {
                gotonext();
                }
 
@@ -489,6 +498,7 @@ void session_loop() {
                }
 
        else if (!strncasecmp(cmd, "GET /dotgoto", 12)) {
+               slrp_highest();
                dotgoto();
                }
 
index d46a633e5e937011e0856268d63fe972e07be6ef..1e0e95891f911367f85fb77ba237524089c3d2a6 100644 (file)
@@ -61,8 +61,16 @@ extern char wc_password[256];
 extern char wc_roomname[256];
 extern int connected;
 extern int logged_in;
+extern int axlevel;
+extern int is_aide;
+extern int is_room_aide;
 extern int serv_sock;
 extern struct serv_info serv_info;
+extern unsigned room_flags;
+extern char ugname[128];
+extern long uglsn;
+
+
 
 void serv_printf(const char *format, ...);
 char *bstr();