* Don't display room banner on screens that don't pertain to a particular room
authorArt Cancro <ajc@citadel.org>
Tue, 26 Mar 2002 18:23:24 +0000 (18:23 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 26 Mar 2002 18:23:24 +0000 (18:23 +0000)
* Initial prep for add/change/delete user accounts screen

13 files changed:
webcit/ChangeLog
webcit/Makefile.in
webcit/auth.c
webcit/graphics.c
webcit/mainmenu.c
webcit/netconf.c
webcit/paging.c
webcit/siteconfig.c
webcit/useredit.c [new file with mode: 0644]
webcit/userlist.c
webcit/vcard_edit.c
webcit/webcit.c
webcit/webcit.h

index 29b6f37342395308004e5c52dd97f25693ec520f..dfffe296d3d6e488ac3f2d28a27abf5b38f40cfe 100644 (file)
@@ -1,4 +1,8 @@
 $Log$
+Revision 323.16  2002/03/26 18:23:23  ajc
+* Don't display room banner on screens that don't pertain to a particular room
+* Initial prep for add/change/delete user accounts screen
+
 Revision 323.15  2002/03/22 04:33:08  ajc
 * "vcard edit" button for _other_ users' My Citadel Config rooms as well
 
@@ -758,3 +762,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 0fa91a9c225e78c617dd7b3da49ff92b03596e02..aef57a3f788ff8123fd0547ce6bbbdffa1791fee 100644 (file)
@@ -25,11 +25,12 @@ distclean: clean
 webserver: webserver.o context_loop.o tools.o \
        cookie_conversion.o locate_host.o \
        webcit.o auth.o tcp_sockets.o mainmenu.o serv_func.o who.o \
-       roomops.o messages.o userlist.o paging.o sysmsgs.o vcard.o vcard_edit.o \
+       roomops.o messages.o userlist.o paging.o sysmsgs.o useredit.o \
+       vcard.o vcard_edit.o \
        mime_parser.o graphics.o netconf.o siteconfig.o subst.o $(LIBOBJS)
        $(CC) webserver.o context_loop.o tools.o cookie_conversion.o \
        webcit.o auth.o tcp_sockets.o mainmenu.o serv_func.o who.o \
-       roomops.o messages.o userlist.o paging.o sysmsgs.o \
+       roomops.o messages.o userlist.o paging.o sysmsgs.o useredit.o \
        locate_host.o siteconfig.o subst.o vcard.o vcard_edit.o \
        mime_parser.o graphics.o netconf.o \
        $(LIBOBJS) $(LIBS) -o webserver
index 495730679d61d68a410111e99636bdb269df49dd..ac7acc8e2e6f84e8e6dcfb76213161d19bd17944 100644 (file)
@@ -194,7 +194,7 @@ void validate(void)
        char buf[SIZ];
        int a;
 
-       output_headers(1);
+       output_headers(3);
 
        strcpy(buf, bstr("user"));
        if (strlen(buf) > 0)
@@ -273,7 +273,7 @@ void display_reg(int during_login)
        char buf[SIZ];
        int a;
 
-       output_headers(1);
+       output_headers(3);
 
        wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=007700><TR><TD>");
        wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
@@ -380,7 +380,7 @@ void display_changepw(void)
 {
        char buf[SIZ];
 
-       output_headers(1);
+       output_headers(3);
 
        wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=770000><TR><TD>");
        wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
index 6593d9a057278f1d5cf16370ea75beb67164f07b..d565654f9fc64dbdc17712cfee7bbe20682d921f 100644 (file)
@@ -30,7 +30,7 @@ void display_graphics_upload(char *description, char *check_cmd, char *uplurl)
                display_error(&buf[4]);
                return;
        }
-       output_headers(1);
+       output_headers(3);
        wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=770000><TR><TD>");
        wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
        wprintf("<B>Set/change %s</B>\n", description);
@@ -103,7 +103,7 @@ void select_floor_to_edit_pic(void)
 {
        int a;
 
-       output_headers(1);
+       output_headers(3);
 
        wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=770000><TR><TD>");
        wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
index c67f715c85003e8860b627ad22915e0a97782a32..1a08016f69f0d87a71f9fcdb0c6ed22074458cc6 100644 (file)
@@ -172,6 +172,9 @@ void display_main_menu(void)
                wprintf("Edit site-wide configuration</A>\n");
 
                if (WC->axlevel >= 6) {
+                       wprintf("<LI><A HREF=\"/select_user_to_edit\">\n");
+                       wprintf("Add, change, delete user accounts</A>\n");
+
                        wprintf("<LI><A HREF=\"/validate\">\n");
                        wprintf("Validate new users</A>\n");
 
index a7ca70a694fc22f5749489f32c654079dab71e6b..c6fa9941f78c39c61a362fe5bab0ecc7ced6f143 100644 (file)
@@ -76,7 +76,7 @@ void edit_node(void) {
 
 void display_add_node(void)
 {
-       output_headers(1);
+       output_headers(3);
        wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=000077><TR><TD>");
        wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
        wprintf("<B>Add new node</B>");
@@ -111,7 +111,7 @@ void display_edit_node(void)
 
        strcpy(node, bstr("node"));
 
-       output_headers(1);
+       output_headers(3);
        wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=000077><TR><TD>");
        wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
        wprintf("<B>Edit node configuration for ");
@@ -162,7 +162,7 @@ void display_netconf(void)
        char buf[SIZ];
        char node[SIZ];
 
-       output_headers(1);
+       output_headers(3);
        wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=770000><TR><TD>");
        wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
        wprintf("<B>Network configuration</B>\n");
@@ -204,7 +204,7 @@ void display_confirm_delete_node(void)
 {
        char node[SIZ];
 
-       output_headers(1);
+       output_headers(3);
        wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=770000><TR><TD>");
        wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
        wprintf("<B>Confirm delete</B>\n");
@@ -274,7 +274,7 @@ void add_node(void)
                serv_puts(buf);
                serv_gets(buf);
                if (buf[0] == '1') {
-                       output_headers(1);
+                       output_headers(3);
                        server_to_text();
                        wprintf("<A HREF=\"/display_netconf\">Back to menu</A>\n");
                        wDumpContent(1);
index 9cdb897ebe304761f675185881ea5c70674e56bb..0a88274b6ad1bd6a0e93e75322637fa6594dde7e 100644 (file)
@@ -78,7 +78,7 @@ void page_user(void)
        char buf[SIZ];
        char closewin[SIZ];
 
-       output_headers(1);
+       output_headers(3);
 
        strcpy(recp, bstr("recp"));
        strcpy(sc, bstr("sc"));
index 2ae8a594d4249c7a02eaf6936418cc22cda6171e..cd56db4986bade0c5fb7f83c6ef350cd747c3ce5 100644 (file)
@@ -34,7 +34,7 @@ void display_siteconfig(void)
        char buf[SIZ];
        int i;
 
-       output_headers(1);
+       output_headers(3);
 
        serv_printf("CONF get");
        serv_gets(buf);
diff --git a/webcit/useredit.c b/webcit/useredit.c
new file mode 100644 (file)
index 0000000..47ebb65
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * Administrative screen to add/change/delete user accounts
+ *
+ */
+
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <limits.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <string.h>
+#include <pwd.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <pthread.h>
+#include <signal.h>
+#include "webcit.h"
+
+
+
+
+
+void select_user_to_edit(void)
+{
+       char buf[SIZ];
+       char username[SIZ];
+
+       output_headers(3);      /* No room banner on this screen */
+
+       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=007700><TR><TD>");
+       wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"<B>"
+               "Add/change/delete user accounts"
+               "</B></FONT></TD></TR></TABLE>\n");
+
+       wprintf("<TABLE border=0 CELLSPACING=10><TR VALIGN=TOP>"
+               "<TD>To edit an existing user account, select the user "
+               "name from the list and click 'Edit'.<BR><BR>");
+       
+        wprintf("<CENTER><FORM METHOD=\"POST\" ACTION=\"/display_edituser\">\n");
+        wprintf("<SELECT NAME=\"username\" SIZE=10>\n");
+        serv_puts("LIST");
+        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><BR>\n");
+
+        wprintf("<input type=submit name=sc value=\"Edit\">");
+        wprintf("</FORM></CENTER>\n");
+
+       wprintf("</TD><TD>"
+               "To create a new user account, enter the desired "
+               "user name in the box below and click 'Create'.<BR><BR>");
+
+        wprintf("<CENTER><FORM METHOD=\"POST\" ACTION=\"/create_user\">\n");
+        wprintf("New user: ");
+        wprintf("<input type=text name=username><BR>\n"
+               "<input type=submit value=\"Create\">"
+               "</FORM></CENTER>\n");
+
+       wprintf("</TD></TR></TABLE>\n");
+
+       wDumpContent(1);
+}
+
index 8fd97db3538772189e4f33c83c35cfe44b58d9e1..aa73fc8071eeeff1f780bffd1260eaa2b891cdc9 100644 (file)
@@ -49,7 +49,7 @@ void userlist(void)
                        strcpy(bptr->name, buf);
                        bio = bptr;
                }
-       output_headers(1);
+       output_headers(3);
 
        serv_puts("LIST");
        serv_gets(buf);
@@ -113,7 +113,7 @@ void showuser(void)
        char buf[SIZ];
        int have_pic;
 
-       output_headers(1);
+       output_headers(3);
 
 
        wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=007700><TR><TD>");
index 58047f7b8c85d937e10f889194751fee14c22dc3..af5df8bad6c2326d75b2d9258727e86c3dc2c47d 100644 (file)
@@ -75,7 +75,7 @@ void edit_vcard(void) {
        inetemail[0] = 0;
        extrafields[0] = 0;
 
-       output_headers(1);
+       output_headers(3);
 
        strcpy(whatuser, "");
        sprintf(buf, "MSG0 %s|1", bstr("msgnum") );
index c285ab10849061878a1804bbce63ba35d2574d8a..f5ed5e0c0e7bf0c3cf27196137fdcba21087a82c 100644 (file)
@@ -1035,6 +1035,8 @@ void session_loop(struct httprequest *req)
                edit_vcard();
        } else if (!strcasecmp(action, "submit_vcard")) {
                submit_vcard();
+       } else if (!strcasecmp(action, "select_user_to_edit")) {
+               select_user_to_edit();
        } else if (!strcasecmp(action, "diagnostics")) {
                output_headers(1);
 
index f7c71210cfc6543bbaa21aa821034b6c3673f5f4..19e411f83ceaa4764cdfe5eb8e60ef45248681f0 100644 (file)
@@ -292,3 +292,4 @@ int pattern2(char *search, char *patn);
 void edit_vcard(void);
 void submit_vcard(void);
 void striplt(char *);
+void select_user_to_edit(void);