Projects
Kolab:3.4
kolab-webadmin
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 23
View file
kolab-webadmin-3.1.2.tar.gz/doc/kolab_wap-3.1.sql -> kolab-webadmin-3.1.3.tar.gz/doc/kolab_wap-3.1.sql
Changed
@@ -175,7 +175,7 @@ LOCK TABLES `user_types` WRITE; /*!40000 ALTER TABLE `user_types` DISABLE KEYS */; -INSERT INTO `user_types` VALUES (1,'kolab','Kolab User','A Kolab User','{\"auto_form_fields\":{\"alias\":{\"type\":\"list\",\"data\":[\"givenname\",\"preferredlanguage\",\"sn\"]},\"cn\":{\"data\":[\"givenname\",\"sn\"]},\"displayname\":{\"data\":[\"givenname\",\"sn\"]},\"mail\":{\"data\":[\"givenname\",\"preferredlanguage\",\"sn\"]},\"mailhost\":{\"optional\":true},\"uid\":{\"data\":[\"givenname\",\"preferredlanguage\",\"sn\"]},\"userpassword\":{\"optional\":true}},\"form_fields\":{\"alias\":{\"optional\":true},\"givenname\":[],\"initials\":{\"optional\":true},\"kolabdelegate\":{\"type\":\"list\",\"autocomplete\":true,\"optional\":true},\"kolabinvitationpolicy\":{\"type\":\"select\",\"values\":[\"\",\"ACT_MANUAL\",\"ACT_REJECT\"],\"optional\":true},\"kolaballowsmtprecipient\":{\"type\":\"list\",\"optional\":true},\"kolaballowsmtpsender\":{\"type\":\"list\",\"optional\":true},\"l\":{\"optional\":true},\"mailalternateaddress\":{\"type\":\"list\",\"optional\":true},\"mailquota\":{\"type\":\"text-quota\",\"optional\":true},\"mobile\":{\"optional\":true},\"nsroledn\":{\"type\":\"list\",\"autocomplete\":true,\"optional\":true},\"o\":{\"optional\":true},\"ou\":{\"type\":\"select\"},\"pager\":{\"optional\":true},\"postalcode\":{\"optional\":true},\"preferredlanguage\":{\"type\":\"select\"},\"sn\":[],\"street\":{\"optional\":true},\"telephonenumber\":{\"optional\":true},\"title\":{\"optional\":true},\"userpassword\":{\"optional\":true}},\"fields\":{\"objectclass\":[\"top\",\"inetorgperson\",\"kolabinetorgperson\",\"mailrecipient\",\"organizationalperson\",\"person\"]}}',NULL),(2,'posix','POSIX User','A POSIX user (with a home directory and shell access)','{\"auto_form_fields\":{\"cn\":{\"data\":[\"givenname\",\"sn\"]},\"displayname\":{\"data\":[\"givenname\",\"sn\"]},\"gidnumber\":[],\"homedirectory\":{\"data\":[\"givenname\",\"sn\"]},\"uid\":{\"data\":[\"givenname\",\"sn\"]},\"uidnumber\":[],\"userpassword\":{\"optional\":true}},\"form_fields\":{\"givenname\":[],\"initials\":{\"optional\":true},\"preferredlanguage\":{\"type\":\"select\",\"values\":[\"en_US\",\"de_DE\",\"de_CH\",\"en_GB\",\"fi_FI\",\"fr_FR\",\"hu_HU\"]},\"loginshell\":{\"type\":\"select\",\"values\":[\"/bin/bash\",\"/usr/bin/git-shell\",\"/sbin/nologin\"]},\"ou\":{\"type\":\"select\"},\"sn\":[],\"title\":{\"optional\":true},\"userpassword\":{\"optional\":true}},\"fields\":{\"objectclass\":[\"top\",\"inetorgperson\",\"organizationalperson\",\"person\",\"posixaccount\"]}}',NULL),(3,'kolab_posix','Mail-enabled POSIX User','A mail-enabled POSIX User','{\"auto_form_fields\":{\"alias\":{\"data\":[\"givenname\",\"preferredlanguage\",\"sn\"]},\"cn\":{\"data\":[\"givenname\",\"preferredlanguage\",\"sn\"]},\"displayname\":{\"data\":[\"givenname\",\"preferredlanguage\",\"sn\"]},\"gidnumber\":[],\"homedirectory\":{\"data\":[\"givenname\",\"preferredlanguage\",\"sn\"]},\"mail\":{\"data\":[\"givenname\",\"preferredlanguage\",\"sn\"]},\"mailhost\":{\"optional\":true},\"uid\":{\"data\":[\"givenname\",\"preferredlanguage\",\"sn\"]},\"uidnumber\":[],\"userpassword\":{\"optional\":true}},\"form_fields\":{\"alias\":{\"optional\":true},\"givenname\":[],\"initials\":{\"optional\":true},\"kolabdelegate\":{\"type\":\"list\",\"autocomplete\":true,\"optional\":true},\"kolabinvitationpolicy\":{\"type\":\"select\",\"values\":[\"\",\"ACT_MANUAL\",\"ACT_REJECT\"],\"optional\":true},\"kolaballowsmtprecipient\":{\"type\":\"list\",\"optional\":true},\"kolaballowsmtpsender\":{\"type\":\"list\",\"optional\":true},\"l\":{\"optional\":true},\"loginshell\":{\"type\":\"select\",\"values\":[\"/bin/bash\",\"/usr/bin/git-shell\",\"/sbin/nologin\"]},\"mailalternateaddress\":{\"type\":\"list\",\"optional\":true},\"mailquota\":{\"type\":\"text-quota\",\"optional\":true},\"mobile\":{\"optional\":true},\"nsroledn\":{\"type\":\"list\",\"autocomplete\":true,\"optional\":true},\"o\":{\"optional\":true},\"ou\":{\"type\":\"select\"},\"pager\":{\"optional\":true},\"postalcode\":{\"optional\":true},\"preferredlanguage\":{\"type\":\"select\"},\"sn\":[],\"street\":{\"optional\":true},\"telephonenumber\":{\"optional\":true},\"title\":{\"optional\":true},\"userpassword\":{\"optional\":true}},\"fields\":{\"objectclass\":[\"top\",\"inetorgperson\",\"kolabinetorgperson\",\"mailrecipient\",\"organizationalperson\",\"person\",\"posixaccount\"]}}',NULL),(4,'contact','Contact','A global address book contact','{\"auto_form_fields\":{\"cn\":{\"data\":[\"givenname\",\"sn\"]},\"displayname\":{\"data\":[\"givenname\",\"sn\"]},\"uid\":{\"data\":[\"givenname\",\"sn\"]},\"userpassword\":{\"optional\":true}},\"form_fields\":{\"cn\":{\"optional\":true},\"displayname\":{\"optional\":true},\"givenname\":[],\"initials\":{\"optional\":true},\"l\":{\"optional\":true},\"mail\":{\"type\":\"list\",\"optional\":true},\"mailalternateaddress\":{\"type\":\"list\",\"optional\":true},\"mobile\":{\"optional\":true},\"o\":{\"optional\":true},\"ou\":{\"type\":\"select\"},\"pager\":{\"optional\":true},\"postalcode\":{\"optional\":true},\"sn\":[],\"street\":{\"optional\":true},\"telephonenumber\":{\"optional\":true},\"title\":{\"optional\":true},\"userpassword\":{\"optional\":true}},\"fields\":{\"objectclass\":[\"top\",\"inetorgperson\",\"mailrecipient\",\"organizationalperson\",\"person\"]}}',NULL),(5,'forwarding','Mail Forwarding','A mail forwarding account (forwarding only!)','{\"auto_form_fields\":{\"cn\":{\"data\":[\"givenname\",\"sn\"]},\"displayname\":{\"data\":[\"givenname\",\"sn\"]},\"uid\":{\"data\":[\"givenname\",\"sn\"]},\"userpassword\":{\"optional\":true}},\"form_fields\":{\"cn\":{\"optional\":true},\"displayname\":{\"optional\":true},\"givenname\":[],\"initials\":{\"optional\":true},\"l\":{\"optional\":true},\"mail\":{\"type\":\"list\",\"optional\":true},\"mailalternateaddress\":{\"type\":\"list\",\"optional\":true},\"mailforwardingaddress\":{\"type\":\"list\",\"optional\":true},\"mobile\":{\"optional\":true},\"o\":{\"optional\":true},\"ou\":{\"type\":\"select\"},\"pager\":{\"optional\":true},\"postalcode\":{\"optional\":true},\"sn\":[],\"street\":{\"optional\":true},\"telephonenumber\":{\"optional\":true},\"title\":{\"optional\":true},\"userpassword\":{\"optional\":true}},\"fields\":{\"objectclass\":[\"top\",\"inetorgperson\",\"mailrecipient\",\"organizationalperson\",\"person\"]}}',NULL); +INSERT INTO `user_types` VALUES (1,'kolab','Kolab User','A Kolab User','{\"auto_form_fields\":{\"alias\":{\"type\":\"list\",\"data\":[\"givenname\",\"preferredlanguage\",\"sn\"]},\"cn\":{\"data\":[\"givenname\",\"sn\"]},\"displayname\":{\"data\":[\"givenname\",\"sn\"]},\"mail\":{\"data\":[\"givenname\",\"preferredlanguage\",\"sn\"]},\"mailhost\":{\"optional\":true},\"uid\":{\"data\":[\"givenname\",\"preferredlanguage\",\"sn\"]},\"userpassword\":{\"optional\":true}},\"form_fields\":{\"alias\":{\"optional\":true},\"givenname\":[],\"initials\":{\"optional\":true},\"kolabdelegate\":{\"type\":\"list\",\"autocomplete\":true,\"optional\":true},\"kolabinvitationpolicy\":{\"type\":\"select\",\"values\":[\"\",\"ACT_MANUAL\",\"ACT_REJECT\"],\"optional\":true},\"kolaballowsmtprecipient\":{\"type\":\"list\",\"optional\":true},\"kolaballowsmtpsender\":{\"type\":\"list\",\"optional\":true},\"l\":{\"optional\":true},\"mailalternateaddress\":{\"type\":\"list\",\"optional\":true},\"mailquota\":{\"type\":\"text-quota\",\"optional\":true},\"mobile\":{\"optional\":true},\"nsroledn\":{\"type\":\"list\",\"autocomplete\":true,\"optional\":true},\"o\":{\"optional\":true},\"ou\":{\"type\":\"select\"},\"pager\":{\"optional\":true},\"postalcode\":{\"optional\":true},\"preferredlanguage\":{\"type\":\"select\"},\"sn\":[],\"street\":{\"optional\":true},\"telephonenumber\":{\"optional\":true},\"title\":{\"optional\":true},\"userpassword\":{\"optional\":true}},\"fields\":{\"objectclass\":[\"top\",\"inetorgperson\",\"kolabinetorgperson\",\"mailrecipient\",\"organizationalperson\",\"person\"]}}',NULL),(2,'posix','POSIX User','A POSIX user (with a home directory and shell access)','{\"auto_form_fields\":{\"cn\":{\"data\":[\"givenname\",\"sn\"]},\"displayname\":{\"data\":[\"givenname\",\"sn\"]},\"gidnumber\":[],\"homedirectory\":{\"data\":[\"givenname\",\"sn\"]},\"uid\":{\"data\":[\"givenname\",\"sn\"]},\"uidnumber\":[],\"userpassword\":{\"optional\":true}},\"form_fields\":{\"givenname\":[],\"initials\":{\"optional\":true},\"preferredlanguage\":{\"type\":\"select\",\"values\":[\"en_US\",\"de_DE\",\"de_CH\",\"en_GB\",\"fi_FI\",\"fr_FR\",\"hu_HU\"]},\"loginshell\":{\"type\":\"select\",\"values\":[\"/bin/bash\",\"/usr/bin/git-shell\",\"/sbin/nologin\"]},\"ou\":{\"type\":\"select\"},\"sn\":[],\"title\":{\"optional\":true},\"userpassword\":{\"optional\":true}},\"fields\":{\"objectclass\":[\"top\",\"inetorgperson\",\"organizationalperson\",\"person\",\"posixaccount\"]}}',NULL),(3,'kolab_posix','Mail-enabled POSIX User','A mail-enabled POSIX User','{\"auto_form_fields\":{\"alias\":{\"data\":[\"givenname\",\"preferredlanguage\",\"sn\"]},\"cn\":{\"data\":[\"givenname\",\"preferredlanguage\",\"sn\"]},\"displayname\":{\"data\":[\"givenname\",\"preferredlanguage\",\"sn\"]},\"gidnumber\":[],\"homedirectory\":{\"data\":[\"givenname\",\"preferredlanguage\",\"sn\"]},\"mail\":{\"data\":[\"givenname\",\"preferredlanguage\",\"sn\"]},\"mailhost\":{\"optional\":true},\"uid\":{\"data\":[\"givenname\",\"preferredlanguage\",\"sn\"]},\"uidnumber\":[],\"userpassword\":{\"optional\":true}},\"form_fields\":{\"alias\":{\"optional\":true},\"givenname\":[],\"initials\":{\"optional\":true},\"kolabdelegate\":{\"type\":\"list\",\"autocomplete\":true,\"optional\":true},\"kolabinvitationpolicy\":{\"type\":\"select\",\"values\":[\"\",\"ACT_MANUAL\",\"ACT_REJECT\"],\"optional\":true},\"kolaballowsmtprecipient\":{\"type\":\"list\",\"optional\":true},\"kolaballowsmtpsender\":{\"type\":\"list\",\"optional\":true},\"l\":{\"optional\":true},\"loginshell\":{\"type\":\"select\",\"values\":[\"/bin/bash\",\"/usr/bin/git-shell\",\"/sbin/nologin\"]},\"mailalternateaddress\":{\"type\":\"list\",\"optional\":true},\"mailquota\":{\"type\":\"text-quota\",\"optional\":true},\"mobile\":{\"optional\":true},\"nsroledn\":{\"type\":\"list\",\"autocomplete\":true,\"optional\":true},\"o\":{\"optional\":true},\"ou\":{\"type\":\"select\"},\"pager\":{\"optional\":true},\"postalcode\":{\"optional\":true},\"preferredlanguage\":{\"type\":\"select\"},\"sn\":[],\"street\":{\"optional\":true},\"telephonenumber\":{\"optional\":true},\"title\":{\"optional\":true},\"userpassword\":{\"optional\":true}},\"fields\":{\"objectclass\":[\"top\",\"inetorgperson\",\"kolabinetorgperson\",\"mailrecipient\",\"organizationalperson\",\"person\",\"posixaccount\"]}}',NULL),(4,'contact','Contact','A global address book contact','{\"auto_form_fields\":{\"cn\":{\"data\":[\"givenname\",\"sn\"]},\"displayname\":{\"data\":[\"givenname\",\"sn\"]},\"uid\":{\"data\":[\"givenname\",\"sn\"]},\"userpassword\":{\"optional\":true}},\"form_fields\":{\"cn\":{\"optional\":true},\"displayname\":{\"optional\":true},\"givenname\":[],\"initials\":{\"optional\":true},\"l\":{\"optional\":true},\"mail\":{\"type\":\"list\",\"optional\":true},\"mailalternateaddress\":{\"type\":\"list\",\"optional\":true},\"mobile\":{\"optional\":true},\"o\":{\"optional\":true},\"ou\":{\"type\":\"select\"},\"pager\":{\"optional\":true},\"postalcode\":{\"optional\":true},\"sn\":[],\"street\":{\"optional\":true},\"telephonenumber\":{\"optional\":true},\"title\":{\"optional\":true},\"userpassword\":{\"optional\":true}},\"fields\":{\"objectclass\":[\"top\",\"inetorgperson\",\"mailrecipient\",\"organizationalperson\",\"person\"]}}',NULL),(5,'forwarding','Mail Forwarding','A mail forwarding account (forwarding only!)','{\"auto_form_fields\":{\"cn\":{\"data\":[\"givenname\",\"sn\"]},\"displayname\":{\"data\":[\"givenname\",\"sn\"]},\"uid\":{\"data\":[\"givenname\",\"sn\"]},\"userpassword\":{\"optional\":true}},\"form_fields\":{\"cn\":{\"optional\":true},\"displayname\":{\"optional\":true},\"givenname\":[],\"initials\":{\"optional\":true},\"l\":{\"optional\":true},\"mail\":{\"type\":\"list\",\"optional\":true},\"mailalternateaddress\":{\"type\":\"list\",\"optional\":true},\"mailforwardingaddress\":{\"type\":\"list\"},\"mobile\":{\"optional\":true},\"o\":{\"optional\":true},\"ou\":{\"type\":\"select\"},\"pager\":{\"optional\":true},\"postalcode\":{\"optional\":true},\"sn\":[],\"street\":{\"optional\":true},\"telephonenumber\":{\"optional\":true},\"title\":{\"optional\":true},\"userpassword\":{\"optional\":true}},\"fields\":{\"objectclass\":[\"top\",\"inetorgperson\",\"mailrecipient\",\"organizationalperson\",\"person\"]}}',NULL); /*!40000 ALTER TABLE `user_types` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
View file
kolab-webadmin-3.1.2.tar.gz/lib/Auth.php -> kolab-webadmin-3.1.3.tar.gz/lib/Auth.php
Changed
@@ -367,11 +367,6 @@ return $this->auth_instance()->resource_info($resourcedata); } - public function resource_members_list($resourcedata, $recurse = true) - { - return $this->auth_instance()->resource_members_list($resourcedata, $recurse); - } - public function role_add($role) { return $this->auth_instance()->role_add($role);
View file
kolab-webadmin-3.1.2.tar.gz/lib/Auth/LDAP.php -> kolab-webadmin-3.1.3.tar.gz/lib/Auth/LDAP.php
Changed
@@ -340,36 +340,44 @@ } $dn = $inetdomainbasedn; + + // @TODO: this list should be configurable or auto-created somehow + $self_attrs = array( + 'carLicense', 'description', 'displayName', 'facsimileTelephoneNumber', 'homePhone', + 'homePostalAddress', 'initials', 'jpegPhoto', 'labeledURI', 'mobile', 'o', 'pager', 'photo', + 'postOfficeBox', 'postalAddress', 'postalCode', 'preferredDeliveryMethod', 'preferredLanguage', + 'registeredAddress', 'roomNumber', 'secretary', 'seeAlso', 'st', 'street', 'telephoneNumber', + 'telexNumber', 'title', 'userCertificate', 'userPassword', 'userSMIMECertificate', + 'x500UniqueIdentifier', + ); + if (in_array('kolabInetOrgPerson', $this->classes_allowed())) { + $self_attrs = array_merge($self_attrs, array('kolabDelegate', 'kolabInvitationPolicy', 'kolabAllowSMTPSender')); + } + $attrs = array( - // @TODO: Probably just use ldap_explode_dn() - 'dc' => substr($dn, (strpos($dn, '=')+1), ((strpos($dn, ',')-strpos($dn, '='))-1)), - 'objectclass' => array( - 'top', - 'domain', - ), - 'aci' => array( - // Self-modification - "(targetattr=\"carLicense || description || displayName || facsimileTelephoneNumber || homePhone || homePostalAddress || initials || jpegPhoto || labeledURI || mobile || pager || photo || postOfficeBox || postalAddress || postalCode || preferredDeliveryMethod || preferredLanguage || registeredAddress || roomNumber || secretary || seeAlso || st || street || telephoneNumber || telexNumber || title || userCertificate || userPassword || userSMIMECertificate || x500UniqueIdentifier\")(version 3.0; acl \"Enable self write for common attributes\"; allow (write) userdn=\"ldap:///self\";)", - - // Directory Administrators - "(targetattr =\"*\")(version 3.0;acl \"Directory Administrators Group\";allow (all) (groupdn=\"ldap:///cn=Directory Administrators," . $inetdomainbasedn . "\" or roledn=\"ldap:///cn=kolab-admin," . $inetdomainbasedn . "\");)", - - // Configuration Administrators - "(targetattr=\"*\")(version 3.0; acl \"Configuration Administrators Group\"; allow (all) groupdn=\"ldap:///cn=Configuration Administrators,ou=Groups,ou=TopologyManagement,o=NetscapeRoot\";)", - - // Administrator users - "(targetattr=\"*\")(version 3.0; acl \"Configuration Administrator\"; allow (all) userdn=\"ldap:///uid=admin,ou=Administrators,ou=TopologyManagement,o=NetscapeRoot\";)", - - // SIE Group - $_aci, - - // Search Access, - "(targetattr != \"userPassword\") (version 3.0;acl \"Search Access\";allow (read,compare,search)(userdn = \"ldap:///" . $inetdomainbasedn . "??sub?(objectclass=*)\");)", - - // Service Search Access - "(targetattr = \"*\") (version 3.0;acl \"Service Search Access\";allow (read,compare,search)(userdn = \"ldap:///" . $service_bind_dn . "\");)", - ), - ); + // @TODO: Probably just use ldap_explode_dn() + 'dc' => substr($dn, (strpos($dn, '=')+1), ((strpos($dn, ',')-strpos($dn, '='))-1)), + 'objectclass' => array( + 'top', + 'domain', + ), + 'aci' => array( + // Self-modification + "(targetattr = \"" . implode(" || ", $self_attrs) . "\")(version 3.0; acl \"Enable self write for common attributes\"; allow (write) userdn=\"ldap:///self\";)", + // Directory Administrators + "(targetattr = \"*\")(version 3.0; acl \"Directory Administrators Group\"; allow (all) (groupdn=\"ldap:///cn=Directory Administrators," . $inetdomainbasedn . "\" or roledn=\"ldap:///cn=kolab-admin," . $inetdomainbasedn . "\");)", + // Configuration Administrators + "(targetattr = \"*\")(version 3.0; acl \"Configuration Administrators Group\"; allow (all) groupdn=\"ldap:///cn=Configuration Administrators,ou=Groups,ou=TopologyManagement,o=NetscapeRoot\";)", + // Administrator users + "(targetattr = \"*\")(version 3.0; acl \"Configuration Administrator\"; allow (all) userdn=\"ldap:///uid=admin,ou=Administrators,ou=TopologyManagement,o=NetscapeRoot\";)", + // SIE Group + $_aci, + // Search Access, + "(targetattr != \"userPassword\") (version 3.0; acl \"Search Access\"; allow (read,compare,search) (userdn = \"ldap:///" . $inetdomainbasedn . "??sub?(objectclass=*)\");)", + // Service Search Access + "(targetattr = \"*\") (version 3.0; acl \"Service Search Access\"; allow (read,compare,search) (userdn = \"ldap:///" . $service_bind_dn . "\");)", + ), + ); if (!empty($replica_hosts)) { foreach ($replica_hosts as $replica_host) { @@ -673,7 +681,7 @@ return false; } - return $this->_list_group_members($group_dn, null, $recurse); + return $this->list_group_members($group_dn, null, $recurse); } public function list_domains($attributes = array(), $search = array(), $params = array()) @@ -817,17 +825,6 @@ return $this->_read($resource_dn, $attributes); } - public function resource_members_list($resource, $recurse = true) - { - $resource_dn = $this->entry_dn($resource); - - if (!$resource_dn) { - return false; - } - - return $this->_list_resource_members($resource_dn, null, $recurse); - } - public function role_add($attrs) { $base_dn = $this->entry_base_dn('role', $typeid); @@ -1307,21 +1304,18 @@ } if (!empty($params) && is_array($params)) { - if (array_key_exists('sort_by', $params)) { + if (!empty($params['sort_by'])) { $this->sort_result_key = $params['sort_by']; uasort($entries, array($this, 'sort_result')); } - if (array_key_exists('page_size', $params) && array_key_exists('page', $params)) { - if ($result->count() > $params['page_size']) { - $entries = array_slice($entries, (($params['page'] - 1) * $params['page_size']), $params['page_size'], true); - } - + if (!empty($params['sort_order']) && $params['sort_order'] == "DESC") { + $entries = array_reverse($entries, true); } - if (array_key_exists('sort_order', $params) && !empty($params['sort_order'])) { - if ($params['sort_order'] == "DESC") { - $entries = array_reverse($entries, true); + if (!empty($params['page_size']) && !empty($params['page'])) { + if ($result->count() > $params['page_size']) { + $entries = array_slice($entries, (($params['page'] - 1) * $params['page_size']), $params['page_size'], true); } } }
View file
kolab-webadmin-3.1.2.tar.gz/lib/api/kolab_api_service_form_value.php -> kolab-webadmin-3.1.3.tar.gz/lib/api/kolab_api_service_form_value.php
Changed
@@ -64,7 +64,7 @@ */ public function generate($getdata, $postdata) { - $attribs = $this->object_type_attributes($postdata['object_type'], $postdata['type_id'], true, $type_key); + $attribs = $this->object_type_attributes($postdata['object_type'], $postdata['type_id'], $type_key); $attributes = (array) $postdata['attributes']; $result = array(); @@ -112,7 +112,7 @@ { //console($postdata); - $attribs = $this->object_type_attributes($postdata['object_type'], $postdata['type_id'], true, $key_name); + $attribs = $this->object_type_attributes($postdata['object_type'], $postdata['type_id'], $key_name); $attr_name = $postdata['attribute']; $result = array( // return search value, so client can match response to request @@ -161,7 +161,7 @@ public function select_options($getdata, $postdata) { //console("form_value.select_options postdata", $postdata); - $attribs = $this->object_type_attributes($postdata['object_type'], $postdata['type_id'], true, $key_name); + $attribs = $this->object_type_attributes($postdata['object_type'], $postdata['type_id'], $key_name); $attributes = (array) $postdata['attributes']; $result = array();
View file
kolab-webadmin-3.1.2.tar.gz/lib/ext/Net/LDAP3.php -> kolab-webadmin-3.1.3.tar.gz/lib/ext/Net/LDAP3.php
Changed
@@ -930,17 +930,23 @@ /** * Get a specific LDAP entry, identified by its DN * - * @param string $dn Record identifier - * @return array Hash array + * @param string $dn Record identifier + * @param array $attributes Attributes to return + * + * @return array Hash array */ - public function get_entry($dn) + public function get_entry($dn, $attributes = array()) { $rec = null; if ($this->conn && $dn) { $this->_debug("C: Read [dn: $dn] [(objectclass=*)]"); - if ($ldap_result = @ldap_read($this->conn, $dn, '(objectclass=*)', $this->return_attributes)) { + if (empty($attributes)) { + $attributes = $this->return_attributes; + } + + if ($ldap_result = @ldap_read($this->conn, $dn, '(objectclass=*)', $attributes)) { $this->_debug("S: OK"); if ($entry = ldap_first_entry($this->conn, $ldap_result)) { @@ -1143,61 +1149,43 @@ return $entry_dn; } - public function list_entries($base_dn, $filter = '(objectclass=*)', $scope = 'sub', $sort = null) - { - $search = $this->search($base_dn, $filter, $scope, $sort); - - if (!$search) { - $this->_debug("Net_LDAP3: Search did not succeed!"); - return false; - } - - return $this->result; - - } - public function list_group_members($dn, $entry = null, $recurse = true) { - $group_members = array(); + $this->_debug("Called list_group_members(" . $dn . ")"); if (is_array($entry) && in_array('objectclass', $entry)) { if (!in_array(array('groupofnames', 'groupofuniquenames', 'groupofurls'), $entry['objectclass'])) { - $this->_debug("Called _list_groups_members on a non-group!"); - } - else { - $this->_debug("Called list_group_members(" . $dn . ")"); + $this->_debug("Called list_group_members on a non-group!"); + return array(); } } + else { + $entry = $this->get_entry($dn, array('member', 'uniquemember', 'memberurl', 'objectclass')); - $entry = $this->search($dn); - - if (!$entry) { - return array(); + if (!$entry) { + return array(); + } } - $this->_debug("ENTRIES for \$dn $dn", $entry); + $group_members = array(); - foreach ($entry[$dn] as $attribute => $value) { - if ($attribute == "objectclass") { - foreach ($value as $objectclass) { - switch (strtolower($objectclass)) { - case "groupofnames": - case "kolabgroupofnames": - $group_members = array_merge($group_members, $this->_list_group_member($dn, $entry[$dn]['member'], $recurse)); - break; - case "groupofuniquenames": - case "kolabgroupofuniquenames": - $group_members = array_merge($group_members, $this->_list_group_uniquemember($dn, $entry[$dn]['uniquemember'], $recurse)); - break; - case "groupofurls": - $group_members = array_merge($group_members, $this->_list_group_memberurl($dn, $entry[$dn]['memberurl'], $recurse)); - break; - } - } + foreach ((array)$entry['objectclass'] as $objectclass) { + switch (strtolower($objectclass)) { + case "groupofnames": + case "kolabgroupofnames": + $group_members = array_merge($group_members, $this->list_group_member($dn, $entry['member'], $recurse)); + break; + case "groupofuniquenames": + case "kolabgroupofuniquenames": + $group_members = array_merge($group_members, $this->list_group_uniquemember($dn, $entry['uniquemember'], $recurse)); + break; + case "groupofurls": + $group_members = array_merge($group_members, $this->list_group_memberurl($dn, $entry['memberurl'], $recurse)); + break; } } - return array_filter($group_members); + return array_values(array_filter($group_members)); } public function modify_entry($subject_dn, $old_attrs, $new_attrs) @@ -2050,30 +2038,28 @@ private function list_group_member($dn, $members, $recurse = true) { - $this->_debug("Called _list_group_member(" . $dn . ")"); + $this->_debug("Called list_group_member(" . $dn . ")"); + $members = (array) $members; $group_members = array(); - $members = (array)($members); - - if (empty($members)) { - return $group_members; - } + // remove possible 'count' item + unset($members['count']); // Use the member attributes to return an array of member ldap objects // NOTE that the member attribute is supposed to contain a DN foreach ($members as $member) { - $member_entry = $this->_read($member, '(objectclass=*)'); + $member_entry = $this->get_entry($member, array('member', 'uniquemember', 'memberurl', 'objectclass')); if (empty($member_entry)) { continue; } - $group_members[$member] = array_pop($member_entry); + $group_members[$member] = $member; if ($recurse) { // Nested groups - $group_group_members = $this->_list_group_members($member, $member_entry); + $group_group_members = $this->list_group_members($member, $member_entry); if ($group_group_members) { $group_members = array_merge($group_group_members, $group_members); } @@ -2085,34 +2071,26 @@ private function list_group_uniquemember($dn, $uniquemembers, $recurse = true) { - $this->_debug("Called _list_group_uniquemember(" . $dn . ")", $entry); - - // Use the member attributes to return an array of member ldap objects - // NOTE that the member attribute is supposed to contain a DN - $group_members = array(); - if (empty($uniquemembers)) { - return $group_members; - } + $this->_debug("Called list_group_uniquemember(" . $dn . ")", $entry); $uniquemembers = (array)($uniquemembers); + $group_members = array(); - if (is_string($uniquemembers)) { - $this->_debug("uniquemember for entry is not an array"); - $uniquemembers = (array)($uniquemembers); - } + // remove possible 'count' item + unset($uniquemembers['count']); foreach ($uniquemembers as $member) { - $member_entry = $this->_read($member, '(objectclass=*)'); + $member_entry = $this->get_entry($member, array('member', 'uniquemember', 'memberurl', 'objectclass')); if (empty($member_entry)) { continue; } - $group_members[$member] = array_pop($member_entry); + $group_members[$member] = $member; if ($recurse) { // Nested groups - $group_group_members = $this->_list_group_members($member, $member_entry); + $group_group_members = $this->list_group_members($member, $member_entry); if ($group_group_members) { $group_members = array_merge($group_group_members, $group_members); } @@ -2124,25 +2102,32 @@ private function list_group_memberurl($dn, $memberurls, $recurse = true) { - $this->_debug("Called _list_group_memberurl(" . $dn . ")"); - - // Use the member attributes to return an array of member ldap objects
View file
kolab-webadmin-3.1.2.tar.gz/lib/kolab_api_service.php -> kolab-webadmin-3.1.3.tar.gz/lib/kolab_api_service.php
Changed
@@ -57,41 +57,44 @@ * * @param string $object_name Name of the object (user, group, etc.) * @param int $type_id User type identifier - * @param bool $required Throws exception on empty ID * @param string $key_name Reference to a variable which will be set to type key * * @return array User type attributes */ - protected function object_type_attributes($object_name, $type_id, $required = true, &$key_name = null) + protected function object_type_attributes($object_name, $type_id, &$key_name = null) { if (!$object_name || !in_array($object_name, $this->supported_types)) { return array(); } - if (empty($type_id)) { - if ($required) { - throw new Exception($this->controller->translate('api.notypeid'), 34); - } - - return array(); + // get list of object types + if ($object_name == 'domain') { + $object_types = array( + '1' => array( + 'key' => 'default', + 'attributes' => kolab_api_service_domain_types::$DEFAULT_TYPE_ATTRS, + ), + ); + $object_types['1']['attributes']['form_fields']['aci'] = array( + 'type' => 'list', + 'optional' => true, + ); + } + else { + $object_types = $this->object_types($object_name); } - $object_types = $this->object_types($object_name); - - if (empty($object_types[$type_id])) { - if ($object_name == 'domain') { - $result = kolab_api_service_domain_types::$DEFAULT_TYPE_ATTRS; - $result['form_fields']['aci'] = array( - 'type' => 'list', - 'optional' => true, - ); - - return $result; + if (empty($type_id)) { + if (count($object_types) == 1) { + $type_id = key($object_types); } else { - throw new Exception($this->controller->translate('api.invalidtypeid'), 35); + throw new Exception($this->controller->translate('api.notypeid'), 34); } } + else if ($type_id && empty($object_types[$type_id])) { + throw new Exception($this->controller->translate('api.invalidtypeid'), 35); + } $key_name = $object_types[$type_id]['key'];
View file
kolab-webadmin-3.1.2.tar.gz/lib/kolab_client_task.php -> kolab-webadmin-3.1.3.tar.gz/lib/kolab_client_task.php
Changed
@@ -1369,7 +1369,7 @@ $this->output->set_env('autocomplete_min_length', $ac_min_len); $this->output->add_translation('form.required.empty', 'form.maxcount.exceeded', $name . '.add.success', $name . '.edit.success', $name . '.delete.success', - 'add', 'edit', 'delete'); + $name . '.delete.confirm', 'add', 'edit', 'delete'); return $form; }
View file
kolab-webadmin-3.1.2.tar.gz/lib/locale/en_US.php -> kolab-webadmin-3.1.3.tar.gz/lib/locale/en_US.php
Changed
@@ -48,6 +48,7 @@ $LANG['domain.add'] = 'Add Domain'; $LANG['domain.add.success'] = 'Domain created successfully.'; $LANG['domain.associateddomain'] = 'Domain name(s)'; +$LANG['domain.delete.confirm'] = 'Are you sure, you want to delete this domain?'; $LANG['domain.delete.success'] = 'Domain deleted successfully.'; $LANG['domain.edit'] = 'Edit domain'; $LANG['domain.edit.success'] = 'Domain updated successfully.'; @@ -69,6 +70,7 @@ $LANG['group.add'] = 'Add Group'; $LANG['group.add.success'] = 'Group created successfully.'; $LANG['group.cn'] = 'Common name'; +$LANG['group.delete.confirm'] = 'Are you sure, you want to delete this group?'; $LANG['group.delete.success'] = 'Group deleted successfully.'; $LANG['group.edit.success'] = 'Group updated successfully.'; $LANG['group.gidnumber'] = 'Primary group number'; @@ -128,6 +130,7 @@ $LANG['resource.add.success'] = 'Resource created successfully.'; $LANG['resource.cn'] = 'Name'; $LANG['resource.delete'] = 'Delete Resource'; +$LANG['resource.delete.confirm'] = 'Are you sure, you want to delete this resource?'; $LANG['resource.delete.success'] = 'Resource deleted successfully.'; $LANG['resource.edit'] = 'Edit Resource'; $LANG['resource.edit.success'] = 'Resource updated successfully.'; @@ -144,6 +147,7 @@ $LANG['role.add'] = 'Add Role'; $LANG['role.add.success'] = 'Role created successfully.'; $LANG['role.cn'] = 'Role Name'; +$LANG['role.delete.confirm'] = 'Are you sure, you want to delete this role?'; $LANG['role.delete.success'] = 'Role deleted successfully.'; $LANG['role.description'] = 'Role Description'; $LANG['role.edit.success'] = 'Role updated successfully.'; @@ -178,6 +182,7 @@ $LANG['sharedfolder.add.success'] = 'Shared folder created successfully.'; $LANG['sharedfolder.alias'] = 'Secondary Email Address(es)'; $LANG['sharedfolder.cn'] = 'Folder Name'; +$LANG['sharedfolder.delete.confirm'] = 'Are you sure, you want to delete this shared folder?'; $LANG['sharedfolder.delete.success'] = 'Shared folder deleted successfully.'; $LANG['sharedfolder.edit'] = 'Edit Shared Folder'; $LANG['sharedfolder.edit.success'] = 'Shared folder updated successfully.'; @@ -212,6 +217,7 @@ $LANG['type.add.success'] = 'Object type created successfully.'; $LANG['type.attributes'] = 'Attributes'; $LANG['type.description'] = 'Description'; +$LANG['type.delete.confirm'] = 'Are you sure, you want to delete this object type?'; $LANG['type.delete.success'] = 'Object type deleted successfully.'; $LANG['type.domain'] = 'Domain'; $LANG['type.edit.success'] = 'Object type updated successfully.'; @@ -259,6 +265,7 @@ $LANG['user.contact_info'] = 'Contact Information'; $LANG['user.country'] = 'Country'; $LANG['user.country.desc'] = '2 letter code from ISO 3166-1'; +$LANG['user.delete.confirm'] = 'Are you sure, you want to delete this user?'; $LANG['user.delete.success'] = 'User deleted successfully.'; $LANG['user.displayname'] = 'Display name'; $LANG['user.edit.success'] = 'User updated successfully.';
View file
kolab-webadmin-3.1.2.tar.gz/public_html/js/kolab_admin.js -> kolab-webadmin-3.1.3.tar.gz/public_html/js/kolab_admin.js
Changed
@@ -1405,8 +1405,7 @@ this.domain_delete = function(id) { - this.set_busy(true, 'deleting'); - this.api_post('domain.delete', {'id': id}, 'domain_delete_response'); + this.delete_handler(id, 'domain'); }; this.domain_save = function(reload, section) @@ -1458,8 +1457,7 @@ this.user_delete = function(id) { - this.set_busy(true, 'deleting'); - this.api_post('user.delete', {'id': id}, 'user_delete_response'); + this.delete_handler(id, 'user'); }; this.user_save = function(reload, section) @@ -1519,8 +1517,7 @@ this.group_delete = function(id) { - this.set_busy(true, 'deleting'); - this.api_post('group.delete', {'id': id}, 'group_delete_response'); + this.delete_handler(id, 'group'); }; this.group_save = function(reload, section) @@ -1572,8 +1569,7 @@ this.resource_delete = function(id) { - this.set_busy(true, 'deleting'); - this.api_post('resource.delete', {'id': id}, 'resource_delete_response'); + this.delete_handler(id, 'resource'); }; this.resource_save = function(reload, section) @@ -1625,8 +1621,7 @@ this.role_delete = function(id) { - this.set_busy(true, 'deleting'); - this.api_post('role.delete', {'id': id}, 'role_delete_response'); + this.delete_handler(id, 'role'); }; this.role_save = function(reload, section) @@ -1678,8 +1673,7 @@ this.sharedfolder_delete = function(id) { - this.set_busy(true, 'deleting'); - this.api_post('sharedfolder.delete', {'id': id}, 'sharedfolder_delete_response'); + this.delete_handler(id, 'sharedfolder'); }; this.sharedfolder_save = function(reload, section) @@ -1744,6 +1738,9 @@ this.type_delete = function(id) { + if (!confirm(this.t('type.delete.confirm'))) + return; + this.set_busy(true, 'deleting'); this.api_post('type.delete', this.type_id_parse(id), 'type_delete_response'); }; @@ -1896,6 +1893,16 @@ this.http_post(type + '.list', props); }; + // universal object delete handler + this.delete_handler = function(id, type) + { + if (!confirm(this.t(type + '.delete.confirm'))) + return; + + this.set_busy(true, 'deleting'); + this.api_post(type + '.delete', {'id': id}, type + '_delete_response'); + }; + // Parses object type identifier this.type_id_parse = function(id) {
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.