2014-08-23 01:55:18 +02:00
|
|
|
<?php
|
|
|
|
|
2017-01-21 13:58:53 +01:00
|
|
|
use Engelsystem\Database\DB;
|
|
|
|
|
2014-08-23 01:55:18 +02:00
|
|
|
/**
|
|
|
|
* Returns users groups
|
2017-01-02 15:43:36 +01:00
|
|
|
*
|
2017-01-03 03:22:48 +01:00
|
|
|
* @param array $user
|
2017-01-21 13:58:53 +01:00
|
|
|
* @return array
|
2014-08-23 01:55:18 +02:00
|
|
|
*/
|
2017-01-02 03:57:23 +01:00
|
|
|
function User_groups($user)
|
|
|
|
{
|
2017-01-21 13:58:53 +01:00
|
|
|
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']]
|
|
|
|
);
|
2014-08-23 01:55:18 +02:00
|
|
|
}
|