* Added a "kill session" link to each line of the wholist when
authorArt Cancro <ajc@citadel.org>
Mon, 4 Jan 1999 04:09:51 +0000 (04:09 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 4 Jan 1999 04:09:51 +0000 (04:09 +0000)
          logged in as an aide, and the screens to perform this operation.

webcit/ChangeLog
webcit/child.h
webcit/webcit.c
webcit/who.c

index fff72b04deb8971b65b2b17f85a0ae2e879d237d..aa9a7357a0c823468cd564508be7a0c3a3a8c1f6 100644 (file)
@@ -6,6 +6,8 @@ Sun Jan  3 20:05:31 EST 1999 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
          be required.  No big deal due to shared code segments.
        * Added "change password"
        * Added networking configuration screens.  These still need testing.
+       * Added a "kill session" link to each line of the wholist when
+         logged in as an aide, and the screens to perform this operation.
 
 Thu Dec 31 21:53:20 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Final cvs commit for 1998 (an awful year, I'm glad to see it over).
index 9236f7273f7962876ed000ed4970f55c15b873a0..f2f041d5aec4dc4a12256e8ce5f8362c90c298b5 100644 (file)
@@ -96,3 +96,4 @@ void display_add_node(void);
 void add_node(void);
 void display_share(void);
 void share(void);
+void terminate_session(void);
index 2f6798de27400732b97328aedf7e0d78148ce954..bdaa899c4ce0de5e7964ce8ba65e19d0af836c11 100644 (file)
@@ -868,6 +868,10 @@ void session_loop(void) {
                share();
                }
 
+       else if (!strcasecmp(action, "terminate_session")) {
+               terminate_session();
+               }
+
        /* When all else fails... */
        else {
                printf("HTTP/1.0 200 OK\n");
index 3b5de640d0cdaae182044ba1f65630294ce5723d..de3d955ece6c07ba04659616cf2194f4a9b283cb 100644 (file)
@@ -85,7 +85,13 @@ void whobbs(void) {
                        }
 
                while (wlist != NULL) {
-                       wprintf("<TR><TD>%d</TD><TD>", wlist->sessionnum);
+                       wprintf("<TR><TD>%d", wlist->sessionnum);
+                       if (is_aide) {
+                               wprintf(" <A HREF=\"/terminate_session&which_session=%d&session_owner=", wlist->sessionnum);
+                               urlescputs(wlist->username);
+                               wprintf("\">(kill)</A>");
+                               }
+                       wprintf("</TD><TD>");
                        escputs(wlist->username);
                        wprintf("</TD><TD>");
                        escputs(wlist->roomname);
@@ -97,9 +103,49 @@ void whobbs(void) {
                        wlist = wptr;
                        }
                }
-       wprintf("</TABLE></CENTER>\n");
-        wprintf("</BODY></HTML>\n");
+       wprintf("</TABLE>\n");
+       wprintf("<A HREF=\"/whobbs\">Refresh</A>\n");
+        wprintf("</CENTER></BODY></HTML>\n");
         wDumpContent();
        }
 
 
+void terminate_session(void) {
+       char buf[256];
+
+       if (!strcasecmp(bstr("confirm"), "Yes")) {
+               serv_printf("TERM %s", bstr("which_session"));
+               serv_gets(buf);
+               if (buf[0]=='2') {
+                       whobbs();
+                       }
+               else {
+                       display_error(&buf[4]);
+                       }
+               }
+
+       else {
+               printf("HTTP/1.0 200 OK\n");
+               output_headers(1);
+               wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
+               wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"<B>Confirm session termination");
+               wprintf("</B></FONT></TD></TR></TABLE>\n");
+       
+               wprintf("Are you sure you want to terminate session %s",
+                       bstr("which_session"));
+               if (strlen(bstr("session_owner"))>0) {
+                       wprintf(" (");
+                       escputs(bstr("session_owner"));
+                       wprintf(")");
+                       }
+               wprintf("?<BR><BR>\n");
+       
+               wprintf("<A HREF=\"/terminate_session&which_session=%s&confirm=yes\">",
+                       bstr("which_session"));
+               wprintf("Yes</A>&nbsp;&nbsp;&nbsp;");
+               wprintf("<A HREF=\"/whobbs\">No</A>");
+               wprintf("</BODY></HTML>\n");
+               wDumpContent();
+               }
+
+       }