fix case where user does not exist

the query was being performed when $id was not set, resulting in an
invalid sql query being performed.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
elij 2011-05-10 21:01:29 -07:00 committed by Lukas Fleischer
parent 0898f1447a
commit 3e81712fd6

View file

@ -786,6 +786,9 @@ function valid_passwd( $userID, $passwd )
*/
function user_suspended( $id )
{
if (!$id) {
return false;
}
$dbh = db_connect();
$q = "SELECT Suspended FROM Users WHERE ID = " . $id;
$result = db_query($q, $dbh);