diff --git a/lib/Net/LDAP3.php b/lib/Net/LDAP3.php index abfea8f95d5cef5c4e2bea592374bde19ae05cc1..d4c88ce786205a5fbc7a912f076526e62fb7ca7d 100644 --- a/lib/Net/LDAP3.php +++ b/lib/Net/LDAP3.php @@ -785,39 +785,24 @@ class Net_LDAP3 } $output = array(); + $command = array( + $moz_ldapsearch, + '-x', + '-h', + preg_replace('|^[a-z]+://|i', '', $this->_current_host), + '-b', + escapeshellarg($entry_dn), + '-s', + 'base', + '-D', + escapeshellarg($this->_current_bind_dn), + '-w', + escapeshellarg($this->_current_bind_pw) + ); - if ($moz_ldapsearch == "/usr/bin/ldapsearch") { - $command = Array( - $moz_ldapsearch, - '-x', - '-h', - preg_replace('|^[a-z]+://|i', '', $this->_current_host), - '-b', - escapeshellarg($entry_dn), - '-s', - 'base', - '-D', - escapeshellarg($this->_current_bind_dn), - '-w', - escapeshellarg($this->_current_bind_pw) - ); - } else { - $command = Array( - $moz_ldapsearch, - '-x', - '-h', - preg_replace('|^[a-z]+://|i', '', $this->_current_host), - '-p', - $this->config_get('port', 389), - '-b', - escapeshellarg($entry_dn), - '-s', - 'base', - '-D', - escapeshellarg($this->_current_bind_dn), - '-w', - escapeshellarg($this->_current_bind_pw) - ); + if ($moz_ldapsearch != "/usr/bin/ldapsearch") { + $command[] = '-p'; + $command[] = $this->config_get('port', 389); } if ($this->vendor_name() == "Oracle Corporation") { @@ -2496,7 +2481,7 @@ class Net_LDAP3 switch ($_acl_components[1]) { case "entryLevel": - $attributes['entrylevelrights'] = Array(); + $attributes['entrylevelrights'] = array(); $_acl_value = explode(',', $_acl_value); foreach ($_acl_value as $right) { @@ -2509,7 +2494,7 @@ class Net_LDAP3 break; case "attributeLevel": - $attributes['attributelevelrights'][$_acl_components[2]] = Array(); + $attributes['attributelevelrights'][$_acl_components[2]] = array(); $_acl_value = explode(',', $_acl_value); foreach ($_acl_value as $right) {