Page 1 of 1

Not allow to create sub directory

Posted: Sat Aug 25, 2012 2:22 pm
by sinha_roop
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.

Re: Not allow to create sub directory

Posted: Mon Aug 27, 2012 7:01 am
by FTP
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.