aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/UserAccountService
diff options
context:
space:
mode:
authorMelanie2013-07-04 22:32:58 +0100
committerMelanie2013-07-04 22:32:58 +0100
commit5ddcc25ee9de481c40a26aabc57d77c71225162e (patch)
tree298768abaca492365ac1c9786b0d4ce7dae934ab /OpenSim/Services/UserAccountService
parentMerge branch 'master' into careminster (diff)
parentGuard against completely unknown user UUIDs. (diff)
downloadopensim-SC-5ddcc25ee9de481c40a26aabc57d77c71225162e.zip
opensim-SC-5ddcc25ee9de481c40a26aabc57d77c71225162e.tar.gz
opensim-SC-5ddcc25ee9de481c40a26aabc57d77c71225162e.tar.bz2
opensim-SC-5ddcc25ee9de481c40a26aabc57d77c71225162e.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Services/UserAccountService')
-rw-r--r--OpenSim/Services/UserAccountService/GridUserService.cs20
1 files changed, 18 insertions, 2 deletions
diff --git a/OpenSim/Services/UserAccountService/GridUserService.cs b/OpenSim/Services/UserAccountService/GridUserService.cs
index 8388180..fa9a4a8 100644
--- a/OpenSim/Services/UserAccountService/GridUserService.cs
+++ b/OpenSim/Services/UserAccountService/GridUserService.cs
@@ -46,12 +46,28 @@ namespace OpenSim.Services.UserAccountService
46 46
47 public GridUserService(IConfigSource config) : base(config) 47 public GridUserService(IConfigSource config) : base(config)
48 { 48 {
49 m_log.Debug("[USER GRID SERVICE]: Starting user grid service"); 49 m_log.Debug("[GRID USER SERVICE]: Starting user grid service");
50 } 50 }
51 51
52 public virtual GridUserInfo GetGridUserInfo(string userID) 52 public virtual GridUserInfo GetGridUserInfo(string userID)
53 { 53 {
54 GridUserData d = m_Database.Get(userID); 54 GridUserData d = null;
55 if (userID.Length > 36) // it's a UUI
56 d = m_Database.Get(userID);
57 else // it's a UUID
58 {
59 GridUserData[] ds = m_Database.GetAll(userID);
60 if (ds == null)
61 return null;
62
63 if (ds.Length > 0)
64 {
65 d = ds[0];
66 foreach (GridUserData dd in ds)
67 if (dd.UserID.Length > d.UserID.Length) // find the longest
68 d = dd;
69 }
70 }
55 71
56 if (d == null) 72 if (d == null)
57 return null; 73 return null;