Don't offer to create new user accounts if the server disables it.
authorArt Cancro <ajc@citadel.org>
Thu, 2 Mar 2006 03:49:15 +0000 (03:49 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 2 Mar 2006 03:49:15 +0000 (03:49 +0000)
citadel/citadel.c
citadel/citadel_ipc.c
citadel/citadel_ipc.h

index 8a7adc5ae11b83c8b01b95f26a3d3e82b781fc0f..d7875992b3b328271896ab45b37418d4c8dc9ced 100644 (file)
@@ -1303,11 +1303,16 @@ int main(int argc, char **argv)
        goto GSTA;
 
 NEWUSR:        if (strlen(rc_password) == 0) {
-               scr_printf("'%s' not found.\n"
-                       "Do you want to create a new account with this name? ",
+               scr_printf("'%s' not found.\n", fullname);
+               scr_printf("Type 'off' if you would like to exit.\n");
+               if (ipc->ServInfo.newuser_disabled == 1) {
+                       goto GSTA;
+               }
+               scr_printf("Do you want to create a new user account called '%s'? ",
                        fullname);
-               if (yesno() == 0)
+               if (yesno() == 0) {
                        goto GSTA;
+               }
        }
 
        r = CtdlIPCCreateUser(ipc, fullname, 1, aaa);
index cee446ed95156714f91c2ef824b802bb384f4ff4..840c4f2c63708e6d4fa973d602e02aab93a1b650 100644 (file)
@@ -668,6 +668,8 @@ int CtdlIPCServerInfo(CtdlIPC *ipc, char *cret)
                                        break;
                        case 14:        ipc->ServInfo.supports_ldap = atoi(buf);
                                        break;
+                       case 15:        ipc->ServInfo.newuser_disabled = atoi(buf);
+                                       break;
                        }
                }
 
index 1bd48dafb3374cc1f92766db2d0c8987b2c9208b..d16689e20e76d488c5bffb95c77e12f7324deb0e 100644 (file)
@@ -46,6 +46,7 @@ struct CtdlServInfo {
        int paging_level;
        int supports_qnop;
        int supports_ldap;
+       int newuser_disabled;
 };
 
 /* This class is responsible for the server connection */