From 4f6b7bf87af8d58979f6af4c054e122d1dd275a4 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Mon, 4 Jan 1999 04:09:51 +0000 Subject: [PATCH] * Added a "kill session" link to each line of the wholist when logged in as an aide, and the screens to perform this operation. --- webcit/ChangeLog | 2 ++ webcit/child.h | 1 + webcit/webcit.c | 4 ++++ webcit/who.c | 52 +++++++++++++++++++++++++++++++++++++++++++++--- 4 files changed, 56 insertions(+), 3 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index fff72b04d..aa9a7357a 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -6,6 +6,8 @@ Sun Jan 3 20:05:31 EST 1999 Art Cancro 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 * Final cvs commit for 1998 (an awful year, I'm glad to see it over). diff --git a/webcit/child.h b/webcit/child.h index 9236f7273..f2f041d5a 100644 --- a/webcit/child.h +++ b/webcit/child.h @@ -96,3 +96,4 @@ void display_add_node(void); void add_node(void); void display_share(void); void share(void); +void terminate_session(void); diff --git a/webcit/webcit.c b/webcit/webcit.c index 2f6798de2..bdaa899c4 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -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"); diff --git a/webcit/who.c b/webcit/who.c index 3b5de640d..de3d955ec 100644 --- a/webcit/who.c +++ b/webcit/who.c @@ -85,7 +85,13 @@ void whobbs(void) { } while (wlist != NULL) { - wprintf("%d", wlist->sessionnum); + wprintf("%d", wlist->sessionnum); + if (is_aide) { + wprintf(" sessionnum); + urlescputs(wlist->username); + wprintf("\">(kill)"); + } + wprintf(""); escputs(wlist->username); wprintf(""); escputs(wlist->roomname); @@ -97,9 +103,49 @@ void whobbs(void) { wlist = wptr; } } - wprintf("\n"); - wprintf("\n"); + wprintf("\n"); + wprintf("Refresh\n"); + wprintf("\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("
"); + wprintf("Confirm session termination"); + wprintf("
\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("?

\n"); + + wprintf("", + bstr("which_session")); + wprintf("Yes   "); + wprintf("No"); + wprintf("\n"); + wDumpContent(); + } + + } -- 2.39.2