diff options
author | Melanie | 2013-07-04 22:32:58 +0100 |
---|---|---|
committer | Melanie | 2013-07-04 22:32:58 +0100 |
commit | 5ddcc25ee9de481c40a26aabc57d77c71225162e (patch) | |
tree | 298768abaca492365ac1c9786b0d4ce7dae934ab /OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Guard against completely unknown user UUIDs. (diff) | |
download | opensim-SC_OLD-5ddcc25ee9de481c40a26aabc57d77c71225162e.zip opensim-SC_OLD-5ddcc25ee9de481c40a26aabc57d77c71225162e.tar.gz opensim-SC_OLD-5ddcc25ee9de481c40a26aabc57d77c71225162e.tar.bz2 opensim-SC_OLD-5ddcc25ee9de481c40a26aabc57d77c71225162e.tar.xz |
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | 42 |
1 files changed, 37 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index 194b591..a7cbc8f 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | |||
@@ -135,7 +135,6 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
135 | s.ForEachSOG(delegate(SceneObjectGroup sog) { CacheCreators(sog); }); | 135 | s.ForEachSOG(delegate(SceneObjectGroup sog) { CacheCreators(sog); }); |
136 | } | 136 | } |
137 | 137 | ||
138 | |||
139 | void EventManager_OnNewClient(IClientAPI client) | 138 | void EventManager_OnNewClient(IClientAPI client) |
140 | { | 139 | { |
141 | client.OnConnectionClosed += new Action<IClientAPI>(HandleConnectionClosed); | 140 | client.OnConnectionClosed += new Action<IClientAPI>(HandleConnectionClosed); |
@@ -151,6 +150,10 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
151 | 150 | ||
152 | void HandleUUIDNameRequest(UUID uuid, IClientAPI remote_client) | 151 | void HandleUUIDNameRequest(UUID uuid, IClientAPI remote_client) |
153 | { | 152 | { |
153 | // m_log.DebugFormat( | ||
154 | // "[USER MANAGEMENT MODULE]: Handling request for name binding of UUID {0} from {1}", | ||
155 | // uuid, remote_client.Name); | ||
156 | |||
154 | if (m_Scenes[0].LibraryService != null && (m_Scenes[0].LibraryService.LibraryRootFolder.Owner == uuid)) | 157 | if (m_Scenes[0].LibraryService != null && (m_Scenes[0].LibraryService.LibraryRootFolder.Owner == uuid)) |
155 | { | 158 | { |
156 | remote_client.SendNameReply(uuid, "Mr", "OpenSim"); | 159 | remote_client.SendNameReply(uuid, "Mr", "OpenSim"); |
@@ -319,8 +322,34 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
319 | } | 322 | } |
320 | else | 323 | else |
321 | { | 324 | { |
325 | // Let's try the GridUser service | ||
326 | GridUserInfo uInfo = m_Scenes[0].GridUserService.GetGridUserInfo(uuid.ToString()); | ||
327 | if (uInfo != null) | ||
328 | { | ||
329 | string url, first, last, tmp; | ||
330 | UUID u; | ||
331 | if (Util.ParseUniversalUserIdentifier(uInfo.UserID, out u, out url, out first, out last, out tmp)) | ||
332 | { | ||
333 | AddUser(uuid, first, last, url); | ||
334 | |||
335 | if (m_UserCache.ContainsKey(uuid)) | ||
336 | { | ||
337 | names[0] = m_UserCache[uuid].FirstName; | ||
338 | names[1] = m_UserCache[uuid].LastName; | ||
339 | |||
340 | return true; | ||
341 | } | ||
342 | } | ||
343 | else | ||
344 | m_log.DebugFormat("[USER MANAGEMENT MODULE]: Unable to parse UUI {0}", uInfo.UserID); | ||
345 | } | ||
346 | else | ||
347 | { | ||
348 | m_log.DebugFormat("[USER MANAGEMENT MODULE]: No grid user found for {0}", uuid); | ||
349 | } | ||
350 | |||
322 | names[0] = "Unknown"; | 351 | names[0] = "Unknown"; |
323 | names[1] = "UserUMMTGUN3"; | 352 | names[1] = "UserUMMTGUN7"; |
324 | 353 | ||
325 | return false; | 354 | return false; |
326 | } | 355 | } |
@@ -474,7 +503,6 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
474 | //m_log.DebugFormat("[USER MANAGEMENT MODULE]: Adding user with id {0}, creatorData {1}", id, creatorData); | 503 | //m_log.DebugFormat("[USER MANAGEMENT MODULE]: Adding user with id {0}, creatorData {1}", id, creatorData); |
475 | 504 | ||
476 | UserData oldUser; | 505 | UserData oldUser; |
477 | //lock the whole block - prevent concurrent update | ||
478 | lock (m_UserCache) | 506 | lock (m_UserCache) |
479 | m_UserCache.TryGetValue(id, out oldUser); | 507 | m_UserCache.TryGetValue(id, out oldUser); |
480 | 508 | ||
@@ -512,7 +540,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
512 | UserData user = new UserData(); | 540 | UserData user = new UserData(); |
513 | user.Id = id; | 541 | user.Id = id; |
514 | 542 | ||
515 | if (creatorData != null && creatorData != string.Empty) | 543 | if (!string.IsNullOrEmpty(creatorData)) |
516 | { | 544 | { |
517 | //creatorData = <endpoint>;<name> | 545 | //creatorData = <endpoint>;<name> |
518 | 546 | ||
@@ -536,8 +564,12 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
536 | } | 564 | } |
537 | else | 565 | else |
538 | { | 566 | { |
567 | // Temporarily add unknown user entries of this type into the cache so that we can distinguish | ||
568 | // this source from other recent (hopefully resolved) bugs that fail to retrieve a user name binding | ||
569 | // TODO: Can be removed when GUN* unknown users have definitely dropped significantly or | ||
570 | // disappeared. | ||
539 | user.FirstName = "Unknown"; | 571 | user.FirstName = "Unknown"; |
540 | user.LastName = "UserUMMAU"; | 572 | user.LastName = "UserUMMAU3"; |
541 | } | 573 | } |
542 | 574 | ||
543 | AddUserInternal(user); | 575 | AddUserInternal(user); |