diff options
author | Melanie | 2012-01-13 04:04:39 +0000 |
---|---|---|
committer | Melanie | 2012-01-13 04:04:39 +0000 |
commit | 982f3d58a99c9fd92bbe34b5bb5085bd705386a7 (patch) | |
tree | 56e4cf73256ee8550eb473e136dffa882292ac00 | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Undo some prior work (diff) | |
download | opensim-SC_OLD-982f3d58a99c9fd92bbe34b5bb5085bd705386a7.zip opensim-SC_OLD-982f3d58a99c9fd92bbe34b5bb5085bd705386a7.tar.gz opensim-SC_OLD-982f3d58a99c9fd92bbe34b5bb5085bd705386a7.tar.bz2 opensim-SC_OLD-982f3d58a99c9fd92bbe34b5bb5085bd705386a7.tar.xz |
Merge branch 'master' into careminster
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | 93 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Interfaces/IUserManagement.cs | 3 |
2 files changed, 0 insertions, 96 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index 80ab30c..bbdf92a 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | |||
@@ -50,9 +50,6 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
50 | public string LastName { get; set; } | 50 | public string LastName { get; set; } |
51 | public string HomeURL { get; set; } | 51 | public string HomeURL { get; set; } |
52 | public Dictionary<string, object> ServerURLs { get; set; } | 52 | public Dictionary<string, object> ServerURLs { get; set; } |
53 | public string Title { get; set; } | ||
54 | public int Flags { get; set; } | ||
55 | public int Created { get; set; } | ||
56 | } | 53 | } |
57 | 54 | ||
58 | public class UserManagementModule : ISharedRegionModule, IUserManagement | 55 | public class UserManagementModule : ISharedRegionModule, IUserManagement |
@@ -284,94 +281,6 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
284 | return string.Empty; | 281 | return string.Empty; |
285 | } | 282 | } |
286 | 283 | ||
287 | public int GetUserFlags(UUID userID) | ||
288 | { | ||
289 | UserData userdata; | ||
290 | lock (m_UserCache) | ||
291 | m_UserCache.TryGetValue(userID, out userdata); | ||
292 | |||
293 | if (userdata.Flags == -1) | ||
294 | GetUserInfo(userID); | ||
295 | |||
296 | if (userdata.Flags != -1) | ||
297 | return userdata.Flags; | ||
298 | |||
299 | return 0; | ||
300 | } | ||
301 | |||
302 | public int GetUserCreated(UUID userID) | ||
303 | { | ||
304 | UserData userdata; | ||
305 | lock (m_UserCache) | ||
306 | m_UserCache.TryGetValue(userID, out userdata); | ||
307 | |||
308 | if (userdata.Flags == -1) | ||
309 | GetUserInfo(userID); | ||
310 | |||
311 | if (userdata.Created != -1) | ||
312 | return userdata.Created; | ||
313 | |||
314 | return 0; | ||
315 | } | ||
316 | |||
317 | public string GetUserTitle(UUID userID) | ||
318 | { | ||
319 | UserData userdata; | ||
320 | lock (m_UserCache) | ||
321 | m_UserCache.TryGetValue(userID, out userdata); | ||
322 | |||
323 | if (userdata.Flags == -1) | ||
324 | GetUserInfo(userID); | ||
325 | |||
326 | if (userdata.Created != -1) | ||
327 | return userdata.Title; | ||
328 | |||
329 | return string.Empty; | ||
330 | } | ||
331 | |||
332 | // This will cache the user data | ||
333 | // Change this to return bool | ||
334 | private bool GetUserInfo(UUID userID) | ||
335 | { | ||
336 | UserData userdata; | ||
337 | lock (m_UserCache) | ||
338 | m_UserCache.TryGetValue(userID, out userdata); | ||
339 | |||
340 | if (userdata != null) | ||
341 | { | ||
342 | // m_log.DebugFormat("[USER MANAGEMENT MODULE]: Requested url type {0} for {1}", serverType, userID); | ||
343 | |||
344 | if (userdata.Flags >= 0) | ||
345 | { | ||
346 | // This is already populated | ||
347 | return true; | ||
348 | } | ||
349 | |||
350 | if (userdata.HomeURL != null && userdata.HomeURL != string.Empty) | ||
351 | { | ||
352 | m_log.DebugFormat( | ||
353 | "[USER MANAGEMENT MODULE]: Requesting user flags from '{0}' for {1}", | ||
354 | userdata.HomeURL, userID); | ||
355 | |||
356 | UserAgentServiceConnector uConn = new UserAgentServiceConnector(userdata.HomeURL); | ||
357 | Dictionary<string, object> info = uConn.GetUserInfo(userID); | ||
358 | |||
359 | // Pull our data now | ||
360 | if (info["result"].ToString() == "success") | ||
361 | { | ||
362 | userdata.Flags = (int)info["user_flags"]; | ||
363 | userdata.Created = (int)info["user_created"]; | ||
364 | userdata.Title = (string)info["user_title"]; | ||
365 | |||
366 | return true; | ||
367 | } | ||
368 | } | ||
369 | } | ||
370 | |||
371 | return false; | ||
372 | } | ||
373 | |||
374 | |||
375 | public string GetUserUUI(UUID userID) | 284 | public string GetUserUUI(UUID userID) |
376 | { | 285 | { |
377 | UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, userID); | 286 | UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, userID); |
@@ -452,8 +361,6 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
452 | } else { | 361 | } else { |
453 | UserData user = new UserData (); | 362 | UserData user = new UserData (); |
454 | user.Id = id; | 363 | user.Id = id; |
455 | user.Flags = -1; | ||
456 | user.Created = -1; | ||
457 | 364 | ||
458 | if (creatorData != null && creatorData != string.Empty) { | 365 | if (creatorData != null && creatorData != string.Empty) { |
459 | //creatorData = <endpoint>;<name> | 366 | //creatorData = <endpoint>;<name> |
diff --git a/OpenSim/Region/Framework/Interfaces/IUserManagement.cs b/OpenSim/Region/Framework/Interfaces/IUserManagement.cs index 4f62e28..bfb8369 100644 --- a/OpenSim/Region/Framework/Interfaces/IUserManagement.cs +++ b/OpenSim/Region/Framework/Interfaces/IUserManagement.cs | |||
@@ -14,9 +14,6 @@ namespace OpenSim.Region.Framework.Interfaces | |||
14 | string GetUserHomeURL(UUID uuid); | 14 | string GetUserHomeURL(UUID uuid); |
15 | string GetUserUUI(UUID uuid); | 15 | string GetUserUUI(UUID uuid); |
16 | string GetUserServerURL(UUID uuid, string serverType); | 16 | string GetUserServerURL(UUID uuid, string serverType); |
17 | int GetUserFlags(UUID userID); | ||
18 | int GetUserCreated(UUID userID); | ||
19 | string GetUserTitle(UUID userID); | ||
20 | 17 | ||
21 | /// <summary> | 18 | /// <summary> |
22 | /// Add a user. | 19 | /// Add a user. |