Projects
Kolab:16
php-kolab-net-ldap3
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 6
View file
php-kolab-net-ldap3.spec
Changed
@@ -24,7 +24,7 @@ %else Name: php-kolab-net-ldap3 %endif -Version: 1.0.7 +Version: 1.1.0 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 +* Wed Jun 5 2019 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 1.1.0-1 +- Release of version 1.1.0 + * Wed Jun 20 2018 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.0.7-1 - Release of version 1.0.7
View file
debian.changelog
Changed
@@ -1,3 +1,9 @@ +php-net-ldap3 (1.1.0-1~kolab1) unstable; urgency=low + + * Release version 1.1.0 + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Wed, 5 Jun 2019 15:27:46 +0100 + php-net-ldap3 (1.0.7-1~kolab1) unstable; urgency=low * Release version 1.0.7
View file
pear-Net-LDAP3-1.0.7.tar.gz/composer.json -> pear-Net-LDAP3-1.1.0.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.6", + "version": "1.0.7", "keywords": ["pear", "ldap", "vlv"], "homepage": "http://git.kolab.org/pear/Net_LDAP3/", "license": "GPL-3.0+",
View file
pear-Net-LDAP3-1.0.7.tar.gz/lib/Net/LDAP3.php -> pear-Net-LDAP3-1.1.0.tar.gz/lib/Net/LDAP3.php
Changed
@@ -41,6 +41,11 @@ */ class Net_LDAP3 { + const CONTROL_EFFECTIVE_RIGHTS = '1.3.6.1.4.1.42.2.27.9.5.2'; + const CONTROL_SORT_REQUEST = '1.2.840.113556.1.4.473'; + const CONTROL_VLV_REQUEST = '2.16.840.1.113730.3.4.9'; + const CONTROL_VLV_RESPONSE = '2.16.840.1.113730.3.4.10'; + public $conn; public $vlv_active = false; @@ -83,8 +88,9 @@ * 'root_dn' => 'dc=example,dc=org', */ protected $config = array( - 'sizelimit' => 0, - 'timelimit' => 0, + 'sizelimit' => 0, + 'timelimit' => 0, + 'config_root_dn' => 'cn=config', ); protected $debug_level = false; @@ -113,32 +119,29 @@ protected $_current_bind_dn; protected $_current_bind_pw; protected $_current_host; - protected $_supported_control = array(); + protected $_metadata; protected $_vlv_indexes_and_searches; + /** * Constructor * - * @param array $config Configuration parameters that have not already - * been initialized. For configuration parameters - * that have in fact been set, use the config_set() - * method after initialization. + * @param array $config Configuration parameters. After initialization use + * the config_set() method. */ public function __construct($config = array()) { if (!empty($config) && is_array($config)) { foreach ($config as $key => $value) { - if (empty($this->config[$key])) { - $setter = 'config_set_' . $key; - if (method_exists($this, $setter)) { - $this->$setter($value); - } - else if (isset($this->$key)) { - $this->$key = $value; - } - else { - $this->config[$key] = $value; - } + $setter = 'config_set_' . $key; + if (method_exists($this, $setter)) { + $this->$setter($value); + } + else if (isset($this->$key)) { + $this->$key = $value; + } + else { + $this->config[$key] = $value; } } } @@ -688,22 +691,16 @@ return true; } + /** + * Gets effective rights of an ldap entry + */ public function effective_rights($subject) { - $effective_rights_control_oid = "1.3.6.1.4.1.42.2.27.9.5.2"; - - $supported_controls = $this->supported_controls(); - - if (!in_array($effective_rights_control_oid, $supported_controls)) { + if (!in_array(self::CONTROL_EFFECTIVE_RIGHTS, $this->supported_controls())) { $this->_debug("LDAP: No getEffectiveRights control in supportedControls"); return false; } - $attributes = array( - 'attributeLevelRights' => array(), - 'entryLevelRights' => array(), - ); - $entry_dn = $this->entry_dn($subject); if (!$entry_dn) { @@ -720,6 +717,53 @@ $this->_debug("effective_rights for subject $subject resolves to entry dn $entry_dn"); + if (PHP_VERSION_ID >= 70300) { + // Note: This get_entry() have to request all attributes to be working + $result = $this->get_entry($entry_dn, array('*'), array( + array( + 'oid' => self::CONTROL_EFFECTIVE_RIGHTS, + 'value' => 'dn:' . $this->_current_bind_dn, + 'iscritical' => true, + ), + )); + + if (!empty($result)) { + $attributes = array( + 'dn' => $entry_dn, + 'attributeLevelRights' => array(), + 'entryLevelRights' => array(), + ); + + foreach (array('aclRights', 'attributeLevelRights', 'entryLevelRights') as $attr_name) { + if ($attr_value = $result[$attr_name]) { + switch ($attr_name) { + case 'aclRights': + $this->parse_aclrights($attributes, $attr_value); + break; + case 'attributeLevelRights': + $attributes[$attr_name] = $this->parse_attribute_level_rights($attr_value); + break; + case 'entryLevelRights': + $attributes[$attr_name] = $this->parse_entry_level_rights($attr_value); + break; + } + } + } + + $this->_debug("LDAP: Effective rights:" . var_export($attributes, true)); + + return $attributes; + } + + return false; + } + + // Use ldapsearch command + return $this->effective_rights_mozldap($entry_dn); + } + + protected function effective_rights_mozldap($entry_dn) + { $moz_ldapsearch = "/usr/lib64/mozldap/ldapsearch"; if (!is_file($moz_ldapsearch)) { $moz_ldapsearch = "/usr/lib/mozldap/ldapsearch"; @@ -729,7 +773,7 @@ } if (empty($moz_ldapsearch)) { - $this->_error("Mozilla LDAP C SDK binary ldapsearch not found, cannot get effective rights on subject $subject"); + $this->_error("Mozilla LDAP C SDK binary ldapsearch not found, cannot get effective rights"); return null; } @@ -754,33 +798,13 @@ if ($this->vendor_name() == "Oracle Corporation") { // For Oracle DSEE $command[] = "-J"; - $command[] = escapeshellarg( - implode( - ':', - Array( - $effective_rights_control_oid, // OID - 'true' // Criticality - ) - ) - ); + $command[] = escapeshellarg(self::CONTROL_EFFECTIVE_RIGHTS . ':true'); $command[] = "-c"; - $command[] = escapeshellarg( - 'dn:' . $this->_current_bind_dn - ); - + $command[] = escapeshellarg('dn:' . $this->_current_bind_dn); } else { // For 389 DS: $command[] = "-J"; - $command[] = escapeshellarg( - implode( - ':', - Array( - $effective_rights_control_oid, // OID - 'true', // Criticality - 'dn:' . $this->_current_bind_dn // User DN - ) - ) - ); + $command[] = escapeshellarg(self::CONTROL_EFFECTIVE_RIGHTS . ':true:dn:' . $this->_current_bind_dn); } // For both @@ -821,6 +845,12 @@ } }
View file
pear-Net-LDAP3-1.0.7.tar.gz/lib/Net/LDAP3/Result.php -> pear-Net-LDAP3-1.1.0.tar.gz/lib/Net/LDAP3/Result.php
Changed
@@ -42,6 +42,7 @@ protected $base_dn; protected $filter; protected $scope; + protected $result; private $count; private $current;
View file
php-net-ldap3.dsc
Changed
@@ -2,7 +2,7 @@ Source: php-net-ldap3 Binary: php-net-ldap3 Architecture: all -Version: 1.0.7-1~kolab1 +Version: 1.1.0-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.0.7.tar.gz + 00000000000000000000000000000000 0 pear-Net-LDAP3-1.1.0.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
.