]> code.citadel.org Git - citadel.git/commitdiff
* Applied a patch submitted by "cough" to add who-knows-room and
authorArt Cancro <ajc@citadel.org>
Thu, 15 Feb 2001 01:21:55 +0000 (01:21 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 15 Feb 2001 01:21:55 +0000 (01:21 +0000)
  invite/kickout functionality.

webcit/ChangeLog
webcit/mainmenu.c
webcit/roomops.c
webcit/webcit.c
webcit/webcit.h

index f13e1f779bcc7aaaa0fb191086d0f167aea9693d..4799b24120bdc8889e553d98a34290db53246209 100644 (file)
@@ -1,4 +1,8 @@
 $Log$
+Revision 213.4  2001/02/15 01:21:55  ajc
+* Applied a patch submitted by "cough" to add who-knows-room and
+  invite/kickout functionality.
+
 Revision 213.3  2001/01/25 23:10:00  ajc
 * "Delete message" button now confirms on client-side using JavaScript
 
@@ -514,3 +518,4 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
+
index 4748d79c2852f0887740fcd85154cace157ff88d..12c81a67071e8b4456bfd98099943525fc037097 100644 (file)
@@ -175,6 +175,9 @@ void embed_advanced_menu(void)
                wprintf("<LI><A HREF=\"/display_editroom\">\n");
                wprintf("Edit or delete this room</A>\n");
 
+                wprintf("<LI><A HREF=\"/display_whok\">\n");
+                wprintf("Show who knows this room</A>\n");
+
                wprintf("<LI><A HREF=\"/display_siteconfig\">\n");
                wprintf("Edit site-wide configuration</A>\n");
 
index 78b76eb97338357a1c387e115472b6585a31fb12..2847d18ad21807b5bf0ed80f488e24615318080a 100644 (file)
@@ -920,6 +920,79 @@ void editroom(void)
        smart_goto(er_name);
 }
 
+/*
+ * Invite, Kick, and show Who Knows a room
+ */
+void display_whok(void)
+{
+        char buf[256], room[256], username[256];
+
+        serv_puts("GETR");
+        serv_gets(buf);
+
+        if (buf[0] != '2') {
+                display_error(&buf[4]);
+                return;
+        }
+        extract(room, &buf[4], 0);
+
+        strcpy(username, bstr("username"));
+
+        output_headers(1);
+
+        if(!strcmp(bstr("sc"), "Kick")) {
+                sprintf(buf, "KICK %s", username);
+                serv_puts(buf);
+                serv_gets(buf);
+
+                if (buf[0] != '2') {
+                        display_error(&buf[4]);
+                        return;
+                } else {
+                        wprintf("User %s kicked out of room %s.\n", 
+                                username, room);
+                }
+        } else if(!strcmp(bstr("sc"), "Invite")) {
+                sprintf(buf, "INVT %s", username);
+                serv_puts(buf);
+                serv_gets(buf);
+
+                if (buf[0] != '2') {
+                        display_error(&buf[4]);
+                        return;
+                } else {
+                        wprintf("User %s invited to room %s.\n", 
+                                username, room);
+                }
+        }
+        
+
+        wprintf("<FORM METHOD=\"POST\" ACTION=\"/display_whok\">\n");
+        wprintf("<SELECT NAME=\"username\" SIZE=10>\n");
+        serv_puts("WHOK");
+        serv_gets(buf);
+        if (buf[0] == '1') {
+                while (serv_gets(buf), strcmp(buf, "000")) {
+                        extract(username, buf, 0);
+                        wprintf("<OPTION>");
+                        escputs(username);
+                        wprintf("\n");
+                }
+        }
+        wprintf("</SELECT>\n");
+
+        wprintf("<CENTER>\n");
+        wprintf("<input type=submit name=sc value=\"Kick\">");
+        wprintf("</CENTER>\n");
+        wprintf("</FORM>\n");
+        wprintf("<FORM METHOD=\"POST\" ACTION=\"/display_whok\">\n");
+        wprintf("Invite: ");
+        wprintf("<input type=text name=username>\n");
+        wprintf("<input type=hidden name=sc value=\"Invite\">");
+        wprintf("<input type=submit value=\"Invite\">");
+        wDumpContent(1);
+}
+
 
 
 /*
index 10d1a02296919adeb5da7a995aef411c8dbeaa84..6a0af7eede4f7eee236a9355b4bdcbfae2e89adb 100644 (file)
@@ -830,6 +830,8 @@ void session_loop(struct httprequest *req)
                display_editroom();
        } else if (!strcasecmp(action, "editroom")) {
                editroom();
+        } else if (!strcasecmp(action, "display_whok")) {
+                display_whok();
        } else if (!strcasecmp(action, "display_editinfo")) {
                display_edit("Room info", "EINF 0", "RINF", "/editinfo");
        } else if (!strcasecmp(action, "editinfo")) {
index 32354f435e4068b3a8823203020aa1a54365b387..5d78709c0e611d5c1fab85118647c7f032d05366 100644 (file)
@@ -226,6 +226,7 @@ void display_entroom(void);
 void entroom(void);
 void display_editroom(void);
 void editroom(void);
+void display_whok(void);
 void server_to_text(void);
 void save_edit(char *description, char *enter_cmd, int regoto);
 void display_edit(char *description, char *check_cmd,