aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/SQLite/SQLiteUserAccountData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/SQLite/SQLiteUserAccountData.cs')
-rw-r--r--OpenSim/Data/SQLite/SQLiteUserAccountData.cs25
1 files changed, 13 insertions, 12 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs
index 7a5de50..f98d376 100644
--- a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs
+++ b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs
@@ -66,20 +66,21 @@ namespace OpenSim.Data.SQLite
66 if (words.Length > 2) 66 if (words.Length > 2)
67 return new UserAccountData[0]; 67 return new UserAccountData[0];
68 68
69 SqliteCommand cmd = new SqliteCommand(); 69 using (SqliteCommand cmd = new SqliteCommand())
70
71 if (words.Length == 1)
72 {
73 cmd.CommandText = String.Format("select * from {0} where (ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{2}%')",
74 m_Realm, scopeID.ToString(), words[0]);
75 }
76 else
77 { 70 {
78 cmd.CommandText = String.Format("select * from {0} where (ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{3}%')", 71 if (words.Length == 1)
79 m_Realm, scopeID.ToString(), words[0], words[1]); 72 {
80 } 73 cmd.CommandText = String.Format("select * from {0} where (ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{2}%')",
74 m_Realm, scopeID.ToString(), words[0]);
75 }
76 else
77 {
78 cmd.CommandText = String.Format("select * from {0} where (ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{3}%')",
79 m_Realm, scopeID.ToString(), words[0], words[1]);
80 }
81 81
82 return DoQuery(cmd); 82 return DoQuery(cmd);
83 }
83 } 84 }
84 } 85 }
85} 86}