diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLAuthenticationData.cs | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs index 7627497..af6be75 100644 --- a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs +++ b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs | |||
@@ -77,21 +77,21 @@ namespace OpenSim.Data.MySQL | |||
77 | cmd.Parameters.AddWithValue("?principalID", principalID.ToString()); | 77 | cmd.Parameters.AddWithValue("?principalID", principalID.ToString()); |
78 | 78 | ||
79 | IDataReader result = cmd.ExecuteReader(); | 79 | IDataReader result = cmd.ExecuteReader(); |
80 | 80 | ||
81 | if (result.Read()) | 81 | if (result.Read()) |
82 | { | 82 | { |
83 | ret.PrincipalID = principalID; | 83 | ret.PrincipalID = principalID; |
84 | 84 | ||
85 | CheckColumnNames(result); | 85 | CheckColumnNames(result); |
86 | 86 | ||
87 | foreach (string s in m_ColumnNames) | 87 | foreach (string s in m_ColumnNames) |
88 | { | 88 | { |
89 | if (s == "UUID") | 89 | if (s == "UUID") |
90 | continue; | 90 | continue; |
91 | 91 | ||
92 | ret.Data[s] = result[s].ToString(); | 92 | ret.Data[s] = result[s].ToString(); |
93 | } | 93 | } |
94 | 94 | ||
95 | return ret; | 95 | return ret; |
96 | } | 96 | } |
97 | else | 97 | else |
@@ -132,25 +132,25 @@ namespace OpenSim.Data.MySQL | |||
132 | if (!first) | 132 | if (!first) |
133 | update += ", "; | 133 | update += ", "; |
134 | update += "`" + field + "` = ?"+field; | 134 | update += "`" + field + "` = ?"+field; |
135 | 135 | ||
136 | first = false; | 136 | first = false; |
137 | 137 | ||
138 | cmd.Parameters.AddWithValue("?"+field, data.Data[field]); | 138 | cmd.Parameters.AddWithValue("?"+field, data.Data[field]); |
139 | } | 139 | } |
140 | 140 | ||
141 | update += " where UUID = ?principalID"; | 141 | update += " where UUID = ?principalID"; |
142 | 142 | ||
143 | cmd.CommandText = update; | 143 | cmd.CommandText = update; |
144 | cmd.Parameters.AddWithValue("?principalID", data.PrincipalID.ToString()); | 144 | cmd.Parameters.AddWithValue("?principalID", data.PrincipalID.ToString()); |
145 | 145 | ||
146 | if (ExecuteNonQuery(cmd) < 1) | 146 | if (ExecuteNonQuery(cmd) < 1) |
147 | { | 147 | { |
148 | string insert = "insert into `" + m_Realm + "` (`UUID`, `" + | 148 | string insert = "insert into `" + m_Realm + "` (`UUID`, `" + |
149 | String.Join("`, `", fields) + | 149 | String.Join("`, `", fields) + |
150 | "`) values (?principalID, ?" + String.Join(", ?", fields) + ")"; | 150 | "`) values (?principalID, ?" + String.Join(", ?", fields) + ")"; |
151 | 151 | ||
152 | cmd.CommandText = insert; | 152 | cmd.CommandText = insert; |
153 | 153 | ||
154 | if (ExecuteNonQuery(cmd) < 1) | 154 | if (ExecuteNonQuery(cmd) < 1) |
155 | return false; | 155 | return false; |
156 | } | 156 | } |
@@ -166,7 +166,7 @@ namespace OpenSim.Data.MySQL | |||
166 | { | 166 | { |
167 | cmd.Parameters.AddWithValue("?"+item, value); | 167 | cmd.Parameters.AddWithValue("?"+item, value); |
168 | cmd.Parameters.AddWithValue("?UUID", principalID.ToString()); | 168 | cmd.Parameters.AddWithValue("?UUID", principalID.ToString()); |
169 | 169 | ||
170 | if (ExecuteNonQuery(cmd) > 0) | 170 | if (ExecuteNonQuery(cmd) > 0) |
171 | return true; | 171 | return true; |
172 | } | 172 | } |
@@ -186,7 +186,7 @@ namespace OpenSim.Data.MySQL | |||
186 | cmd.Parameters.AddWithValue("?principalID", principalID.ToString()); | 186 | cmd.Parameters.AddWithValue("?principalID", principalID.ToString()); |
187 | cmd.Parameters.AddWithValue("?token", token); | 187 | cmd.Parameters.AddWithValue("?token", token); |
188 | cmd.Parameters.AddWithValue("?lifetime", lifetime.ToString()); | 188 | cmd.Parameters.AddWithValue("?lifetime", lifetime.ToString()); |
189 | 189 | ||
190 | if (ExecuteNonQuery(cmd) > 0) | 190 | if (ExecuteNonQuery(cmd) > 0) |
191 | return true; | 191 | return true; |
192 | } | 192 | } |