Disable a User when they exceed their monthly Quota

You can share your Lua Scripts with everybody here.

Disable a User when they exceed their monthly Quota

Postby konquest » Fri Jun 01, 2012 10:03 am

Hi,

Im trying to use the OnQuotaExceeded event to disable a user's account but i can't seem to get it to work correctly.

here's the Lua script im using:

local tableUser = c_GetUser("%Domain","%Name")

--change all the boolean values into integer values
for k,v in pairs(tableUser) do
if type(v) == "boolean" then
if v == true then
tableUser[k] = 1
else
tableUser[k] = 0
end
end
end

bEnableAccount "0"

AddUser("%Domain","%Name")


I'll also be running a similar script every month to re-enable the account, giving the user another month of storage.

Any help would be greatly appreciated.

-Keith-
konquest
 
posts 1
 
joined Fri Jun 01, 2012 9:55 am

Re: Disable a User when they exceed their monthly Quota

Postby FTP » Sat Jun 02, 2012 3:31 am

tableUser.enable_account = 0
FTP
Site Admin
 
posts 1220
 
joined Tue Sep 29, 2009 6:09 am


Return to Lua scripts

Who is online

Users browsing this forum: No registered users and 2 guests

cron