public static function ufind($username, $return_assoc = false){
$con = DB::getConnection();
$username = (String) Filter::String( $username );
// Make sure the user does not exist.
$findUser = $con->prepare("SELECT * FROM users WHERE username = LOWER(:username) LIMIT 1");
$findUser->bindParam(':username', $username, PDO::PARAM_STR);
$findUser->execute();
if ($return_assoc) {
return $findUser->fetch(PDO::FETCH_ASSOC);
# code...
}
$userFound = (boolean) $findUser->rowCount;
return $userFound;
}
$userFound = User::find($email, true);
$userFound = User::ufind($username, true);