LUA Script nil value

Please post here if you have problems in using Wing FTP Server.
Post Reply
DrZwitscheri
Posts: 4
Joined: Wed May 15, 2024 9:50 am

LUA Script nil value

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

Re: LUA Script nil value

Post by FTP »

OK, if your domain name includes special characters, maybe you can write it as:
local mydomain = urlencode("xxx.com")
DrZwitscheri
Posts: 4
Joined: Wed May 15, 2024 9:50 am

Re: LUA Script nil value

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

Re: LUA Script nil value

Post by FTP »

OK, special characters include dot, just encode the domain name: local mydomain = urlencode("xxx.com")
DrZwitscheri
Posts: 4
Joined: Wed May 15, 2024 9:50 am

Re: LUA Script nil value

Post by DrZwitscheri »

OK, can you tell me, witch program I can use?
DrZwitscheri
Posts: 4
Joined: Wed May 15, 2024 9:50 am

Re: LUA Script nil value

Post by DrZwitscheri »

I had tried but that doesn't work either
Post Reply