Page 1 of 1

LUA Script nil value

Posted: Wed May 15, 2024 9:55 am
by DrZwitscheri
Hi all
I have problems with the command: local strUserlist = c_GetUser(mydomain)
Last year (2023) it works, but now no longer.
Where is my fault?
The hole script is:

local mydomain = "xxx.com"
local rootdirtmp = "D:/ftp/kunden/"
local group = "Kunden"
do
local strUserlist = c_GetUser(mydomain)
local userlist = Split(strUserlist,"\n")

for _,username in pairs(userlist) do
local user = c_GetUser(mydomain,username)
local expiretime_t = c_TranslateTime(user.expiretime)
if (os.time() > expiretime_t) and (user.enable_expire == true) and (user.usergroups[1].groupname == group) then
c_DeleteUser(mydomain,username)
c_RemoveFileDir(rootdirtmp .. username)
end
end
end

Thanks a lot at everybody!

Re: LUA Script nil value

Posted: Wed May 15, 2024 1:26 pm
by FTP
OK, if your domain name includes special characters, maybe you can write it as:
local mydomain = urlencode("xxx.com")

Re: LUA Script nil value

Posted: Fri May 17, 2024 8:24 am
by DrZwitscheri
FTP wrote: Wed May 15, 2024 1:26 pm OK, if your domain name includes special characters, maybe you can write it as:
local mydomain = urlencode("xxx.com")
Thanks for your answer, but we didn't have any special characters. It's like "domain.com"
Nobody has changed something on the script.
With my script, it was running until the end of last year. (2023)
Did you have any other ideas?

Re: LUA Script nil value

Posted: Fri May 17, 2024 9:51 am
by FTP
OK, special characters include dot, just encode the domain name: local mydomain = urlencode("xxx.com")

Re: LUA Script nil value

Posted: Fri May 17, 2024 11:54 am
by DrZwitscheri
OK, can you tell me, witch program I can use?

Re: LUA Script nil value

Posted: Tue May 21, 2024 10:56 am
by DrZwitscheri
I had tried but that doesn't work either