modification on settings-file WITHOUT lua

Please post here if you have problems in using Wing FTP Server.

modification on settings-file WITHOUT lua

Postby cheese » Mon Jun 18, 2012 7:21 am

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
cheese
 
posts 1
 
joined Mon Jun 18, 2012 7:08 am

Re: modification on settings-file WITHOUT lua

Postby FTP » Tue Jun 19, 2012 7:54 am

Please do not modify the setting files directly, you can change the server settings or the user settings via web admin (or Lua WebService).
FTP
Site Admin
 
posts 1212
 
joined Tue Sep 29, 2009 6:09 am

Re: modification on settings-file WITHOUT lua

Postby Oniqua » Mon May 27, 2013 4:47 am

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>
Oniqua
 
posts 1
 
joined Mon May 27, 2013 4:45 am

Re: modification on settings-file WITHOUT lua

Postby FTP » Mon May 27, 2013 8:29 am

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
FTP
Site Admin
 
posts 1212
 
joined Tue Sep 29, 2009 6:09 am


Return to Support

Who is online

Users browsing this forum: No registered users and 7 guests

cron