Commit 018c7e5c authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Merge branch '6105-add-option-ldif-wrap-no-in-class_ldap-inc' into '1.4-dev'

Resolve "Add option ldif-wrap=no in class_ldap.inc"

See merge request fusiondirectory/fd!803
Showing with 10 additions and 3 deletions
+10 -3
...@@ -1114,10 +1114,17 @@ class LDAP ...@@ -1114,10 +1114,17 @@ class LDAP
* \param string $scope 'base', 'sub' .. see manpage for 'ldapmodify' for details. * \param string $scope 'base', 'sub' .. see manpage for 'ldapmodify' for details.
* *
* \param int $limit Limits the result. * \param int $limit Limits the result.
*
* \param ?int $wrap Wraps line around this length (0 to disable).
*/ */
function generateLdif (string $dn, string $filter = '(objectClass=*)', string $scope = 'sub', int $limit = 0): string function generateLdif (string $dn, string $filter = '(objectClass=*)', string $scope = 'sub', int $limit = 0, int $wrap = NULL): string
{ {
$limit = (($limit == 0) ? '' : ' -z '.$limit); $limit = (($limit == 0) ? '' : ' -z '.$limit);
if ($wrap === NULL) {
$wrap = '';
} else {
$wrap = ' -o ldif-wrap='.($wrap ? $wrap : 'no');
}
// Check scope values // Check scope values
$scope = trim($scope); $scope = trim($scope);
...@@ -1133,7 +1140,7 @@ class LDAP ...@@ -1133,7 +1140,7 @@ class LDAP
$admin = escapeshellarg($this->binddn); $admin = escapeshellarg($this->binddn);
$filter = escapeshellarg($filter); $filter = escapeshellarg($filter);
$cmd = 'ldapsearch'.($this->tls ? ' -ZZ' : '')." -x -LLLL -D {$admin} {$filter} {$limit} {$scope} -H {$host} -b {$dn} -w {$pwd} "; $cmd = 'ldapsearch'.($this->tls ? ' -ZZ' : '')." -x -LLLL -D {$admin} {$filter} {$limit} {$wrap} {$scope} -H {$host} -b {$dn} -w {$pwd} ";
// Create list of process pipes // Create list of process pipes
$descriptorspec = [ $descriptorspec = [
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment