do
--Get user list from domain "demo"
local strUserlist = c_GetUserList("demo")
local userlist = Split(strUserlist,"\n")
for _,username in pairs(userlist) do
local user = c_GetUser("demo",username)
local logintime = user.last_logintime
--get last login time, formatted as time_t
local logintime_t = c_TranslateTime(logintime)
if (os.time() - logintime_t) >= 3600*24*15 then
c_DeleteUser("demo",username)
end
end
end
You may add a hourly task and input the above lua script.
for k,v in pairs(user) do
if type(v) == "boolean" then
if v == true then
user[k] = 1
else
user[k] = 0
end
end
end
user.enable_account = 0
user.oldpassword = user.password
AddUser("demo", user)
do
--Get user list from domain "CBUK"
local strUserlist = c_GetUserList("CBUK")
local userlist = Split(strUserlist,"\n")
for _,username in pairs(userlist) do
local user = c_GetUser("CBUK",username)
local logintime = user.last_logintime
--get last login time, formatted as time_t
local logintime_t = c_TranslateTime(logintime)
if (os.time() - logintime_t) >= 3600*24*15 then
for k,v in pairs(user) do
if type(v) == "boolean" then
if v == true then
user[k] = 1
else
user[k] = 0
end
end
end
user.enable_account = 0
user.oldpassword = user.password
AddUser("CBUK", user)
end
do
--Get user list from domain "demo"
local strUserlist = c_GetUserList("demo")
local userlist = Split(strUserlist,"\n")
for _,username in pairs(userlist) do
local user = c_GetUser("demo",username)
local logintime = user.last_logintime
--get last login time, formatted as time_t
local logintime_t = c_TranslateTime(logintime)
if (os.time() - logintime_t) >= 3600*24*15 then
for k,v in pairs(user) do
if type(v) == "boolean" then
if v == true then
user[k] = 1
else
user[k] = 0
end
end
end
user.enable_account = 0
user.oldpassword = user.password
AddUser("demo", user)
end
end
end