From: Joshua Rüsweg Date: Sun, 27 Jul 2014 17:23:14 +0000 (+0200) Subject: fetching user-options in getUserBy*() methods X-Git-Tag: 2.1.0_Alpha_1~325^2^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2bc1a7b13be20b86970b388dbcdb4bfcba3eb4ca;p=GitHub%2FWoltLab%2FWCF.git fetching user-options in getUserBy*() methods --- diff --git a/wcfsetup/install/files/lib/data/user/User.class.php b/wcfsetup/install/files/lib/data/user/User.class.php index 6a0fe802a2..658b098a7b 100644 --- a/wcfsetup/install/files/lib/data/user/User.class.php +++ b/wcfsetup/install/files/lib/data/user/User.class.php @@ -288,9 +288,11 @@ final class User extends DatabaseObject implements IRouteController, IUserConten * @return \wcf\data\user\User */ public static function getUserByUsername($username) { - $sql = "SELECT * - FROM wcf".WCF_N."_user - WHERE username = ?"; + $sql = "SELECT user_option_value.*, user_table.* + FROM wcf".WCF_N."_user user_table + LEFT JOIN wcf".WCF_N."_user_option_value user_option_value + ON (user_option_value.userID = user_table.userID) + WHERE user_table.username = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute(array($username)); $row = $statement->fetchArray(); @@ -306,9 +308,11 @@ final class User extends DatabaseObject implements IRouteController, IUserConten * @return \wcf\data\user\User */ public static function getUserByEmail($email) { - $sql = "SELECT * - FROM wcf".WCF_N."_user - WHERE email = ?"; + $sql = "SELECT user_option_value.*, user_table.* + FROM wcf".WCF_N."_user user_table + LEFT JOIN wcf".WCF_N."_user_option_value user_option_value + ON (user_option_value.userID = user_table.userID) + WHERE user_table.email = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute(array($email)); $row = $statement->fetchArray();