Need a c_ModifyUserDirectory

Please post here if you have problems in using Wing FTP Server.
Post Reply
StenAaboHansen
Posts: 40
Joined: Mon Feb 09, 2015 8:50 pm

Need a c_ModifyUserDirectory

Post by StenAaboHansen »

I need to change my users access to creating directory and try doing it by adding the directory again without success. I get another line in the interface.

How to do ?
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: Need a c_ModifyUserDirectory

Post by FTP »

What do you mean? Just change the existing home folder to a new folder path, and keep the same folder permissions? If so, you can take the following script:

Code: Select all

local domain = "YourDomainName"
local username = "YourUserName"
local newFolder = "d:/testfolder/"

local user = c_GetUser(domain, username)
for k,v in pairs(user) do
	if type(v) == "boolean" then
		if v == true then
			user[k] = 1
		else
			user[k] = 0
		end
	end
end

if type(user.directories) == "table" then
	user.directories[1].dir = newFolder
end

user.oldpassword = user.password
AddUser(domain, user)
Post Reply