From d587a884353577537c70e5e4259c604b0f5ee3d9 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 26 Mar 2002 19:01:12 +0000 Subject: [PATCH] * More edit user stuff --- webcit/ChangeLog | 4 ++- webcit/static/error.gif | Bin 0 -> 1332 bytes webcit/useredit.c | 74 +++++++++++++++++++++++++++++++++++++++- webcit/webcit.c | 6 +++- webcit/webcit.h | 4 ++- 5 files changed, 84 insertions(+), 4 deletions(-) create mode 100644 webcit/static/error.gif diff --git a/webcit/ChangeLog b/webcit/ChangeLog index dfffe296d..cfb0d3904 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,7 @@ $Log$ +Revision 323.17 2002/03/26 19:01:12 ajc +* More edit user stuff + 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 @@ -762,4 +765,3 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix - diff --git a/webcit/static/error.gif b/webcit/static/error.gif new file mode 100644 index 0000000000000000000000000000000000000000..57d398c3d97951db28470849e4f88d42f135d7fa GIT binary patch literal 1332 zcmX9-4QQ2R6h8OsUb@^1ZNud)F`N=L_ineSjI7{ZlDRDwh4O~QeyCPSB5l-cLeR;e zpb?~kQMkO;HRLpD(2NPAz7fKdi7at&U@$Cd2wEyH-~t6vG?M= zdT&vCoSD6_SN0aML72shcolCEIb^eXQLpMP;)-H6FXq*}ML-}6c3?z~y<>JPj@7X_ zkU~#10V-fnS8gfH%4|>#y>Sp0VHLJW0cm`GLCgwtOauDh3qipG&Cm_-zyko{c!8xN7RimtK?P@3w_MOW0*~7J!;Wz!a-22j0l0SKbGMV}(Y7WeeAE<5Wh|m04!~LnH zGlyHgT$o5?V#8g1J#U^nlDoMrK6Hf;;<^*3W;XC4%4T;w+Pko?pK61V;{}<1J)I49 zBxh##ebJd|i@#qPo=)tX%#I|(`O}G>OV|{EoL*XJ@2(2-XqsF-2%L9qb$!R^%sLuR z-;wSpRnQCP_GXrEpr>MsBdL|x)%xwv{q~+!&s}JK<` z`fs}HY+I=!|Lb(R>*I%4ULM;;>Em18XxKiMqrn$fI+yqMjP3b-HZywY)XX}*d{4`> zgLrdo`ttR%z7NyXJsC`GEPWK5{O`)sTWP!)=4iQTAed_CKGHY6`MwJQnqJIJHRK0^ z#bd7>ZB2pQuGG$Wh?Khz25VyZUxND^z`Qj7X}D$6rXoESdvG{x&8-Xrs=4o{ZK&Xb zj|V4l%>R8p@Y{}sjkI>p{-8Z5@2>Xl51#*i7`q?-Iv?ylTiy-#P6oTP-Br}pUd(@x zYK!xenT@5nAQK~PO!HSrsZNBA>DKGJA9JZ>dDmCBkh^o>)$dyHS4FEnTZ&&Cyfs$& Sd1ux9n#mKRe^gh}L;nM9(1m;e literal 0 HcmV?d00001 diff --git a/webcit/useredit.c b/webcit/useredit.c index 47ebb6535..7dafbfacd 100644 --- a/webcit/useredit.c +++ b/webcit/useredit.c @@ -29,13 +29,15 @@ -void select_user_to_edit(void) +void select_user_to_edit(char *message) { char buf[SIZ]; char username[SIZ]; output_headers(3); /* No room banner on this screen */ + if (message != NULL) wprintf(message); + wprintf("
"); wprintf("" "Add/change/delete user accounts" @@ -77,3 +79,73 @@ void select_user_to_edit(void) wDumpContent(1); } + + +/* + * Edit a user. If supplied_username is null, look in the "username" + * web variable for the name of the user to edit. + */ +void display_edituser(char *supplied_username) { + char username[SIZ]; + char buf[SIZ]; + char error_message[SIZ]; + + if (supplied_username != NULL) { + strcpy(username, supplied_username); + } + else { + strcpy(username, bstr("username") ); + } + + serv_printf("AGUP %s", username); + serv_gets(buf); + if (buf[0] != '2') { + sprintf(error_message, + "" + "%s

\n", &buf[4]); + select_user_to_edit(error_message); + return; + } + + output_headers(3); /* No room banner on this screen */ + + wprintf("this is %s", username); + + wDumpContent(1); + +} + + + +void create_user(void) { + char buf[SIZ]; + char username[SIZ]; + char error_message[SIZ]; + + strcpy(username, bstr("username")); + + serv_printf("CREU %s", username); + serv_gets(buf); + + if (buf[0] == '2') { + display_edituser(username); + } + else { + sprintf(error_message, + "" + "%s

\n", &buf[4]); + select_user_to_edit(error_message); + return; + } + + output_headers(3); + + wprintf("
"); + wprintf("" + "Edit user account: "); + escputs(username); + wprintf("
\n"); + + wDumpContent(1); + +} diff --git a/webcit/webcit.c b/webcit/webcit.c index f5ed5e0c0..abec0e86c 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -1036,7 +1036,11 @@ void session_loop(struct httprequest *req) } else if (!strcasecmp(action, "submit_vcard")) { submit_vcard(); } else if (!strcasecmp(action, "select_user_to_edit")) { - select_user_to_edit(); + select_user_to_edit(NULL); + } else if (!strcasecmp(action, "display_edituser")) { + display_edituser(NULL); + } else if (!strcasecmp(action, "create_user")) { + create_user(); } else if (!strcasecmp(action, "diagnostics")) { output_headers(1); diff --git a/webcit/webcit.h b/webcit/webcit.h index 19e411f83..289249b0b 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -292,4 +292,6 @@ int pattern2(char *search, char *patn); void edit_vcard(void); void submit_vcard(void); void striplt(char *); -void select_user_to_edit(void); +void select_user_to_edit(char *message); +void display_edituser(char *who); +void create_user(void); -- 2.39.2