]> code.citadel.org Git - citadel.git/commitdiff
Added an "edit your session" screen to change your wholisting.
authorArt Cancro <ajc@citadel.org>
Tue, 5 Jan 1999 04:40:39 +0000 (04:40 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 5 Jan 1999 04:40:39 +0000 (04:40 +0000)
webcit/ChangeLog
webcit/child.h
webcit/webcit.c
webcit/who.c

index a3d1ea257c90935aa52686402a53b41928654065..1ccbb89d62b03d8c93664005102db64aaff1e800 100644 (file)
@@ -1,5 +1,6 @@
 Mon Jan  4 23:04:36 EST 1999 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Removed wc_host and wc_port cookies.
+       * Added an "edit your session" screen to change your wholisting.
 
 Sun Jan  3 20:05:31 EST 1999 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Added "enter registration"
index f2f041d5aec4dc4a12256e8ce5f8362c90c298b5..c51a6697d9af487f1c65e84419f42adbe9e63199 100644 (file)
@@ -97,3 +97,4 @@ void add_node(void);
 void display_share(void);
 void share(void);
 void terminate_session(void);
+void edit_me(void);
index e4f0c400950fd45334967856fe4286f157e18b53..831c96718b17807a451d8ac2e0dcfda93765e330 100644 (file)
@@ -858,6 +858,10 @@ void session_loop(void) {
                terminate_session();
                }
 
+       else if (!strcasecmp(action, "edit_me")) {
+               edit_me();
+               }
+
        /* When all else fails... */
        else {
                printf("HTTP/1.0 200 OK\n");
index de3d955ece6c07ba04659616cf2194f4a9b283cb..0798af57cc5d365b77d6658ad0f0bd32a97128f3 100644 (file)
@@ -86,11 +86,15 @@ void whobbs(void) {
 
                while (wlist != NULL) {
                        wprintf("<TR><TD>%d", wlist->sessionnum);
-                       if (is_aide) {
+                       if ( (is_aide) &&
+                          (wlist->sessionnum != serv_info.serv_pid) ) {
                                wprintf(" <A HREF=\"/terminate_session&which_session=%d&session_owner=", wlist->sessionnum);
                                urlescputs(wlist->username);
                                wprintf("\">(kill)</A>");
                                }
+                       if (wlist->sessionnum == serv_info.serv_pid) {
+                               wprintf(" <A HREF=\"/edit_me\">(edit)</A>");
+                               }
                        wprintf("</TD><TD>");
                        escputs(wlist->username);
                        wprintf("</TD><TD>");
@@ -149,3 +153,80 @@ void terminate_session(void) {
                }
 
        }
+
+
+
+/*
+ * Change your session info (fake roomname and hostname)
+ */
+void edit_me(void) {
+       char buf[256];
+
+       printf("HTTP/1.0 200 OK\n");
+       output_headers(1);
+
+       if (!strcasecmp(bstr("sc"), "Change room name")) {
+               serv_printf("RCHG %s", bstr("fake_roomname"));
+               serv_gets(buf);
+               whobbs();
+               }
+       else if (!strcasecmp(bstr("sc"), "Change host name")) {
+               serv_printf("HCHG %s", bstr("fake_hostname"));
+               serv_gets(buf);
+               whobbs();
+               }
+       else if (!strcasecmp(bstr("sc"), "Change user name")) {
+               serv_printf("UCHG %s", bstr("fake_username"));
+               serv_gets(buf);
+               whobbs();
+               }
+       else if (!strcasecmp(bstr("sc"), "Cancel")) {
+               whobbs();
+               }
+       else {
+
+                       wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
+                       wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"<B>");
+               wprintf("Edit your session display");
+                       wprintf("</B></FONT></TD></TR></TABLE>\n");
+       
+               wprintf("This screen allows you to change the way your\n");
+               wprintf("session appears in the 'Who is online' listing.\n");
+               wprintf("To turn off any 'fake' name you've previously\n");
+               wprintf("set, simply click the appropriate 'change' button\n");
+               wprintf("without typing anything in the corresponding box.\n");
+               wprintf("<BR>\n");
+
+               wprintf("<FORM METHOD=\"POST\" ACTION=\"/edit_me\">\n");
+
+               wprintf("<TABLE border=0 width=100%>\n");
+
+               wprintf("<TR><TD>Room name:</TD><TD>");
+               wprintf("<INPUT TYPE=\"text\" NAME=\"fake_roomname\" MAXLENGTH=\"64\">\n");
+               wprintf("</TD><TD>");
+               wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Change room name\">");
+               wprintf("</TD></TR>\n");
+
+               wprintf("<TR><TD>Host name:</TD><TD>");
+               wprintf("<INPUT TYPE=\"text\" NAME=\"fake_hostname\" MAXLENGTH=\"64\">\n");
+               wprintf("</TD><TD>");
+               wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Change host name\">");
+               wprintf("</TD></TR>\n");
+
+               if (is_aide) {
+                       wprintf("<TR><TD>User name:</TD><TD>");
+                       wprintf("<INPUT TYPE=\"text\" NAME=\"fake_username\" MAXLENGTH=\"64\">\n");
+                       wprintf("</TD><TD>");
+                       wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Change user name\">");
+                       wprintf("</TD></TR>\n");
+                       }
+
+               wprintf("<TR><TD></TD><TD></TD><TD>");
+               wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
+               wprintf("</TD></TR></TABLE>\n");
+
+               wprintf("</FORM></CENTER></BODY></HTML>\n");
+               wDumpContent();
+               }
+       }
+