]> code.citadel.org Git - citadel.git/commitdiff
* <.A>ide <U>ser-edit is now <.A>ide <U>ser <E>dit
authorArt Cancro <ajc@citadel.org>
Fri, 11 Feb 2005 03:51:51 +0000 (03:51 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 11 Feb 2005 03:51:51 +0000 (03:51 +0000)
* Added a new <.A>ide <U>ser <D>elete command, because it is unintuitive
  to tell people "delete a user by setting their access level to 0"

citadel/ChangeLog
citadel/citadel.c
citadel/citadel.rc
citadel/routines.c
citadel/routines.h

index 53011ffd732e78053775b2e5f9d0f6abea7caf71..a3ff78cd378a1c5b87518a1ab9fcd0386565892e 100644 (file)
@@ -1,4 +1,9 @@
  $Log$
+ Revision 640.1  2005/02/11 03:51:51  ajc
+ * <.A>ide <U>ser-edit is now <.A>ide <U>ser <E>dit
+ * Added a new <.A>ide <U>ser <D>elete command, because it is unintuitive
+   to tell people "delete a user by setting their access level to 0"
+
  Revision 640.0  2005/02/10 16:52:18  ajc
  * THIS IS 6.40
 
@@ -6366,4 +6371,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
-
index 336957be5f79cafc413a5aad220b7c5f70cea49b..b08346f9369085f8adc695f798decd6c0cbd3d49 100644 (file)
@@ -1786,7 +1786,11 @@ NEWUSR:  if (strlen(rc_password) == 0) {
                                break;
 
                        case 25:
-                               edituser(ipc);
+                               edituser(ipc, 25);
+                               break;
+
+                       case 96:
+                               edituser(ipc, 96);
                                break;
 
                        case 8:
index 73fcbf4dd95d1e9e1e5db25bfcb15a99cb52d6f1..51dd2b94f57a4ad39a0780813beb2f54fdf1d988 100644 (file)
@@ -273,7 +273,8 @@ cmd=21,0,&.,&Help:
 cmd=22,1,&.,&Aide,&Kill this room
 cmd=23,1,&.,&Aide,&Edit this room
 cmd=24,0,&.,&Aide,&Who knows room
-cmd=25,2,&.,&Aide,edit &User
+cmd=25,2,&.,&Aide,&User,&Edit
+cmd=96,2,&.,&Aide,&User,&Delete
 cmd=26,2,&.,&Aide,&Validate new users
 cmd=48,1,&.,&Aide,enter &Info file
 cmd=27,0,&.,&Aide,&Room,&Invite user
index cb002dd5cba3d769b5f32d7bbd088fd9c3f22a2f..ecbdc3cf579bd54d0621b967483a485c1bc7ae1b 100644 (file)
@@ -100,9 +100,9 @@ void hit_any_key(CtdlIPC *ipc) {    /* hit any key to continue */
 }
 
 /*
- * change a user's access level
+ * Edit or delete a user (cmd=25 to edit/create, 96 to delete)
  */
-void edituser(CtdlIPC *ipc)
+void edituser(CtdlIPC *ipc, int cmd)
 {
        char buf[SIZ];
        char who[USERNAME_SIZE];
@@ -110,47 +110,57 @@ void edituser(CtdlIPC *ipc)
        int newnow = 0;
        int r;                          /* IPC response code */
 
-       newprompt("User name: ", who, 25);
+       newprompt("User name: ", who, 29);
        while ((r = CtdlIPCAideGetUserParameters(ipc, who, &user, buf)) / 100 != 2) {
                scr_printf("%s\n", buf);
-               scr_printf("Do you want to create this user? ");
-               if (yesno()) {
-                       r = CtdlIPCCreateUser(ipc, who, 0, buf);
-                       if (r / 100 == 2) {
-                               newnow = 1;
-                               continue;
+               if (cmd == 25) {
+                       scr_printf("Do you want to create this user? ");
+                       if (yesno()) {
+                               r = CtdlIPCCreateUser(ipc, who, 0, buf);
+                               if (r / 100 == 2) {
+                                       newnow = 1;
+                                       continue;
+                               }
+                               scr_printf("%s\n",&buf[4]);
                        }
-                       scr_printf("%s\n",&buf[4]);
                }
                free(user);
                return;
        }
 
-       val_user(ipc, user->fullname, 0); /* Display registration */
+       if (cmd == 25) {
+               val_user(ipc, user->fullname, 0); /* Display registration */
 
-       if (newnow || boolprompt("Change password", 0)) {       /* I'm lazy */
-               strprompt("Password", user->password, -19);
+               if (newnow || boolprompt("Change password", 0)) {
+                       strprompt("Password", user->password, -19);
+               }
+       
+               user->axlevel = intprompt("Access level", user->axlevel, 0, 6);
+       
+               user->flags = set_attr(ipc, user->flags,
+                       "Permission to send Internet mail",
+                       US_INTERNET, 0);
+       
+               if (boolprompt("Ask user to register again", !(user->flags & US_REGIS)))
+                       user->flags &= ~US_REGIS;
+               else
+                       user->flags |= US_REGIS;
+               user->timescalled = intprompt("Times called",
+                               user->timescalled, 0, INT_MAX);
+               user->posted = intprompt("Messages posted",
+                                       user->posted, 0, INT_MAX);
+               user->lastcall = boolprompt("Set last call to now", 0) ?
+                                       time(NULL) : user->lastcall;
+               user->USuserpurge = intprompt("Purge time (in days, 0 for system default",
+                               user->USuserpurge, 0, INT_MAX);
        }
 
-       user->axlevel = intprompt("Access level", user->axlevel, 0, 6);
-
-       user->flags = set_attr(ipc, user->flags,
-               "Permission to send Internet mail",
-               US_INTERNET, 0);
-
-       if (boolprompt("Ask user to register again", !(user->flags & US_REGIS)))
-               user->flags &= ~US_REGIS;
-       else
-               user->flags |= US_REGIS;
-       user->timescalled = intprompt("Times called",
-                                     user->timescalled, 0, INT_MAX);
-       user->posted = intprompt("Messages posted",
-                                user->posted, 0, INT_MAX);
-       user->lastcall = boolprompt("Set last call to now", 0) ?
-                                               time(NULL) : user->lastcall;
-       user->USuserpurge = intprompt("Purge time (in days, 0 for system default",
-                                     user->USuserpurge, 0, INT_MAX);
-
+       if (cmd == 96) {
+               scr_printf("Do you want to delete this user? ");
+               if (!yesno()) return;
+               user->axlevel = 0;
+       }
+       
        r = CtdlIPCAideSetUserParameters(ipc, user, buf);
        if (r / 100 != 2) {
                scr_printf("%s\n", buf);
index c1b0131e68012637ce56a9596910c88461a3619b..9d8e50976627142d65731aae40476e2a3971ab3b 100644 (file)
@@ -1,5 +1,5 @@
 /* $Id$ */
-void edituser(CtdlIPC *ipc);
+void edituser(CtdlIPC *ipc, int cmd);
 void interr(int errnum);
 int struncmp(char *lstr, char *rstr, int len);
 int pattern(char *search, char *patn);