Skip to content

Commit

Permalink
Merge pull request #2513 from bleistivt/patch-8
Browse files Browse the repository at this point in the history
UserMetaModel: respect default parameter
  • Loading branch information
linc committed Feb 21, 2015
2 parents 2ea05fc + 3bdfdef commit 898da78
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions applications/dashboard/models/class.usermetamodel.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,18 @@ public function GetUserMeta($UserID, $Key = NULL, $Default = NULL) {
$UserMetaData = $UserMetaQuery->Get();

$UserMeta = array();
if ($UserMetaData->NumRows())
if ($UserMetaData->NumRows()) {
if (is_array($UserID)) {
while ($MetaRow = $UserMetaData->NextRow())
$UserMeta[$MetaRow->UserID][$MetaRow->Name] = $MetaRow->Value;
} else {
while ($MetaRow = $UserMetaData->NextRow())
$UserMeta[$MetaRow->Name] = $MetaRow->Value;
}
else
} else {
self::$MemoryCache[$Key] = $Default;
$UserMeta[$Key] = $Default;
}

unset($UserMetaData);
return $UserMeta;
Expand Down Expand Up @@ -227,4 +229,4 @@ public function SetUserMeta($UserID, $Key, $Value = NULL) {
return;
}

}
}

0 comments on commit 898da78

Please sign in to comment.