Bulk Edit of Users

Post here if you have some suggestions or you want to request a new feature.
Post Reply
Morphius
Posts: 1
Joined: Tue Jun 14, 2011 3:35 pm

Bulk Edit of Users

Post 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
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: Bulk Edit of Users

Post 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
Post Reply