jj@24khost
Verified User
- Joined
- May 17, 2012
- Messages
- 22
This allow for us to control overselling fo account numbers, this is already in cpanel looking for it here.
/usr/local/directadmin/data/admin/custom_package_items.conf
users_number=type=text&string=Users Number&desc=Number of users that can be created.
/usr/local/directadmin/scripts/custom/user_create_pre.sh
#!/bin/sh
MAX_USERS='cat /usr/local/directadmin/data/users/$creator/user.conf | grep users_number | cut -d= -f2'
if [ "$usertype" != "user" ]; then
exit 0;
fi
#obtains the exact number of domains on the system right now. The tally is delayed, and cannot be used.
CURRENT=`wc -l /usr/local/directadmin/data/users/$creator/users.list | cut -d\ -f1`
if [ "$CURRENT" -ge "$MAX_USERS" ]; then
echo "Maximum number of Users ($MAX_USERS) have already been created. Cannot create any more."
exit 1;
fi
exit 0;
chown diradmin:diradmin /usr/local/directadmin/scripts/custom/user_create_pre.sh
chown diradmin:diradmin /usr/local/directadmin/data/admin/custom_package_items.conf
chmod 700 /usr/local/directadmin/scripts/custom/user_create_pre.sh
chmod 644 /usr/local/directadmin/data/admin/custom_package_items.conf