domains/virtual sites reseller

yon

New member
Joined
Sep 7, 2006
Messages
2
is it possible to assign a number of virtual sites to a reseller instead of a number of domains?

we would like resellers to be able to create a maximum of e.g. 20 hosting packages for their customers with any number of domains forwarded or attached to these hosting packages.

thanks for looking at this!
 
Hello,

Not the "easy" way.

However, you can create a user_create_pre.sh script to do the check and deny them the ability to add more users if they've already used their 20 accounts.

eg: create:
/usr/local/directadmin/scripts/custom/user_create_pre.sh

inside it add:
Code:
#!/bin/sh

MAXUSERS=20

#abort if it's not a Reseller
COUNT=`grep -c $creator /usr/local/directadmin/data/admin/reseller.list`
if [ "$COUNT" -eq 0 ]; then
        exit 0;
fi

#count how many users he has
FILE=/usr/local/directadmin/data/users/$creator/users.list
if [ ! -e $FILE ]; then
        echo "Hmm.. where is your users.list file?";
        exit 1;
fi
COUNT=`grep -c -e '^' $FILE`

if [ "$COUNT" -gt "$MAXUSERS" ]; then
        echo "You already have $MAXUSERS Users.  You cannot create any more.";
        exit 2;
fi
exit 0;
Save, exit. Then chmod the user_create_pre.sh to 755.

Modify the MAXUSERS number as needed.
Only Resellers are restricted, Admin are not because they're not in the reseller.list file.

:)

John
 
hi John,

thanks! that works.

is it possible to go one step further which is to add a check on reseller name, so that e.g. reseller X is limited to 20 users (virtual sites) and reseller Y to 10 users?
 
Last edited:
You could add the custom package item for it:
http://www.directadmin.com/features.php?id=479
And have the script check that resellers reseller.conf (or user.conf) to check the limit. The only problem is there would be a "number of users to create" option when resellers create users, as it's a global User option moreso than a Reseller option.

John
 
Back
Top