Disable a User when they exceed their monthly Quota
Posted: 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-
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-