I don't want Resellers to be able to modify their own User Level data

Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"

Top Level » DirectAdmin » Custom Scripting

I don't want Resellers to be able to modify their own User Level dataLast Modified: Nov 17, 2015, 1:10 am
If you have overselling disabled for a given Reseller and you don't wish for them to be able to adjust their own User Level limit (their own User Level limits are not counted against the "allocated" limit), then you can use the all_pre.sh script to do so:
  1. Create the script:


  2. and in it, add the following code:

    if [ "$command" = "/CMD_MODIFY_USER" ]; then
       if [ "$username" = "$user" ] && [ "$action" = "customize" ]; then
           #modifying himself
           C=`grep -c usertype=reseller /usr/local/directadmin/data/users/$username/user.conf`
           if [ "$C" -eq 1 ]; then
                   echo "Resellers cannot modify themselves";
                   exit 1;
    exit 0;

    and chmod the script to 700.
If you wanted, it could be expanded somewhat to do a specific check on one specific item, say disk usage.
Just add up their reseller.allocated quota value with the $quota variable being passed, and ensure it's less than the quota value in the reseller.conf.

Note, that the Reason DA excludes the Reseller's own User Level limit from the total allocation is because the default User Level limits match the default Reseller Level limits... meaning, they'd instantly be at their limit, and wouldn't be able to create any Users, hence it's not part of the allocated count.

© 2018 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST