Disable a User when they exceed their monthly Quota

You can share your Lua Scripts with everybody here.
Post Reply
konquest
Posts: 1
Joined: Fri Jun 01, 2012 9:55 am

Disable a User when they exceed their monthly Quota

Post by konquest »

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-
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: Disable a User when they exceed their monthly Quota

Post by FTP »

tableUser.enable_account = 0
Post Reply