Page 1 of 1
How to change user data via Lua?
Posted: Wed Feb 22, 2012 6:13 am
by Zager
I want to change the settings programmatically:
- strNoteAddress,
strNoteZip,
strNotePhone,
strNoteFax,
strNoteEmail,
strNoteMemo
how to do it with language Lua?
Re: How to change user data via Lua?
Posted: Wed Feb 22, 2012 1:43 pm
by FTP
Code: Select all
local strDomain = "mydomain"
local strUsername = "myuser"
local tableUser = c_GetUser(strDomain,strUsername)
--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
tableUser.note_address = ""
tableUser.note_zip = ""
tableUser.note_phone = ""
tableUser.note_fax = ""
tableUser.note_email = ""
tableUser.note_memo = ""
tableUser.oldpassword = tableUser.password
AddUser(strDomain,tableUser)
Re: How to change user data via Lua?
Posted: Wed Feb 22, 2012 5:05 pm
by Zager
Thank you.
To run this code I need to change the script: c:\Program Files\Wing FTP Server\webclient\changepass.html
Why then he did not call the function c_GetUser???
What to do?
Re: How to change user data via Lua?
Posted: Thu Feb 23, 2012 11:14 am
by FTP
The previous script has been modified, please check it again.
Re: How to change user data via Lua?
Posted: Fri Feb 24, 2012 6:18 am
by Zager
What to do?
Re: How to change user data via Lua?
Posted: Tue Feb 28, 2012 5:50 am
by Zager
Any ideas how to remove this error?
Re: How to change user data via Lua?
Posted: Mon Mar 05, 2012 11:58 am
by FTP
It means you can't get that user.