i would like to modify wftpserver/Data/settings.xml and wftpserver/Data/DOMAIN/settings.xml and wftpserver/Data/DOMAIN/users/USERNAME.xml outside of wftpserver and without using lua.
does the server check and recognise that those files have changed and reload them or would i need to restart the server after such modifications? or is there any lua-script to trigger that reread of configuration files without disconnecting active sessions.
thanks
modification on settings-file WITHOUT lua
-
- Site Admin
- Posts: 2083
- Joined: Tue Sep 29, 2009 6:09 am
Re: modification on settings-file WITHOUT lua
Please do not modify the setting files directly, you can change the server settings or the user settings via web admin (or Lua WebService).
-
- Posts: 1
- Joined: Mon May 27, 2013 4:45 am
Re: modification on settings-file WITHOUT lua
How do we change the AD mapping then? I cannot find any command in the Lua API to influence this setting. This is required for us to map new AD users automatically using the XML method
The XML tag we want to read and write to is
<ADUser_User_Mapping>
The XML tag we want to read and write to is
<ADUser_User_Mapping>
-
- Site Admin
- Posts: 2083
- Joined: Tue Sep 29, 2009 6:09 am
Re: modification on settings-file WITHOUT lua
Do you need a Lua script to map the AD user to the local user automatically (also create a local user account)? So just add the following Lua script into "Event Manager -> FTP Events (HTTP Events and SSH Events) -> OnUserLoggedIn -> Lua Script":
Code: Select all
local strDomain = "%Domain"
local strRootDir = "c:/temp"
local strPrivateDir = strRootDir.."/"..strADUser
local strPublicDir = "c:/pub"
local strADUser = "%Name"
local strLocalUser = "local_".."%Name"
local strMapping = c_GetOptionStr(strDomain,DOPTION_ADUSER_MAPPING_STR)
if not string.find(strMapping, "%Name"..":") then
if c_UserExist(strDomain,strLocalUser) == false then
local strPassword = md5( (c_GetTimeUS() + c_GetRandom() + 123)..c_GetServerID() )
c_AddUser(strDomain,strLocalUser, strPassword, 63, 1, 1)
c_MkDir(strPrivateDir)
c_AddUserDirectory(strDomain,strLocalUser, strPrivateDir, "/", true, true, true, true, true, true, false, false, false, true, false, false)
c_AddUserDirectory(strDomain,strLocalUser, strPublicDir, "public", false, true, true, true, false, true, false, false, false, false, false, false)
end
c_SetOptionStr(strDomain,DOPTION_ADUSER_MAPPING_STR,strMapping.."\r\n"..strADUser..":"..strLocalUser)
end