From 7cafc2e46eba6e46987ce6b41a8fecd2335222d3 Mon Sep 17 00:00:00 2001 From: Kevin Houlihan Date: Sun, 4 Sep 2011 14:46:52 +0100 Subject: [PATCH] Added a check to the CreateRegion method of the RemoteAdmin module that the specified user exists. A meaningful exception message is returned if the user is not found. Previously it was returning "Object not set..." --- .../RemoteController/RemoteAdminPlugin.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 93a6915947..25ae3f1933 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -709,6 +709,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController // ok, client wants us to use an explicit UUID // regardless of what the avatar name provided userID = new UUID((string) requestData["estate_owner_uuid"]); + + // Check that the specified user exists + Scene currentOrFirst = m_application.SceneManager.CurrentOrFirstScene; + IUserAccountService accountService = currentOrFirst.UserAccountService; + UserAccount user = accountService.GetUserAccount(currentOrFirst.RegionInfo.ScopeID, userID); + + if (user == null) + throw new Exception("Specified user was not found."); } else if (requestData.ContainsKey("estate_owner_first") & requestData.ContainsKey("estate_owner_last")) { @@ -720,6 +728,11 @@ namespace OpenSim.ApplicationPlugins.RemoteController IUserAccountService accountService = currentOrFirst.UserAccountService; UserAccount user = accountService.GetUserAccount(currentOrFirst.RegionInfo.ScopeID, ownerFirst, ownerLast); + + // Check that the specified user exists + if (user == null) + throw new Exception("Specified user was not found."); + userID = user.PrincipalID; } else