summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-03-22 11:42:35 (GMT)
committerAleksander Machniak <alec@alec.pl>2012-03-22 11:42:35 (GMT)
commitc4230788ffd11c709097129ddbcfa24b8d94ddef (patch)
tree450af8dc0e40c07ef3f657e8730530c201f03b2a
parent4d0ff765cb0ad3d5e9dd5a580ade084d583ba40a (diff)
downloadkolab-wap-c4230788ffd11c709097129ddbcfa24b8d94ddef.tar.gz
Support new result type of *.info API calls
-rw-r--r--lib/client/kolab_client_task_group.php8
-rw-r--r--lib/client/kolab_client_task_user.php5
-rw-r--r--lib/kolab_client_task.php10
3 files changed, 10 insertions, 13 deletions
diff --git a/lib/client/kolab_client_task_group.php b/lib/client/kolab_client_task_group.php
index 7d0dc77..9b57b99 100644
--- a/lib/client/kolab_client_task_group.php
+++ b/lib/client/kolab_client_task_group.php
@@ -168,9 +168,7 @@ class kolab_client_task_group extends kolab_client_task
{
$id = $this->get_input('id', 'POST');
$result = $this->api->get('group.info', array('group' => $id));
- $group = $result->get($id);
-
- $group['dn'] = $id;
+ $group = $result->get();
$output = $this->group_form(null, $group);
$this->output->set_object('taskcontent', $output);
@@ -216,7 +214,7 @@ class kolab_client_task_group extends kolab_client_task
// Prepare fields
list($fields, $types, $type) = $this->form_prepare('group', $data);
- $add_mode = empty($data['dn']);
+ $add_mode = empty($data['entrydn']);
$accttypes = array();
foreach ($types as $idx => $elem) {
@@ -262,7 +260,7 @@ class kolab_client_task_group extends kolab_client_task
}
}
if (!empty($attr_name)) {
- $result = $this->api->get('group.members_list', array('group' => $data['dn']));
+ $result = $this->api->get('group.members_list', array('group' => $data['entrydn']));
$list = (array) $result->get('list');
$data[$attr_name] = $this->parse_members($list);
}
diff --git a/lib/client/kolab_client_task_user.php b/lib/client/kolab_client_task_user.php
index 2f5d05a..4765fb6 100644
--- a/lib/client/kolab_client_task_user.php
+++ b/lib/client/kolab_client_task_user.php
@@ -168,8 +168,7 @@ class kolab_client_task_user extends kolab_client_task
{
$id = $this->get_input('id', 'POST');
$result = $this->api->get('user.info', array('user' => $id));
- $user = $result->get($id);
- $user['dn'] = $id;
+ $user = $result->get();
$output = $this->user_form(null, $user);
$this->output->set_object('taskcontent', $output);
@@ -247,7 +246,7 @@ class kolab_client_task_user extends kolab_client_task
// Prepare fields
list($fields, $types, $type) = $this->form_prepare('user', $data, array('userpassword2'));
- $add_mode = empty($data['dn']);
+ $add_mode = empty($data['entrydn']);
$accttypes = array();
foreach ($types as $idx => $elem) {
diff --git a/lib/kolab_client_task.php b/lib/kolab_client_task.php
index 920d8ae..dd5a304 100644
--- a/lib/kolab_client_task.php
+++ b/lib/kolab_client_task.php
@@ -176,7 +176,7 @@ class kolab_client_task
$res = $this->api->get('user.info', array('user' => $login['username']));
$res = $res->get();
- if (is_array($res) && ($res = array_shift($res))) {
+ if (is_array($res) && !empty($res)) {
$user['language'] = $res['preferredlanguage'];
$user['fullname'] = $res['cn'];
}
@@ -502,9 +502,9 @@ class kolab_client_task
}
$result = $this->api->get('user.info', array('user' => $dn));
- $user = $result->get($dn);
+ $username = $result->get('displayname');
- if (empty($user) || empty($user['displayname'])) {
+ if (empty($username)) {
if (preg_match('/^cn=([a-zA=Z ]+)/', $dn, $m)) {
$username = ucwords($m[1]);
}
@@ -672,7 +672,7 @@ class kolab_client_task
{
$types = (array) $this->{$name . '_types'}();
$form_id = $attribs['id'];
- $add_mode = empty($data['dn']);
+ $add_mode = empty($data['entrydn']);
$event_fields = array();
$auto_fields = array();
@@ -917,7 +917,7 @@ class kolab_client_task
'onclick' => "kadm.{$name}_save()",
));
- if (!empty($data['dn'])) {
+ if (!empty($data['entrydn'])) {
$id = $data[$name];
$form->add_button(array(
'value' => kolab_html::escape($this->translate('delete.button')),