When self-service user creation is disabled, also disable
[citadel.git] / citadel / serv_vcard.c
index a22d7c1997dd007149ac4b275d932164f154b5b7..ff28f4d4d14ca893b23a00880c92a1fb19ddde37 100644 (file)
@@ -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, "");