aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
diff options
context:
space:
mode:
authorKevin Houlihan2011-09-04 14:46:52 +0100
committerJustin Clark-Casey (justincc)2011-09-09 22:59:00 +0100
commit7cafc2e46eba6e46987ce6b41a8fecd2335222d3 (patch)
tree02d305974f555bf06a8bffb5de0c99e6720723cd /OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
parentllSetPrimitiveParams Prim type params precision errors (diff)
downloadopensim-SC-7cafc2e46eba6e46987ce6b41a8fecd2335222d3.zip
opensim-SC-7cafc2e46eba6e46987ce6b41a8fecd2335222d3.tar.gz
opensim-SC-7cafc2e46eba6e46987ce6b41a8fecd2335222d3.tar.bz2
opensim-SC-7cafc2e46eba6e46987ce6b41a8fecd2335222d3.tar.xz
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..."
Diffstat (limited to '')
-rw-r--r--OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs13
1 files changed, 13 insertions, 0 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
index 93a6915..25ae3f1 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -709,6 +709,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController
709 // ok, client wants us to use an explicit UUID 709 // ok, client wants us to use an explicit UUID
710 // regardless of what the avatar name provided 710 // regardless of what the avatar name provided
711 userID = new UUID((string) requestData["estate_owner_uuid"]); 711 userID = new UUID((string) requestData["estate_owner_uuid"]);
712
713 // Check that the specified user exists
714 Scene currentOrFirst = m_application.SceneManager.CurrentOrFirstScene;
715 IUserAccountService accountService = currentOrFirst.UserAccountService;
716 UserAccount user = accountService.GetUserAccount(currentOrFirst.RegionInfo.ScopeID, userID);
717
718 if (user == null)
719 throw new Exception("Specified user was not found.");
712 } 720 }
713 else if (requestData.ContainsKey("estate_owner_first") & requestData.ContainsKey("estate_owner_last")) 721 else if (requestData.ContainsKey("estate_owner_first") & requestData.ContainsKey("estate_owner_last"))
714 { 722 {
@@ -720,6 +728,11 @@ namespace OpenSim.ApplicationPlugins.RemoteController
720 IUserAccountService accountService = currentOrFirst.UserAccountService; 728 IUserAccountService accountService = currentOrFirst.UserAccountService;
721 UserAccount user = accountService.GetUserAccount(currentOrFirst.RegionInfo.ScopeID, 729 UserAccount user = accountService.GetUserAccount(currentOrFirst.RegionInfo.ScopeID,
722 ownerFirst, ownerLast); 730 ownerFirst, ownerLast);
731
732 // Check that the specified user exists
733 if (user == null)
734 throw new Exception("Specified user was not found.");
735
723 userID = user.PrincipalID; 736 userID = user.PrincipalID;
724 } 737 }
725 else 738 else