aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLAuthenticationData.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/MySQL/MySQLAuthenticationData.cs62
1 files changed, 30 insertions, 32 deletions
diff --git a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs
index a41f9f8..0780936 100644
--- a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs
+++ b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs
@@ -55,42 +55,40 @@ namespace OpenSim.Data.MySQL
55 AuthenticationData ret = new AuthenticationData(); 55 AuthenticationData ret = new AuthenticationData();
56 ret.Data = new Dictionary<string, object>(); 56 ret.Data = new Dictionary<string, object>();
57 57
58 using (MySqlCommand cmd = new MySqlCommand("select * from `" + m_Realm + "` where UUID = ?principalID")) 58 MySqlCommand cmd = new MySqlCommand("select * from `" + m_Realm + "` where UUID = ?principalID");
59
60 cmd.Parameters.AddWithValue("?principalID", principalID.ToString());
61
62 IDataReader result = ExecuteReader(cmd);
63
64 if (result.Read())
59 { 65 {
60 cmd.Parameters.AddWithValue("?principalID", principalID.ToString()); 66 ret.PrincipalID = principalID;
67
68 if (m_ColumnNames == null)
69 {
70 m_ColumnNames = new List<string>();
61 71
62 using (IDataReader result = ExecuteReader(cmd)) 72 DataTable schemaTable = result.GetSchemaTable();
73 foreach (DataRow row in schemaTable.Rows)
74 m_ColumnNames.Add(row["ColumnName"].ToString());
75 }
76
77 foreach (string s in m_ColumnNames)
63 { 78 {
64 if (result.Read()) 79 if (s == "UUID")
65 { 80 continue;
66 ret.PrincipalID = principalID; 81
67 82 ret.Data[s] = result[s].ToString();
68 if (m_ColumnNames == null)
69 {
70 m_ColumnNames = new List<string>();
71
72 DataTable schemaTable = result.GetSchemaTable();
73 foreach (DataRow row in schemaTable.Rows)
74 m_ColumnNames.Add(row["ColumnName"].ToString());
75 }
76
77 foreach (string s in m_ColumnNames)
78 {
79 if (s == "UUID")
80 continue;
81
82 ret.Data[s] = result[s].ToString();
83 }
84
85 CloseDBConnection(cmd);
86 return ret;
87 }
88 else
89 {
90 CloseDBConnection(cmd);
91 return null;
92 }
93 } 83 }
84
85 CloseDBConnection(result, cmd);
86 return ret;
87 }
88 else
89 {
90 CloseDBConnection(result, cmd);
91 return null;
94 } 92 }
95 } 93 }
96 94