One domain per user

pcburakq

Verified User
Joined
Feb 6, 2015
Messages
31
Hello,

I don't want resellers to be able to give more than one domain usage to one user, and users to add more than one domain to their user accounts.

I've edited;

/usr/local/directadmin/scripts/custom/all_pre.sh

To include;

Code:
#Only permit 1 domain to a user#
if [ "$command" = "/CMD_ACCOUT_USER" ] || [ "$command" = "/CMD_MODIFY_USER" ] || [ "$command" = "/CMD_MANAGE_USER_PACKAGES" ] || [ "$command" = "/CMD_DOMAIN" ]; then
    if [ "$vdomains" != 1 ]; then
        echo "You cannot add mode than one domain to a user account"
        exit 1
    fi
fi

But this broke several things like;

modify user username - function
public - private symbolic linking

Etc.

Any pointers to how i should do this?
 
did hook
user_create_pre hook desn't work ?


Code:
#reseller_username = reseller assigned to this account

if [ "$creator" = "reseller_username" ]; then
    if [ "$usertype" = "user"]; then
        if [ "$vdomains" != 1 ]; then
                echo "You cannot add mode than one domain to a user account"
                exit 1
        fi
    fi
fi
 
Solved it by adding;

Code:
#!/usr/bin/env bash

if [ "$action" = "create" ] || [ "$action" = "modify" ]; then
    if [ "$created_by" = 1 ]; then
        echo "You cannot add mode than one domain to a user account";
        exit 1
    fi
fi

exit 0;

to /usr/local/directadmin/scripts/custom/domain_create_pre.sh.
 
Back
Top