diff --git a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs index 21eb790643..9efe741b94 100644 --- a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs +++ b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs @@ -103,6 +103,8 @@ namespace OpenSim.Server.Handlers.UserAccounts return GetAccount(request); case "getaccounts": return GetAccounts(request); + case "getmultiaccounts": + return GetMultiAccounts(request); case "setaccount": if (m_AllowSetAccount) return StoreAccount(request); @@ -201,6 +203,50 @@ namespace OpenSim.Server.Handlers.UserAccounts return Util.UTF8NoBomEncoding.GetBytes(xmlString); } + byte[] GetMultiAccounts(Dictionary request) + { + UUID scopeID = UUID.Zero; + if (request.ContainsKey("ScopeID") && !UUID.TryParse(request["ScopeID"].ToString(), out scopeID)) + return FailureResult(); + + if (!request.ContainsKey("IDS")) + { + m_log.DebugFormat("[USER SERVICE HANDLER]: GetMultiAccounts called without required uuids argument"); + return FailureResult(); + } + + if (!(request["IDS"] is List)) + { + m_log.DebugFormat("[USER SERVICE HANDLER]: GetMultiAccounts input argument was of unexpected type {0}", request["IDS"].GetType().ToString()); + return FailureResult(); + } + + List userIDs = (List)request["IDS"]; + + List accounts = m_UserAccountService.GetUserAccounts(scopeID, userIDs); + + Dictionary result = new Dictionary(); + if ((accounts == null) || ((accounts != null) && (accounts.Count == 0))) + { + result["result"] = "null"; + } + else + { + int i = 0; + foreach (UserAccount acc in accounts) + { + Dictionary rinfoDict = acc.ToKeyValuePairs(); + result["account" + i] = rinfoDict; + i++; + } + } + + string xmlString = ServerUtils.BuildXmlResponse(result); + + //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString); + return Util.UTF8NoBomEncoding.GetBytes(xmlString); + } + byte[] StoreAccount(Dictionary request) { UUID principalID = UUID.Zero;