summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-05-14 12:12:34 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-05-14 12:12:34 +0100
commitf323bc43f46c8b108121e81d5227c5c09acbead8 (patch)
tree9f341bea23eafa0b4704a1d52019011e09c2c2b6
parent2a86cdf9bf9a55bc4c2b92e2f19ba6ca62d74a58 (diff)
downloadwebadmin-f323bc43f46c8b108121e81d5227c5c09acbead8.tar.gz
Merge
-rw-r--r--lib/api/kolab_api_service_domain.php66
-rw-r--r--lib/api/kolab_api_service_domains.php1
-rw-r--r--lib/api/kolab_api_service_user.php4
-rw-r--r--lib/client/kolab_client_task_group.php2
-rw-r--r--lib/client/kolab_client_task_main.php8
-rw-r--r--lib/kolab_api_controller.php4
-rw-r--r--lib/kolab_api_service.php33
-rw-r--r--lib/kolab_client_api.php4
-rw-r--r--lib/locale/en_US.php163
-rw-r--r--public_html/js/kolab_admin.js5
-rw-r--r--public_html/skins/default/style.css3
11 files changed, 204 insertions, 89 deletions
diff --git a/lib/api/kolab_api_service_domain.php b/lib/api/kolab_api_service_domain.php
index f690b4a..aced3d5 100644
--- a/lib/api/kolab_api_service_domain.php
+++ b/lib/api/kolab_api_service_domain.php
@@ -56,4 +56,70 @@ class kolab_api_service_domain extends kolab_api_service
$auth = Auth::get_instance();
$auth->domain_add($postdata['domain'], $postdata['parent']);
}
+
+ public function domain_effective_rights($getdata, $postdata)
+ {
+ $auth = Auth::get_instance();
+ $conf = Conf::get_instance();
+
+ console($getdata);
+
+ if (!empty($getdata['domain'])) {
+ $entry_dn = $getdata['domain'];
+
+ $unique_attr = $conf->get('ldap', 'unique_attribute');
+
+ $domain = $auth->domain_find_by_attribute(
+ array($unique_attr => $entry_dn)
+ );
+
+ console($domain);
+
+ if (!empty($domain)) {
+ $entry_dn = key($domain);
+ }
+
+ } else {
+ $conf = Conf::get_instance();
+ $entry_dn = $conf->get('ldap', 'domain_base_dn');
+ }
+
+ console("API/domain.effective_rights(); Using entry_dn: " . $entry_dn);
+
+ // TODO: Fix searching the correct base_dn... Perhaps find the entry
+ // first.
+ $effective_rights = $auth->list_rights($entry_dn);
+
+ console($effective_rights);
+ return $effective_rights;
+ }
+
+ /**
+ * Domain information.
+ *
+ * @param array $get GET parameters
+ * @param array $post POST parameters
+ *
+ * @return array|bool Domain attributes, False on error
+ */
+ public function domain_info($getdata, $postdata)
+ {
+ if (!isset($getdata['domain'])) {
+ return false;
+ }
+
+ $auth = Auth::get_instance();
+ $result = $auth->domain_info($getdata['domain']);
+
+ // normalize result
+ $result = $this->parse_result_attributes('domain', $result);
+
+ console("API/domain.info() \$result:", $result);
+
+ if ($result) {
+ return $result;
+ }
+
+ return false;
+ }
}
diff --git a/lib/api/kolab_api_service_domains.php b/lib/api/kolab_api_service_domains.php
index e964936..479d292 100644
--- a/lib/api/kolab_api_service_domains.php
+++ b/lib/api/kolab_api_service_domains.php
@@ -56,6 +56,7 @@ class kolab_api_service_domains extends kolab_api_service
$auth = Auth::get_instance();
$domains = $auth->list_domains();
+ console($domains);
$count = count($domains);
// pagination
diff --git a/lib/api/kolab_api_service_user.php b/lib/api/kolab_api_service_user.php
index 67e7e53..8352ae0 100644
--- a/lib/api/kolab_api_service_user.php
+++ b/lib/api/kolab_api_service_user.php
@@ -82,11 +82,11 @@ class kolab_api_service_user extends kolab_api_service
*/
public function user_add($getdata, $postdata)
{
- //console("user_add()", $postdata);
+ console("user_add()", $postdata);
$user_attributes = $this->parse_input_attributes('user', $postdata);
- //console("user_add()", $user_attributes);
+ console("user_add()", $user_attributes);
$auth = Auth::get_instance();
$result = $auth->user_add($user_attributes, $postdata['type_id']);
diff --git a/lib/client/kolab_client_task_group.php b/lib/client/kolab_client_task_group.php
index 402fabe..097e150 100644
--- a/lib/client/kolab_client_task_group.php
+++ b/lib/client/kolab_client_task_group.php
@@ -298,6 +298,8 @@ class kolab_client_task_group extends kolab_client_task
}
}
+ console($_SESSION['group_types']);
+
return $_SESSION['group_types'];
}
diff --git a/lib/client/kolab_client_task_main.php b/lib/client/kolab_client_task_main.php
index b7b4621..09b0991 100644
--- a/lib/client/kolab_client_task_main.php
+++ b/lib/client/kolab_client_task_main.php
@@ -25,9 +25,11 @@
class kolab_client_task_main extends kolab_client_task
{
protected $menu = array(
- 'user.default' => 'menu.users',
- 'group.default' => 'menu.groups',
- 'about.default' => 'menu.about',
+ 'user.default' => 'menu.users',
+ 'group.default' => 'menu.groups',
+ 'domain.default' => 'menu.domains',
+ 'role.default' => 'menu.roles',
+ 'about.default' => 'menu.about',
);
diff --git a/lib/kolab_api_controller.php b/lib/kolab_api_controller.php
index 23556c8..3530083 100644
--- a/lib/kolab_api_controller.php
+++ b/lib/kolab_api_controller.php
@@ -48,11 +48,11 @@ class kolab_api_controller
);
}
else {
- throw new Exception("Unknown method", 400);
+ throw new Exception("Unknown method " . $_GET['method'], 400);
}
}
else {
- throw new Exception("Unknown service", 400);
+ throw new Exception("Unknown service " . $_GET['service'], 400);
}
// TODO: register services based on config or whatsoever
diff --git a/lib/kolab_api_service.php b/lib/kolab_api_service.php
index d43aa67..54687a9 100644
--- a/lib/kolab_api_service.php
+++ b/lib/kolab_api_service.php
@@ -59,7 +59,7 @@ abstract class kolab_api_service
*/
protected function object_type_attributes($object_name, $type_id, $required = true)
{
- $supported = array('group', 'user');
+ $supported = array('domain', 'group', 'role', 'user');
if (!$object_name || !in_array($object_name, $supported)) {
return array();
}
@@ -75,7 +75,28 @@ abstract class kolab_api_service
$object_types = $this->object_types($object_name);
if (empty($object_types[$type_id])) {
- throw new Exception($this->controller->translate($object_name . '.invalidtypeid'), 35);
+ if ($object_name == 'domain') {
+ return array(
+ 'auto_form_fields' => array(),
+ 'form_fields' => array(
+ 'associateddomain' => array(
+ 'type' => 'list'
+ ),
+ 'o' => array(
+ 'optional' => 'true',
+ ),
+ ),
+ 'fields' => array(
+ 'objectclass' => array(
+ 'top',
+ 'domainrelatedobject',
+ ),
+ ),
+ );
+
+ } else {
+ throw new Exception($this->controller->translate($object_name . '.invalidtypeid'), 35);
+ }
}
return $object_types[$type_id]['attributes'];
@@ -91,6 +112,8 @@ abstract class kolab_api_service
*/
protected function object_type_id($object_name, $object_class)
{
+ if ($object_name == 'domain') return 1;
+
if (empty($object_class)) {
return null;
}
@@ -200,6 +223,12 @@ abstract class kolab_api_service
// add group type id to the result
$attrs['type_id'] = $this->object_type_id($object_name, $attrs['objectclass']);
+ if (empty($attrs['type_id'])) {
+ if ($object_name == 'domain') {
+ $attrs['type_id'] = 1;
+ }
+ }
+
// Search for attributes associated with the type_id that are not part
// of the results returned earlier. Example: nsrole / nsroledn / aci, etc.
// @TODO: this should go to LDAP class
diff --git a/lib/kolab_client_api.php b/lib/kolab_client_api.php
index 622842a..96188a2 100644
--- a/lib/kolab_client_api.php
+++ b/lib/kolab_client_api.php
@@ -150,6 +150,8 @@ class kolab_client_api
$this->request->setMethod(HTTP_Request2::METHOD_GET);
+ console("GET", $url);
+
return $this->get_response($url);
}
@@ -169,6 +171,8 @@ class kolab_client_api
$this->request->setMethod(HTTP_Request2::METHOD_POST);
$this->request->setBody(@json_encode($post));
+ console("POST", $url, $post);
+
return $this->get_response($url);
}
diff --git a/lib/locale/en_US.php b/lib/locale/en_US.php
index 2e01478..3721ad1 100644
--- a/lib/locale/en_US.php
+++ b/lib/locale/en_US.php
@@ -1,24 +1,61 @@
<?php
-$LANG['loading'] = 'Loading...';
-$LANG['saving'] = 'Saving data...';
+$LANG['about.community'] = 'This is the Community Edition of the <b>Kolab Server</b>.';
+$LANG['about.warranty'] = 'It comes with absolutely <b>no warranties</b> and is typically run entirely self supported. You can find help & information on the community <a href="http://kolab.org">web site</a> & <a href="http://wiki.kolab.org">wiki</a>.';
+$LANG['about.support'] = 'Professional support is available from <a href="http://kolabsys.com">Kolab Systems</a>.';
+$LANG['creatorsname'] = 'Created by';
+$LANG['days'] = 'days';
+$LANG['debug'] = 'Debug info';
+$LANG['delete.button'] = 'Delete';
$LANG['deleting'] = 'Deleting data...';
+
+$LANG['domain.add'] = 'Add Domain';
+$LANG['domain.list'] = 'Domains List';
+$LANG['domain.list.records'] = '$1 to $2 of $3';
+$LANG['domain.system'] = 'System';
+$LANG['domain.type_id'] = 'Standard Domain';
+
$LANG['error'] = 'Error';
-$LANG['servererror'] = 'Server Error!';
-$LANG['loginerror'] = 'Incorrect username or password!';
-$LANG['internalerror'] = 'Internal system error!';
-$LANG['welcome'] = 'Welcome to the Kolab Groupware Server Maintenance';
-$LANG['reqtime'] = 'Request time: $1 sec.';
-$LANG['debug'] = 'Debug info';
-$LANG['info'] = 'Information';
-$LANG['creatorsname'] = 'Created by';
-$LANG['modifiersname'] = 'Modified by';
+$LANG['form.required.empty'] = 'Some of the required fields are empty!';
+
+$LANG['group.add'] = 'Add Group';
+$LANG['group.add.success'] = 'Group created successfully.';
+$LANG['group.cn'] = 'Common name';
+$LANG['group.delete.success'] = 'Group deleted successfully.';
+$LANG['group.edit.success'] = 'Group edited successfully.';
+$LANG['group.gidnumber'] = 'Primary group number';
+$LANG['group.list'] = 'Groups List';
+$LANG['group.list.records'] = '$1 to $2 of $3';
+$LANG['group.mail'] = 'Primary Email Address';
+$LANG['group.member'] = 'Member(s)';
+$LANG['group.norecords'] = 'No group records found!';
+$LANG['group.other'] = 'Other';
+$LANG['group.system'] = 'System';
+$LANG['group.type_id'] = 'Group type';
+$LANG['group.uniquemember'] = 'Members';
+
+$LANG['info'] = 'Information';
+$LANG['internalerror'] = 'Internal system error!';
+$LANG['loading'] = 'Loading...';
$LANG['login.username'] = 'Username:';
$LANG['login.password'] = 'Password:';
$LANG['login.login'] = 'Login';
+$LANG['loginerror'] = 'Incorrect username or password!';
+$LANG['MB'] = 'MB';
-$LANG['form.required.empty'] = 'Some of the required fields are empty!';
+$LANG['menu.about'] = 'About';
+$LANG['menu.domains'] = 'Domains';
+$LANG['menu.groups'] = 'Groups';
+$LANG['menu.kolab'] = 'Kolab';
+$LANG['menu.kolabsys'] = 'Kolab Systems';
+$LANG['menu.technology'] = 'Technology';
+$LANG['menu.users'] = 'Users';
+
+$LANG['modifiersname'] = 'Modified by';
+$LANG['password.generate'] = 'Generate password';
+$LANG['reqtime'] = 'Request time: $1 sec.';
+$LANG['saving'] = 'Saving data...';
$LANG['search'] = 'Search';
$LANG['search.criteria'] = 'Search criteria';
@@ -34,106 +71,74 @@ $LANG['search.uid'] = 'UID';
$LANG['search.loading'] = 'Searching...';
$LANG['search.acchars'] = 'At least $min characters required for autocompletion';
-$LANG['menu.users'] = 'Users';
-$LANG['menu.groups'] = 'Groups';
-$LANG['menu.about'] = 'About';
-$LANG['menu.kolab'] = 'Kolab';
-$LANG['menu.kolabsys'] = 'Kolab Systems';
-$LANG['menu.technology'] = 'Technology';
+$LANG['servererror'] = 'Server Error!';
+$LANG['submit.button'] = 'Submit';
$LANG['user.add'] = 'Add User';
+$LANG['user.add.success'] = 'User created successfully.';
+$LANG['user.alias'] = 'Secondary Email Address(es)';
$LANG['user.c'] = 'Country';
+$LANG['user.city'] = 'City';
$LANG['user.cn'] = 'Common name';
$LANG['user.config'] = 'Configuration';
$LANG['user.contact'] = 'Contact';
$LANG['user.contact_info'] = 'Contact Information';
+$LANG['user.country'] = 'Country';
+$LANG['user.country.desc'] = '2 letter code from ISO 3166-1';
+$LANG['user.delete.success'] = 'User deleted successfully.';
+$LANG['user.displayname'] = 'Display name';
+$LANG['user.edit.success'] = 'User edited successfully.';
+$LANG['user.fax'] = 'Fax number';
+$LANG['user.fbinterval'] = 'Free-Busy interval';
+$LANG['user.fbinterval.desc'] = 'Leave blank for default (60 days)';
+$LANG['user.gidnumber'] = 'Primary group number';
+$LANG['user.givenname'] = 'Given name';
+$LANG['user.homedirectory'] = 'Home directory';
$LANG['user.homephone'] = 'Home Phone Number';
+$LANG['user.initials'] = 'Initials';
+$LANG['user.invitation-policy'] = 'Invitation policy';
$LANG['user.kolaballowsmtprecipient'] = 'Recipient(s) Access List';
$LANG['user.kolaballowsmtpsender'] = 'Sender Access List';
$LANG['user.kolabdelegate'] = 'Delegates';
+$LANG['user.kolabhomeserver'] = 'Email Server';
$LANG['user.kolabinvitationpolicy'] = 'Invitation Handling Policy';
$LANG['user.l'] = 'City, Region';
$LANG['user.list'] = 'Users List';
$LANG['user.list.records'] = '$1 to $2 of $3';
+$LANG['user.loginshell'] = 'Shell';
+$LANG['user.mail'] = 'Primary Email Address';
+$LANG['user.mailalternateaddress'] = 'Secondary Email Address(es)';
+$LANG['user.mailhost'] = 'Email Server';
$LANG['user.mailquota'] = 'Quota';
$LANG['user.mailquota.desc'] = 'Leave blank for unlimited';
$LANG['user.mobile'] = 'Mobile Phone Number';
$LANG['user.name'] = 'Name';
$LANG['user.norecords'] = 'No user records found!';
+$LANG['user.nsrole'] = 'Role(s)';
+$LANG['user.nsroledn'] = $LANG['user.nsrole'];
$LANG['user.other'] = 'Other';
$LANG['user.o'] = 'Organization';
+$LANG['user.org'] = 'Organization';
+$LANG['user.orgunit'] = 'Organizational Unit';
$LANG['user.ou'] = 'Organizational Unit';
$LANG['user.pager'] = 'Pager Number';
+$LANG['user.password.mismatch'] = 'Passwords do not match!';
$LANG['user.personal'] = 'Personal';
+$LANG['user.phone'] = 'Phone number';
$LANG['user.postalcode'] = 'Postal Code';
+$LANG['user.postbox'] = 'Postal box';
+$LANG['user.postcode'] = 'Postal code';
+$LANG['user.preferredlanguage'] = 'Native tongue';
+$LANG['user.room'] = 'Room number';
$LANG['user.sn'] = 'Surname';
+$LANG['user.street'] = 'Street';
$LANG['user.system'] = 'System';
$LANG['user.telephonenumber'] = 'Phone Number';
$LANG['user.title'] = 'Job Title';
-$LANG['user.givenname'] = 'Given name';
-$LANG['user.displayname'] = 'Display name';
-$LANG['user.mail'] = 'Primary Email Address';
-$LANG['user.mailhost'] = 'Email Server';
-$LANG['user.kolabhomeserver'] = 'Email Server';
-$LANG['user.initials'] = 'Initials';
-$LANG['user.country'] = 'Country';
-$LANG['user.country.desc'] = '2 letter code from ISO 3166-1';
-$LANG['user.phone'] = 'Phone number';
-$LANG['user.fax'] = 'Fax number';
-$LANG['user.room'] = 'Room number';
-$LANG['user.street'] = 'Street';
-$LANG['user.city'] = 'City';
-$LANG['user.postbox'] = 'Postal box';
-$LANG['user.postcode'] = 'Postal code';
-$LANG['user.org'] = 'Organization';
-$LANG['user.orgunit'] = 'Organizational Unit';
-$LANG['user.fbinterval'] = 'Free-Busy interval';
-$LANG['user.fbinterval.desc'] = 'Leave blank for default (60 days)';
$LANG['user.type_id'] = 'Account type';
-$LANG['user.alias'] = 'Secondary Email Address(es)';
-$LANG['user.mailalternateaddress'] = 'Secondary Email Address(es)';
-$LANG['user.invitation-policy'] = 'Invitation policy';
-$LANG['user.delegate'] = 'Email delegates';
-$LANG['user.delegate.desc'] = 'Others allowed to send emails with a "From" address of this account';
-$LANG['user.smtp-recipients'] = 'Allowed recipients';
-$LANG['user.smtp-recipients.desc'] = 'Restricts allowed recipients of SMTP messages';
$LANG['user.uid'] = 'Unique identity (UID)';
-$LANG['user.nsrole'] = 'Role(s)';
-$LANG['user.nsroledn'] = $LANG['user.nsrole'];
$LANG['user.userpassword'] = 'Password';
$LANG['user.userpassword2'] = 'Confirm password';
-$LANG['user.password.mismatch'] = 'Passwords do not match!';
-$LANG['user.homeserver'] = 'Mailbox home server';
-$LANG['user.add.success'] = 'User created successfully.';
-$LANG['user.delete.success'] = 'User deleted successfully.';
-$LANG['user.edit.success'] = 'User edited successfully.';
-$LANG['user.preferredlanguage'] = 'Native tongue';
-$LANG['user.gidnumber'] = 'Primary group number';
-$LANG['user.homedirectory'] = 'Home directory';
-$LANG['user.loginshell'] = 'Shell';
$LANG['user.uidnumber'] = 'User ID number';
-$LANG['group.add'] = 'Add Group';
-$LANG['group.member'] = 'Member(s)';
-$LANG['group.norecords'] = 'No group records found!';
-$LANG['group.list'] = 'Groups List';
-$LANG['group.list.records'] = '$1 to $2 of $3';
-$LANG['group.cn'] = 'Common name';
-$LANG['group.mail'] = 'Primary Email Address';
-$LANG['group.type_id'] = 'Group type';
-$LANG['group.add.success'] = 'Group created successfully.';
-$LANG['group.delete.success'] = 'Group deleted successfully.';
-$LANG['group.edit.success'] = 'Group edited successfully.';
-$LANG['group.gidnumber'] = 'Primary group number';
-$LANG['group.uniquemember'] = 'Members';
-$LANG['group.system'] = 'System';
-$LANG['group.other'] = 'Other';
-
-$LANG['MB'] = 'MB';
-$LANG['days'] = 'days';
-$LANG['submit.button'] = 'Submit';
-$LANG['delete.button'] = 'Delete';
-$LANG['about.community'] = 'This is the Community Edition of the <b>Kolab Server</b>.';
-$LANG['about.warranty'] = 'It comes with absolutely <b>no warranties</b> and is typically run entirely self supported. You can find help & information on the community <a href="http://kolab.org">web site</a> & <a href="http://wiki.kolab.org">wiki</a>.';
-$LANG['about.support'] = 'Professional support is available from <a href="http://kolabsys.com">Kolab Systems</a>.';
-$LANG['password.generate'] = 'Generate password';
+$LANG['welcome'] = 'Welcome to the Kolab Groupware Server Maintenance';
diff --git a/public_html/js/kolab_admin.js b/public_html/js/kolab_admin.js
index f798a87..bdc0780 100644
--- a/public_html/js/kolab_admin.js
+++ b/public_html/js/kolab_admin.js
@@ -1038,6 +1038,11 @@ function kolab_admin()
return false;
};
+ this.domain_info = function(id)
+ {
+ this.http_post('domain.info', {id: id});
+ };
+
this.user_info = function(id)
{
this.http_post('user.info', {id: id});
diff --git a/public_html/skins/default/style.css b/public_html/skins/default/style.css
index a3cd8c0..e39ece2 100644
--- a/public_html/skins/default/style.css
+++ b/public_html/skins/default/style.css
@@ -33,6 +33,7 @@ table.list {
border: 1px solid #d0d0d0;
border-spacing: 0;
border-radius: 3px;
+ width: 100%;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
}
@@ -553,7 +554,7 @@ span.listelement input {
span.listarea.disabled span.listelement input,
span.listarea.readonly span.listelement input {
- width: 370px;
+ width: 370px;
}
span.listelement input:focus {