Not allow to create sub directory

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

Not allow to create sub directory

Postby sinha_roop » Sat Aug 25, 2012 2:22 pm

I am back after a month.
I have two questions:
A. I want to set restriction by which user are allowed to create directory but not allow to create sub directory. How can i do this?
Please suggest.

B. When user creates folder , automatic convert into upper case. Any idea?
Please suggest.
sinha_roop
 
posts 6
 
joined Mon Jul 09, 2012 10:36 am

Re: Not allow to create sub directory

Postby FTP » Mon Aug 27, 2012 7:01 am

Hi,

You can use lua script in the event "OnDirCreated". Here are some hints:
User the variable "%LastDir" will get the physical path of the folder you created. like: C:/FTP/Sinha/newfolder
Then Q2 is simple.
Q1 maybe a little complex. You can use c_GetUser to get the user information, then add a subdir rule and use c_AddUser to overwrite the user's exist settings.

local user = c_GetUser("%Domain", "%Name")
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

//add a subdir rule here, this parameter is a table

c_AddUser("%Domain",user.username,user.password,user.protocol_type,..............)

Please try to complete it.
FTP
Site Admin
 
posts 1232
 
joined Tue Sep 29, 2009 6:09 am


Return to Support

Who is online

Users browsing this forum: Yahoo [Bot] and 5 guests

cron