summaryrefslogtreecommitdiffstats
path: root/lib/api
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2012-01-20 13:51:14 +0100
committerAleksander Machniak <machniak@kolabsys.com>2012-01-20 13:51:14 +0100
commitd6d7a9e8d1927f31e4997c15f1b0db7df011e01a (patch)
treec26f48a4ae3c46040b3251c59baced21deb64e5e /lib/api
parent1e6371db9a30cf4bacb35d7d84ba9999fc7d745b (diff)
downloadwebadmin-d6d7a9e8d1927f31e4997c15f1b0db7df011e01a.tar.gz
List attributes parameter support in groups.list
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/kolab_groups_actions.php18
-rw-r--r--lib/api/kolab_users_actions.php4
2 files changed, 22 insertions, 0 deletions
diff --git a/lib/api/kolab_groups_actions.php b/lib/api/kolab_groups_actions.php
index eab2a04..0b2478f 100644
--- a/lib/api/kolab_groups_actions.php
+++ b/lib/api/kolab_groups_actions.php
@@ -5,6 +5,13 @@
*/
class kolab_groups_actions extends kolab_api_service
{
+ public $list_attribs = array(
+ 'cn',
+ 'gidnumber',
+ 'objectclass',
+ 'mail',
+ );
+
public function capabilities($domain)
{
return array(
@@ -16,6 +23,17 @@ class kolab_groups_actions extends kolab_api_service
{
$auth = Auth::get_instance();
+ // returned attributes
+ if (!empty($post['attributes']) && is_array($post['attributes'])) {
+ // get only supported attributes
+ $attributes = array_intersect($this->list_attribs, $post['attributes']);
+ // need to fix array keys
+ $attributes = array_values($attributes);
+ }
+ if (empty($attributes)) {
+ $attributes = (array)$this->list_attribs[0];
+ }
+
$groups = $auth->list_groups();
$count = count($groups);
diff --git a/lib/api/kolab_users_actions.php b/lib/api/kolab_users_actions.php
index 87ae5ac..ceb58e7 100644
--- a/lib/api/kolab_users_actions.php
+++ b/lib/api/kolab_users_actions.php
@@ -12,6 +12,10 @@ class kolab_users_actions extends kolab_api_service
'sn',
'givenname',
'mail',
+ 'objectclass',
+ 'uidnumber',
+ 'gidnumber',
+ 'mailhost',
);