* Client and server options to disable self-service user account creation
authorArt Cancro <ajc@citadel.org>
Sun, 3 Mar 2002 06:48:25 +0000 (06:48 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 3 Mar 2002 06:48:25 +0000 (06:48 +0000)
citadel/ChangeLog
citadel/citadel.h
citadel/control.c
citadel/routines2.c
citadel/user_ops.c

index 616605d1b4749b3ccc9a6f78a5f6b00b71f1b945..691f46e38ebe36fa834b170a800da5d24982a3ba 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 590.124  2002/03/03 06:48:25  ajc
+ * Client and server options to disable self-service user account creation
+
  Revision 590.123  2002/03/03 06:31:58  ajc
  * Added password starred-out entry to newprompt() and strprompt()
  * Applied the above setting to password set/change in <.A>ide <U>seredit
@@ -3380,3 +3383,4 @@ 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 36002c207627eac4e98c941a6c309b40af3a1fac..2880926b6dc4c68a5690ab9bec598c4eee6fa820 100644 (file)
@@ -118,6 +118,7 @@ struct config {
        int c_aide_zap;                 /* Are Aides allowed to zap rooms?  */
        int c_imap_port;                /* IMAP listener port (usually 143) */
        time_t c_net_freq;              /* how often to run the networker   */
+       char c_disable_newu;            /* disable NEWU command             */
 };
 
 #define NODENAME               config.c_nodename
index db5868d5e0a69fc5bccf01355f87526e22766090..470b788ba1976922381b11260db6079c13f330cb 100644 (file)
@@ -187,6 +187,7 @@ void cmd_conf(char *argbuf) {
                cprintf("%d\n", config.c_aide_zap);
                cprintf("%d\n", config.c_imap_port);
                cprintf("%ld\n", config.c_net_freq);
+               cprintf("%d\n", config.c_disable_newu);
                cprintf("000\n");
                }
 
@@ -280,6 +281,10 @@ void cmd_conf(char *argbuf) {
                                break;
                        case 28: config.c_net_freq = atol(buf);
                                break;
+                       case 29: config.c_disable_newu = atoi(buf);
+                               if (config.c_disable_newu != 0)
+                                       config.c_disable_newu = 1;
+                               break;
                        }
                    ++a;
                    }
index 7dc80d4a0f71a41e19a1d04cdd77276a3da2a88e..bb53c4c68aa28875a375a606b9216b4745f696dd 100644 (file)
@@ -694,7 +694,7 @@ void read_bio(void)
 void do_system_configuration(void)
 {
        char buf[SIZ];
-       char sc[29][SIZ];
+       char sc[30][SIZ];
        int expire_mode = 0;
        int expire_value = 0;
        int a;
@@ -709,7 +709,7 @@ void do_system_configuration(void)
        if (buf[0] == '1') {
                a = 0;
                while (serv_gets(buf), strcmp(buf, "000")) {
-                       if (a < 29) {
+                       if (a < 30) {
                                strcpy(&sc[a][0], buf);
                        }
                        ++a;
@@ -745,6 +745,9 @@ void do_system_configuration(void)
        sprintf(&sc[7][0], "%d", (boolprompt(
                                    "Require registration for new users",
                                                    atoi(&sc[7][0]))));
+       sprintf(&sc[29][0], "%d", (boolprompt(
+             "Disable self-service user account creation",
+                                                    atoi(&sc[29][0]))));
        strprompt("Initial access level for new users", &sc[6][0], 1);
        strprompt("Access level required to create rooms", &sc[19][0], 1);
        sprintf(&sc[4][0], "%d", (boolprompt(
@@ -826,7 +829,7 @@ void do_system_configuration(void)
                serv_puts("CONF set");
                serv_gets(buf);
                if (buf[0] == '4') {
-                       for (a = 0; a < 29; ++a)
+                       for (a = 0; a < 30; ++a)
                                serv_puts(&sc[a][0]);
                        serv_puts("000");
                }
index 7954cfc76f5a8ebdc001b9a5ef32dcaed93d5d11..701476e26f32c0b3d3cbee7beed91eeb5e28d5b1 100644 (file)
@@ -764,6 +764,12 @@ void cmd_newu(char *cmdbuf)
        int a;
        char username[SIZ];
 
+       if (config.c_disable_newu) {
+               cprintf("%d Self-service user account creation "
+                       "is disabled on this system.\n", ERROR);
+               return;
+       }
+
        if (CC->logged_in) {
                cprintf("%d Already logged in.\n", ERROR);
                return;