diff --git a/lib/Net/LDAP3.php b/lib/Net/LDAP3.php index 0056b102edbec1e620028989448d1963f0c9fba3..ac4fa59933aace320ba37538639f2a11f31a7785 100644 --- a/lib/Net/LDAP3.php +++ b/lib/Net/LDAP3.php @@ -785,20 +785,40 @@ class Net_LDAP3 } $output = array(); - $command = Array( - $moz_ldapsearch, - '-x', - '-h', - $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', + $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 ($this->vendor_name() == "Oracle Corporation") { // For Oracle DSEE