diff options
Diffstat (limited to 'includes/model/UserGroups_model.php')
-rw-r--r-- | includes/model/UserGroups_model.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/includes/model/UserGroups_model.php b/includes/model/UserGroups_model.php new file mode 100644 index 00000000..1d018386 --- /dev/null +++ b/includes/model/UserGroups_model.php @@ -0,0 +1,17 @@ +<?php + +/** + * Returns users groups + * @param User $user + */ +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` + "); +} + +?>
\ No newline at end of file |