1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-22 21:40:08 +00:00

ChatUtil::writeUserData now accepts the user-object as the second parameter.

This commit is contained in:
Tim Düsterhus 2012-04-18 22:45:11 +02:00
parent 2e2edec54f
commit 3eaf35c9c1

View File

@ -223,14 +223,16 @@ public static function timeModifier($time) {
/** /**
* Writes user data * Writes user data
* *
* @param \wcf\data\user\User $user
* @param array $data * @param array $data
*/ */
public static function writeUserData(array $data) { public static function writeUserData(array $data, \wcf\data\user\User $user = null) {
if ($user === null) $user = WCF::getUser();
$ush = UserStorageHandler::getInstance(); $ush = UserStorageHandler::getInstance();
$packageID = self::getPackageID(); $packageID = self::getPackageID();
foreach($data as $key => $value) { foreach($data as $key => $value) {
$ush->update(WCF::getUser()->userID, $key, (isset(static::$serialize[$key])) ? serialize($value) : $value, $packageID); $ush->update($user->userID, $key, (isset(static::$serialize[$key])) ? serialize($value) : $value, $packageID);
} }
} }