Projects
Kolab:Winterfell
php-kolab-net-ldap3
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 10
View file
php-kolab-net-ldap3.spec
Changed
@@ -24,7 +24,7 @@ %else Name: php-kolab-net-ldap3 %endif -Version: 1.1.0 +Version: 1.1.1 Release: 1%{?dist} Summary: Object oriented interface for searching and manipulating LDAP-entries Group: Development/Libraries @@ -71,6 +71,9 @@ %{_datadir}/%{php}/Net/LDAP3/Result.php %changelog +* Fri Aug 23 2019 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.1.1-1 +- Release of version 1.1.1 + * Wed Jun 5 2019 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.1.0-1 - Release of version 1.1.0
View file
debian.changelog
Changed
@@ -1,3 +1,9 @@ +php-net-ldap3 (1.1.1-1~kolab1) unstable; urgency=low + + * Release version 1.1.1 + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Fri, 23 Aug 2019 15:27:46 +0100 + php-net-ldap3 (1.1.0-1~kolab2) unstable; urgency=low * Release version 1.1.0
View file
pear-Net-LDAP3-1.1.0.tar.gz/composer.json -> pear-Net-LDAP3-1.1.1.tar.gz/composer.json
Changed
@@ -2,7 +2,7 @@ "name": "kolab/net_ldap3", "description": "A successor of the PEAR:Net_LDAP2 module providing advanced functionality for accessing LDAP directories", "type": "library", - "version": "1.0.7", + "version": "1.1.0", "keywords": ["pear", "ldap", "vlv"], "homepage": "http://git.kolab.org/pear/Net_LDAP3/", "license": "GPL-3.0+",
View file
pear-Net-LDAP3-1.1.0.tar.gz/lib/Net/LDAP3.php -> pear-Net-LDAP3-1.1.1.tar.gz/lib/Net/LDAP3.php
Changed
@@ -278,20 +278,24 @@ $ldap->connect(); $ldap->bind($this->_current_bind_dn, $this->_current_bind_pw); - $replica_attrs = array( + $attrs = array( + 'nsDS5ReplicaBindDN', + 'nsDS5ReplicaType', + 'nsds5ReplicaPurgeDelay', + 'nsDS5Flags' + ); + + $replica_attrs = $ldap->get_entry_attributes($replica_dn, $attrs); + $replica_attrs = array_merge((array) $replica_attrs, array( 'cn' => 'replica', 'objectclass' => array( 'top', 'nsds5replica', 'extensibleobject', ), - 'nsDS5ReplicaBindDN' => $ldap->get_entry_attribute($replica_dn, "nsDS5ReplicaBindDN"), - 'nsDS5ReplicaId' => ($max_repl_id + $num + 1), - 'nsDS5ReplicaRoot' => $domain_root_dn, - 'nsDS5ReplicaType' => $ldap->get_entry_attribute($replica_dn, "nsDS5ReplicaType"), - 'nsds5ReplicaPurgeDelay' => $ldap->get_entry_attribute($replica_dn, "nsds5ReplicaPurgeDelay"), - 'nsDS5Flags' => $ldap->get_entry_attribute($replica_dn, "nsDS5Flags") - ); + 'nsDS5ReplicaId' => ($max_repl_id + $num + 1), + 'nsDS5ReplicaRoot' => $domain_root_dn, + )); $new_replica_dn = 'cn=replica,cn="' . $domain_root_dn . '",cn=mapping tree,cn=config'; @@ -985,6 +989,14 @@ return $entry[strtolower($attribute)]; } + /** + * Get a specific LDAP entry attributes + * + * @param string $dn Record identifier + * @param array $attributes Attributes to return + * + * @return array Hash array (keys in lower case) + */ public function get_entry_attributes($subject_dn, $attributes) { $result = $this->get_entry($subject_dn, $attributes); @@ -997,7 +1009,8 @@ unset($result['dn']); } - return $result; + // change keys case for historical reasons + return array_change_key_case($result, CASE_LOWER); } /** @@ -1007,7 +1020,7 @@ * @param array $attributes Attributes to return * @param array $controls LDAP Controls * - * @return array Hash array + * @return array Hash array (keys in original case) */ public function get_entry($dn, $attributes = array("*"), $controls = array()) { @@ -1242,7 +1255,7 @@ } } else { - $entry = $this->get_entry($dn, array('member', 'uniquemember', 'memberurl', 'objectclass')); + $entry = $this->get_entry_attributes($dn, array('member', 'uniquemember', 'memberurl', 'objectclass')); if (!$entry) { return array(); @@ -1831,7 +1844,7 @@ $val = self::quote_string($val); $val_filter[] = "(" . $field . $operator . $prefix . $val . $suffix . ")"; } - $filter .= "(|" . implode($val_filter, '') . ")"; + $filter .= "(|" . implode($val_filter) . ")"; } else { $value = self::quote_string($value); @@ -2245,7 +2258,7 @@ // 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->get_entry($member, array('member', 'uniquemember', 'memberurl', 'objectclass')); + $member_entry = $this->get_entry_attributes($member, array('member', 'uniquemember', 'memberurl', 'objectclass')); if (empty($member_entry)) { continue; @@ -2276,7 +2289,7 @@ unset($uniquemembers['count']); foreach ($uniquemembers as $member) { - $member_entry = $this->get_entry($member, array('member', 'uniquemember', 'memberurl', 'objectclass')); + $member_entry = $this->get_entry_attributes($member, array('member', 'uniquemember', 'memberurl', 'objectclass')); if (empty($member_entry)) { continue; @@ -2373,9 +2386,9 @@ } else { $old_parent_dn_components = ldap_explode_dn($olddn, 0); - unset($old_parent_dn_components["count"]); + unset($old_parent_dn_components['count']); $old_rdn = array_shift($old_parent_dn_components); - $old_parent_dn = implode(",", $old_parent_dn_components); + $old_parent_dn = implode(',', $old_parent_dn_components); $subject_dn = $newrdn . ',' . $old_parent_dn; } @@ -2402,7 +2415,7 @@ } else { $this->_debug("S: " . ldap_error($this->conn)); - $this->_warning("LDAP: Failed to replace attributes on $subject_dn: " . json_encode($attributes['replace'])); + $this->_warning("LDAP: Failed to replace attributes on $subject_dn: " . $this->_encode_attrs($attributes['replace'])); return false; } } @@ -2417,7 +2430,7 @@ } else { $this->_debug("S: " . ldap_error($this->conn)); - $this->_warning("LDAP: Failed to delete attributes on $subject_dn: " . json_encode($attributes['del'])); + $this->_warning("LDAP: Failed to delete attributes on $subject_dn: " . $this->_encode_attrs($attributes['del'])); return false; } } @@ -2432,7 +2445,7 @@ } else { $this->_debug("S: " . ldap_error($this->conn)); - $this->_warning("LDAP: Failed to add attributes on $subject_dn: " . json_encode($attributes['add'])); + $this->_warning("LDAP: Failed to add attributes on $subject_dn: " . $this->_encode_attrs($attributes['add'])); return false; } } @@ -2442,10 +2455,9 @@ protected function parse_aclrights(&$attributes, $attribute_value) { - $components = explode(':', $attribute_value); - $_acl_target = array_shift($components); - $_acl_value = trim(implode(':', $components)); - + $components = explode(':', $attribute_value); + $_acl_target = array_shift($components); + $_acl_value = trim(implode(':', $components)); $_acl_components = explode(';', $_acl_target); switch ($_acl_components[1]) { @@ -2616,6 +2628,19 @@ } /** + * Convert attributes array into a string for logging + * Remove plain text passwords + */ + private function _encode_attrs($attributes) + { + if (isset($attributes['userpassword'])) { + $attributes['userpassword'] = '*'; + } + + return json_encode($attributes); + } + + /** * Quotes attribute value string * * @param string $str Attribute value
View file
php-net-ldap3.dsc
Changed
@@ -2,7 +2,7 @@ Source: php-net-ldap3 Binary: php-net-ldap3 Architecture: all -Version: 1.1.0-1~kolab2 +Version: 1.1.1-1~kolab1 Maintainer: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Uploaders: Christoph Wickert <wickert@kolabsys.com> Homepage: http://kolab.org @@ -12,5 +12,5 @@ Package-List: php-net-ldap3 deb php optional Files: - 00000000000000000000000000000000 0 pear-Net-LDAP3-1.1.0.tar.gz + 00000000000000000000000000000000 0 pear-Net-LDAP3-1.1.1.tar.gz 00000000000000000000000000000000 0 debian.tar.gz
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
.