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.
Not allow to create sub directory
-
- Site Admin
- Posts: 2078
- Joined: Tue Sep 29, 2009 6:09 am
Re: Not allow to create sub directory
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.
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.