Page 1 of 1

Suggestion: checkUserAlias function

Posted: Mon Oct 03, 2011 3:40 pm
by Peter
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?

Re: Suggestion: checkUserAlias function

Posted: Tue Oct 04, 2011 3:03 am
by FTP
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