From: Art Cancro Date: Wed, 28 Mar 2007 16:52:09 +0000 (+0000) Subject: When self-service user creation is disabled, also disable X-Git-Tag: v7.86~3474 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=751b58602f4719a25ec02f1bdcbe745a115fb5d1 When self-service user creation is disabled, also disable self-service registration. --- diff --git a/citadel/config.c b/citadel/config.c index 35a25b8cb..d938065a2 100644 --- a/citadel/config.c +++ b/citadel/config.c @@ -106,6 +106,10 @@ void get_config(void) { config.c_net_freq = 3600L; /* once per hour default */ if (config.c_net_freq < 300L) config.c_net_freq = 300L; + + /* "create new user" never works with host auth */ + if (config.c_auth_mode == 1) + config.c_disable_newu = 1; } diff --git a/citadel/serv_vcard.c b/citadel/serv_vcard.c index a22d7c199..ff28f4d4d 100644 --- a/citadel/serv_vcard.c +++ b/citadel/serv_vcard.c @@ -314,6 +314,10 @@ int vcard_upload_beforesave(struct CtdlMessage *msg) { } #endif + /* If users cannot create their own accounts, they cannot re-register either. */ + if ( (config.c_disable_newu) && (CC->user.axlevel < 6) ) { + return(1); + } } /* Is this a room with an address book in it? */ @@ -640,6 +644,12 @@ void cmd_regi(char *argbuf) { return; } + /* If users cannot create their own accounts, they cannot re-register either. */ + if ( (config.c_disable_newu) && (CC->user.axlevel < 6) ) { + cprintf("%d Self-service registration is not allowed here.\n", + ERROR + HIGHER_ACCESS_REQUIRED); + } + my_vcard = vcard_get_user(&CC->user); strcpy(tmpaddr, ""); strcpy(tmpcity, "");