From b373f73ca1b1763822b715da5b61af4d56559927 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Thu, 1 Nov 2007 22:21:33 +1300 Subject: [PATCH] Add a 'where' clause to the auth_other_awl method. --- inc/auth-functions.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/inc/auth-functions.php b/inc/auth-functions.php index 2d952e35..ece64513 100644 --- a/inc/auth-functions.php +++ b/inc/auth-functions.php @@ -145,7 +145,12 @@ EOERRMSG; else $cols = "*"; - $qry = new PgQuery("SELECT $cols FROM usr WHERE lower(username) = ? ", strtolower($username) ); + if ( isset($c->authenticate_hook['config']['where']) ) + $andwhere = " AND ".$c->authenticate_hook['config']['where']; + else + $andwhere = ""; + + $qry = new PgQuery("SELECT $cols FROM usr WHERE lower(username) = ? $andwhere", strtolower($username) ); $qry->SetConnection($authconn); if ( $qry->Exec('Login',__LINE,__FILE__) && $qry->rows == 1 ) { $usr = $qry->Fetch();