aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorDiva Canto2013-07-02 14:31:39 -0700
committerDiva Canto2013-07-02 14:31:39 -0700
commite984bfb4c63718d5176b17f6beea46f4512cf304 (patch)
treec5c8fda8a5b7fcc7a493d5f877daadf10b017fa2 /OpenSim
parentHG: close a loophole by which if something was wrong with the ServiceURLs it ... (diff)
downloadopensim-SC_OLD-e984bfb4c63718d5176b17f6beea46f4512cf304.zip
opensim-SC_OLD-e984bfb4c63718d5176b17f6beea46f4512cf304.tar.gz
opensim-SC_OLD-e984bfb4c63718d5176b17f6beea46f4512cf304.tar.bz2
opensim-SC_OLD-e984bfb4c63718d5176b17f6beea46f4512cf304.tar.xz
This should have a strong effect on the Unknown User issue mantis #6625
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/IGridUserData.cs1
-rw-r--r--OpenSim/Data/MSSQL/MSSQLGridUserData.cs7
-rw-r--r--OpenSim/Data/MySQL/MySQLGridUserData.cs7
-rw-r--r--OpenSim/Data/SQLite/SQLiteGridUserData.cs4
-rw-r--r--OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs20
-rw-r--r--OpenSim/Services/UserAccountService/GridUserService.cs17
6 files changed, 50 insertions, 6 deletions
diff --git a/OpenSim/Data/IGridUserData.cs b/OpenSim/Data/IGridUserData.cs
index e15a1f8..9afa477 100644
--- a/OpenSim/Data/IGridUserData.cs
+++ b/OpenSim/Data/IGridUserData.cs
@@ -50,6 +50,7 @@ namespace OpenSim.Data
50 public interface IGridUserData 50 public interface IGridUserData
51 { 51 {
52 GridUserData Get(string userID); 52 GridUserData Get(string userID);
53 GridUserData[] GetAll(string query);
53 bool Store(GridUserData data); 54 bool Store(GridUserData data);
54 } 55 }
55} \ No newline at end of file 56} \ No newline at end of file
diff --git a/OpenSim/Data/MSSQL/MSSQLGridUserData.cs b/OpenSim/Data/MSSQL/MSSQLGridUserData.cs
index 9e215f9..df73e5b 100644
--- a/OpenSim/Data/MSSQL/MSSQLGridUserData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLGridUserData.cs
@@ -50,7 +50,7 @@ namespace OpenSim.Data.MSSQL
50 { 50 {
51 } 51 }
52 52
53 public GridUserData Get(string userID) 53 public new GridUserData Get(string userID)
54 { 54 {
55 GridUserData[] ret = Get("UserID", userID); 55 GridUserData[] ret = Get("UserID", userID);
56 56
@@ -60,5 +60,10 @@ namespace OpenSim.Data.MSSQL
60 return ret[0]; 60 return ret[0];
61 } 61 }
62 62
63 public GridUserData[] GetAll(string userID)
64 {
65 return base.Get("UserID LIKE {0}%", userID);
66 }
67
63 } 68 }
64} 69}
diff --git a/OpenSim/Data/MySQL/MySQLGridUserData.cs b/OpenSim/Data/MySQL/MySQLGridUserData.cs
index a9ce94d..df1ecc6 100644
--- a/OpenSim/Data/MySQL/MySQLGridUserData.cs
+++ b/OpenSim/Data/MySQL/MySQLGridUserData.cs
@@ -46,7 +46,7 @@ namespace OpenSim.Data.MySQL
46 46
47 public MySQLGridUserData(string connectionString, string realm) : base(connectionString, realm, "GridUserStore") {} 47 public MySQLGridUserData(string connectionString, string realm) : base(connectionString, realm, "GridUserStore") {}
48 48
49 public GridUserData Get(string userID) 49 public new GridUserData Get(string userID)
50 { 50 {
51 GridUserData[] ret = Get("UserID", userID); 51 GridUserData[] ret = Get("UserID", userID);
52 52
@@ -56,6 +56,9 @@ namespace OpenSim.Data.MySQL
56 return ret[0]; 56 return ret[0];
57 } 57 }
58 58
59 59 public GridUserData[] GetAll(string userID)
60 {
61 return base.Get("UserID LIKE {0}%", userID);
62 }
60 } 63 }
61} \ No newline at end of file 64} \ No newline at end of file
diff --git a/OpenSim/Data/SQLite/SQLiteGridUserData.cs b/OpenSim/Data/SQLite/SQLiteGridUserData.cs
index 1bb5ed8..54cef1a 100644
--- a/OpenSim/Data/SQLite/SQLiteGridUserData.cs
+++ b/OpenSim/Data/SQLite/SQLiteGridUserData.cs
@@ -56,6 +56,10 @@ namespace OpenSim.Data.SQLite
56 return ret[0]; 56 return ret[0];
57 } 57 }
58 58
59 public GridUserData[] GetAll(string userID)
60 {
61 return base.Get("UserID LIKE {0}%", userID);
62 }
59 63
60 } 64 }
61} \ No newline at end of file 65} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
index 5da64f7..a1343fb 100644
--- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
@@ -319,8 +319,25 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
319 } 319 }
320 else 320 else
321 { 321 {
322 // Let's try the GridUser service
323 GridUserInfo uInfo = m_Scenes[0].GridUserService.GetGridUserInfo(uuid.ToString());
324 if (uInfo != null)
325 {
326 string url, first, last, tmp;
327 UUID u;
328 if (Util.ParseUniversalUserIdentifier(uInfo.UserID, out u, out url, out first, out last, out tmp))
329 {
330 AddUser(uuid, first, last, url);
331
332 names[0] = m_UserCache[uuid].FirstName;
333 names[1] = m_UserCache[uuid].LastName;
334
335 return true;
336 }
337 }
338
322 names[0] = "Unknown"; 339 names[0] = "Unknown";
323 names[1] = "UserUMMTGUN4"; 340 names[1] = "UserUMMTGUN5";
324 341
325 return false; 342 return false;
326 } 343 }
@@ -474,7 +491,6 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
474 //m_log.DebugFormat("[USER MANAGEMENT MODULE]: Adding user with id {0}, creatorData {1}", id, creatorData); 491 //m_log.DebugFormat("[USER MANAGEMENT MODULE]: Adding user with id {0}, creatorData {1}", id, creatorData);
475 492
476 UserData oldUser; 493 UserData oldUser;
477 //lock the whole block - prevent concurrent update
478 lock (m_UserCache) 494 lock (m_UserCache)
479 m_UserCache.TryGetValue(id, out oldUser); 495 m_UserCache.TryGetValue(id, out oldUser);
480 496
diff --git a/OpenSim/Services/UserAccountService/GridUserService.cs b/OpenSim/Services/UserAccountService/GridUserService.cs
index 8388180..62b82fe 100644
--- a/OpenSim/Services/UserAccountService/GridUserService.cs
+++ b/OpenSim/Services/UserAccountService/GridUserService.cs
@@ -51,7 +51,22 @@ namespace OpenSim.Services.UserAccountService
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 if (ds.Length > 0)
63 {
64 d = ds[0];
65 foreach (GridUserData dd in ds)
66 if (dd.UserID.Length > d.UserID.Length) // find the longest
67 d = dd;
68 }
69 }
55 70
56 if (d == null) 71 if (d == null)
57 return null; 72 return null;