Commit 2e1110b9 authored by Dave Cridland's avatar Dave Cridland

Merge pull request #67 from duccio/master

OF-483 - JDBCUserProvider hardcodes searchSQL
parents b45b7500 106315b3
...@@ -319,7 +319,9 @@ public class JDBCUserProvider implements UserProvider { ...@@ -319,7 +319,9 @@ public class JDBCUserProvider implements UserProvider {
sql.append(searchSQL); sql.append(searchSQL);
boolean first = true; boolean first = true;
if (fields.contains("Username")) { if (fields.contains("Username")) {
sql.append(" username LIKE ?"); sql.append(" ");
sql.append(usernameField);
sql.append(" LIKE ?");
queries++; queries++;
first = false; first = false;
} }
...@@ -327,7 +329,9 @@ public class JDBCUserProvider implements UserProvider { ...@@ -327,7 +329,9 @@ public class JDBCUserProvider implements UserProvider {
if (!first) { if (!first) {
sql.append(" AND"); sql.append(" AND");
} }
sql.append(" name LIKE ?"); sql.append(" ");
sql.append(nameField);
sql.append(" LIKE ?");
queries++; queries++;
first = false; first = false;
} }
...@@ -335,7 +339,9 @@ public class JDBCUserProvider implements UserProvider { ...@@ -335,7 +339,9 @@ public class JDBCUserProvider implements UserProvider {
if (!first) { if (!first) {
sql.append(" AND"); sql.append(" AND");
} }
sql.append(" email LIKE ?"); sql.append(" ");
sql.append(emailField);
sql.append(" LIKE ?");
queries++; queries++;
} }
con = getConnection(); con = getConnection();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment