Suggestion: checkUserAlias function

Post here if you have some suggestions or you want to request a new feature.

Suggestion: checkUserAlias function

Postby Peter » Mon Oct 03, 2011 3:40 pm

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?
Peter
 
posts 3
 
joined Tue Aug 09, 2011 8:28 am

Re: Suggestion: checkUserAlias function

Postby FTP » Tue Oct 04, 2011 3:03 am

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
FTP
Site Admin
 
posts 1243
 
joined Tue Sep 29, 2009 6:09 am


Return to Suggestions & Wishlist

Who is online

Users browsing this forum: No registered users and 1 guest

cron