2014-08-23 01:55:18 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns users groups
|
2017-01-02 15:43:36 +01:00
|
|
|
*
|
2017-01-03 03:22:48 +01:00
|
|
|
* @param array $user
|
|
|
|
* @return array|false
|
2014-08-23 01:55:18 +02:00
|
|
|
*/
|
2017-01-02 03:57:23 +01:00
|
|
|
function User_groups($user)
|
|
|
|
{
|
2017-01-03 14:12:17 +01:00
|
|
|
return sql_select('
|
2014-08-23 01:55:18 +02:00
|
|
|
SELECT `Groups`.*
|
|
|
|
FROM `UserGroups`
|
|
|
|
JOIN `Groups` ON `Groups`.`UID`=`UserGroups`.`group_id`
|
2017-01-03 14:12:17 +01:00
|
|
|
WHERE `UserGroups`.`uid`=\'' . sql_escape($user['UID']) . '\'
|
2014-08-23 01:55:18 +02:00
|
|
|
ORDER BY `UserGroups`.`group_id`
|
2017-01-03 14:12:17 +01:00
|
|
|
');
|
2014-08-23 01:55:18 +02:00
|
|
|
}
|