When self-service user creation is disabled, also disable
authorArt Cancro <ajc@citadel.org>
Wed, 28 Mar 2007 16:52:09 +0000 (16:52 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 28 Mar 2007 16:52:09 +0000 (16:52 +0000)
self-service registration.

citadel/config.c
citadel/serv_vcard.c

index 35a25b8cba7867feec00d0b518b2847f2bef7bcf..d938065a2ab166b931d7b83937e6fc44d5be9c43 100644 (file)
@@ -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;
 }
 
 
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, "");