From 9a31a5339731e54d2463c620d2f58f791fc9d31a Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sun, 3 Mar 2002 06:48:25 +0000 Subject: [PATCH] * Client and server options to disable self-service user account creation --- citadel/ChangeLog | 4 ++++ citadel/citadel.h | 1 + citadel/control.c | 5 +++++ citadel/routines2.c | 9 ++++++--- citadel/user_ops.c | 6 ++++++ 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 616605d1b..691f46e38 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -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 seredit @@ -3380,3 +3383,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import + diff --git a/citadel/citadel.h b/citadel/citadel.h index 36002c207..2880926b6 100644 --- a/citadel/citadel.h +++ b/citadel/citadel.h @@ -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 diff --git a/citadel/control.c b/citadel/control.c index db5868d5e..470b788ba 100644 --- a/citadel/control.c +++ b/citadel/control.c @@ -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; } diff --git a/citadel/routines2.c b/citadel/routines2.c index 7dc80d4a0..bb53c4c68 100644 --- a/citadel/routines2.c +++ b/citadel/routines2.c @@ -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"); } diff --git a/citadel/user_ops.c b/citadel/user_ops.c index 7954cfc76..701476e26 100644 --- a/citadel/user_ops.c +++ b/citadel/user_ops.c @@ -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; -- 2.39.2