29 using System.Collections;
30 using System.Collections.Generic;
33 using OpenSim.Framework;
34 using MySql.Data.MySqlClient;
36 namespace OpenSim.Data.MySQL
41 : base(connectionString, realm,
"UserAccount")
47 string[] words = query.Split(
new char[] {
' '});
51 for (
int i = 0 ; i < words.Length ; i++)
53 if (words[i].Length > 2)
63 if ((!valid) || words.Length == 0)
69 using (MySqlCommand cmd =
new MySqlCommand())
71 if (words.Length == 1)
73 cmd.CommandText = String.Format(
"select * from {0} where (ScopeID=?ScopeID or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like ?search or LastName like ?search) and active=1", m_Realm);
74 cmd.Parameters.AddWithValue(
"?search",
"%" + words[0] +
"%");
75 cmd.Parameters.AddWithValue(
"?ScopeID", scopeID.ToString());
79 cmd.CommandText = String.Format(
"select * from {0} where (ScopeID=?ScopeID or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like ?searchFirst and LastName like ?searchLast) and active=1", m_Realm);
80 cmd.Parameters.AddWithValue(
"?searchFirst",
"%" + words[0] +
"%");
81 cmd.Parameters.AddWithValue(
"?searchLast",
"%" + words[1] +
"%");
82 cmd.Parameters.AddWithValue(
"?ScopeID", scopeID.ToString());
91 using (MySqlCommand cmd =
new MySqlCommand())
93 if (scopeID != UUID.Zero)
95 where =
"(ScopeID=?ScopeID or ScopeID='00000000-0000-0000-0000-000000000000') and (" + where +
")";
96 cmd.Parameters.AddWithValue(
"?ScopeID", scopeID.ToString());
99 cmd.CommandText = String.Format(
"select * from {0} where " + where, m_Realm);
MySqlUserAccountData(string connectionString, string realm)
UserAccountData[] GetUsersWhere(UUID scopeID, string where)
UserAccountData[] GetUsers(UUID scopeID, string query)
An interface for connecting to the user accounts datastore