diff --git a/projects/samskivert/src/java/com/samskivert/servlet/user/UserRepository.java b/projects/samskivert/src/java/com/samskivert/servlet/user/UserRepository.java index 49b5f8e6..e6447b2e 100644 --- a/projects/samskivert/src/java/com/samskivert/servlet/user/UserRepository.java +++ b/projects/samskivert/src/java/com/samskivert/servlet/user/UserRepository.java @@ -268,6 +268,28 @@ public class UserRepository extends JORARepository }); } + /** + * Lookup a user by email address, something that is not efficient and + * should really only be done by site admins attempting to look up a + * user record. + * + * @return the user with the specified user id or null if no user with + * that id exists. + */ + public ArrayList lookupUsersByEmail (String email) + throws PersistenceException + { + final String where = "where email = '" + + StringUtil.replace(email, "'", "\\'") + "'"; + return (ArrayList) execute(new Operation() { + public Object invoke (Connection conn, DatabaseLiaison liaison) + throws PersistenceException, SQLException + { + return _utable.select(where).toArrayList(); + } + }); + } + /** * Loads up a user record that matches the specified where clause. * Returns null if no record matches.