diff options
Diffstat (limited to 'includes/model/UserGroups_model.php')
-rw-r--r-- | includes/model/UserGroups_model.php | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/includes/model/UserGroups_model.php b/includes/model/UserGroups_model.php index 766f402f..d4baf638 100644 --- a/includes/model/UserGroups_model.php +++ b/includes/model/UserGroups_model.php @@ -1,17 +1,22 @@ <?php +use Engelsystem\Database\DB; + /** * Returns users groups - * @param User $user + * + * @param array $user + * @return array */ -function User_groups($user) { - return sql_select(" - SELECT `Groups`.* - FROM `UserGroups` - JOIN `Groups` ON `Groups`.`UID`=`UserGroups`.`group_id` - WHERE `UserGroups`.`uid`='" . sql_escape($user['UID']) . "' - ORDER BY `UserGroups`.`group_id` - "); +function User_groups($user) +{ + return DB::select(' + SELECT `Groups`.* + FROM `UserGroups` + JOIN `Groups` ON `Groups`.`UID`=`UserGroups`.`group_id` + WHERE `UserGroups`.`uid`=? + ORDER BY `UserGroups`.`group_id` + ', + [$user['UID']] + ); } - -?>
\ No newline at end of file |