blob: b7dd5d614b051e2d007e68115eb89cf9a638a349 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
<?php
/**
*
*/
class kolab_api_service_user_types extends kolab_api_service
{
public function capabilities($domain)
{
return array(
'list' => 'r',
);
}
public function user_types_list($get, $post)
{
$sql_result = $this->db->query("SELECT * FROM user_types");
$user_types = array();
while ($row = $this->db->fetch_assoc($sql_result)) {
$user_types[$row['id']] = array();
foreach ($row as $key => $value) {
if ($key != "id") {
if ($key == "attributes") {
$user_types[$row['id']][$key] = json_decode(unserialize($value), true);
}
else {
$user_types[$row['id']][$key] = $value;
}
}
}
}
return array(
'list' => $user_types,
'count' => count($user_types),
);
}
}
|