Hi there
Currently, there is a useful c_AddUserDirectory LUA function which works well for adding alias folders.
The problem is that there is no way to check if the user already has an alias folder, so if you add another alias with the same alias it will let you.
Could we have a c_CheckUserAlias function to check if the user already has a folder alias in their account? Or is there another way in LUA that this can be checked?
Suggestion: checkUserAlias function
-
- Site Admin
- Posts: 2082
- Joined: Tue Sep 29, 2009 6:09 am
Re: Suggestion: checkUserAlias function
It is hard to check, because the same alias name with different permissions will be allowed. But you can use the following script to check whether the specified virtual directory existed:
Code: Select all
local user = c_GetUser("DomainName","UserName")
local directories = user["directories"]
if directories ~= nil then
for _,directory in pairs(directories) do
if directory.alias == "YourAliasName" then
break
end
end
end