#!/bin/sh
if [ "$usertype" != "user" ]; then
exit 0;
fi
MAX_USERS=`cat /usr/local/directadmin/data/users/$creator/user.conf | grep users_number | cut -d= -f2`
if [ "$MAX_USERS" == "" ]; 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;