diff options
author | Diva Canto | 2011-12-29 16:12:06 -0800 |
---|---|---|
committer | Diva Canto | 2011-12-29 16:12:06 -0800 |
commit | 571efeddb20f38bb4164074b3c217be5387ca2e0 (patch) | |
tree | 0385b1e7d3ad2b602d7079105469a3e7ee8a0166 /OpenSim/Region/CoreModules/Framework | |
parent | Added field LocalToGrid in UserAccount. Context: make HG work in Simian. (diff) | |
download | opensim-SC_OLD-571efeddb20f38bb4164074b3c217be5387ca2e0.zip opensim-SC_OLD-571efeddb20f38bb4164074b3c217be5387ca2e0.tar.gz opensim-SC_OLD-571efeddb20f38bb4164074b3c217be5387ca2e0.tar.bz2 opensim-SC_OLD-571efeddb20f38bb4164074b3c217be5387ca2e0.tar.xz |
Added UserManagementModule.IsLocalGridUser(UUID) to be used throughout region Scenes and Modules. Changed existing modules to use it instead of assuming that foreign = null account.
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework')
3 files changed, 16 insertions, 10 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index 841363c..8d41728 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | |||
@@ -187,8 +187,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
187 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName); | 187 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName); |
188 | 188 | ||
189 | // Let's find out if this is a foreign user or a local user | 189 | // Let's find out if this is a foreign user or a local user |
190 | UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, id); | 190 | IUserManagement uMan = m_aScene.RequestModuleInterface<IUserManagement>(); |
191 | if (account != null) | 191 | if (uMan != null && uMan.IsLocalGridUser(id)) |
192 | { | 192 | { |
193 | // local grid user | 193 | // local grid user |
194 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: User is local"); | 194 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: User is local"); |
@@ -313,8 +313,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
313 | } | 313 | } |
314 | 314 | ||
315 | // Let's find out if this is a foreign user or a local user | 315 | // Let's find out if this is a foreign user or a local user |
316 | IUserManagement uMan = m_aScene.RequestModuleInterface<IUserManagement>(); | ||
316 | UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, obj.AgentId); | 317 | UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, obj.AgentId); |
317 | if (account != null) | 318 | if (uMan != null && uMan.IsLocalGridUser(obj.AgentId)) |
318 | { | 319 | { |
319 | // local grid user | 320 | // local grid user |
320 | return; | 321 | return; |
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs index 49d484b..bf24ebc 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs | |||
@@ -124,8 +124,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
124 | 124 | ||
125 | protected override string GenerateLandmark(ScenePresence presence, out string prefix, out string suffix) | 125 | protected override string GenerateLandmark(ScenePresence presence, out string prefix, out string suffix) |
126 | { | 126 | { |
127 | UserAccount account = m_Scene.UserAccountService.GetUserAccount(m_Scene.RegionInfo.ScopeID, presence.UUID); | 127 | if (UserManagementModule != null && !UserManagementModule.IsLocalGridUser(presence.UUID)) |
128 | if (account == null) | ||
129 | prefix = "HG "; | 128 | prefix = "HG "; |
130 | else | 129 | else |
131 | prefix = string.Empty; | 130 | prefix = string.Empty; |
@@ -210,12 +209,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
210 | public override bool IsForeignUser(UUID userID, out string assetServerURL) | 209 | public override bool IsForeignUser(UUID userID, out string assetServerURL) |
211 | { | 210 | { |
212 | assetServerURL = string.Empty; | 211 | assetServerURL = string.Empty; |
213 | UserAccount account = null; | ||
214 | if (m_Scene.UserAccountService != null) | ||
215 | account = m_Scene.UserAccountService.GetUserAccount(m_Scene.RegionInfo.ScopeID, userID); | ||
216 | 212 | ||
217 | if (account == null) // foreign | 213 | if (UserManagementModule != null && !UserManagementModule.IsLocalGridUser(userID)) |
218 | { | 214 | { // foreign |
219 | ScenePresence sp = null; | 215 | ScenePresence sp = null; |
220 | if (m_Scene.TryGetScenePresence(userID, out sp)) | 216 | if (m_Scene.TryGetScenePresence(userID, out sp)) |
221 | { | 217 | { |
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index a40a6a4..dbe2560 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | |||
@@ -425,6 +425,15 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
425 | 425 | ||
426 | //} | 426 | //} |
427 | 427 | ||
428 | public bool IsLocalGridUser(UUID uuid) | ||
429 | { | ||
430 | UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, uuid); | ||
431 | if (account == null || (account != null && !account.LocalToGrid)) | ||
432 | return false; | ||
433 | |||
434 | return true; | ||
435 | } | ||
436 | |||
428 | #endregion IUserManagement | 437 | #endregion IUserManagement |
429 | 438 | ||
430 | private void HandleShowUsers(string module, string[] cmd) | 439 | private void HandleShowUsers(string module, string[] cmd) |