Page 1 of 1

Bulk Edit of Users

Posted: Tue Jun 14, 2011 3:40 pm
by Morphius
Hello

Can we please request a utility / option to bulk edit user details. e.g. enabling zip files or changing connection limits for all users at once, or selected users at once.

Thanks

Re: Bulk Edit of Users

Posted: Wed Jun 15, 2011 2:05 am
by FTP
You can handle it via Lua scripting, here is an example:

Code: Select all

local strDomain = "YourDomain"
local strUserlist = c_GetUserList(strDomain) 
local userlist = Split(strUserlist,"\n") 

for _,username in pairs(userlist) do 
   local tableUser = c_GetUser(strDomain,username)

   for k,v in pairs(tableUser) do
      if type(v) == "boolean" then
         if v == true then
            tableUser[k] = 1
         else
            tableUser[k] = 0
         end
      end
   end

   tableUser.max_connection = 10

   tableUser.oldpassword = tableUser.password
   AddUser(strDomain,tableUser)
end
You can execute the above example script under "Administration -> Console", it just changes the connection limit for all the users: tableUser.max_connection = 10