Code

Updated ldap export
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 3 May 2010 06:20:08 +0000 (06:20 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 3 May 2010 06:20:08 +0000 (06:20 +0000)
-Optimized output generation - very large ldif couldn't be downloaded. The resulting files were just empty.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18018 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_ldap.inc

index c34036c32bbfe61ff5a123c3985a403bd468ec91..f6e908a375ea958e1d0618d1095f9762db08d8f9 100644 (file)
@@ -874,9 +874,11 @@ class LDAP{
       $pwd = escapeshellarg($this->bindpw);
       $filter = escapeshellarg($filter);
       $host = escapeshellarg($this->hostname);
-      $cmd = "ldapsearch -x -LLLL -D {$admin} -w {$pwd} {$filter} {$limit} {$scope} -H {$host} -b {$dn} $attrs";
-      exec($cmd, $ret,$code);
-      $res = implode($ret,"\n");
+      $cmd = "ldapsearch -x -LLLL -D {$admin} -w {$pwd} {$filter} {$limit} {$scope} -H {$host} -b {$dn} $attrs ";
+      ob_start();
+      passthru($cmd);
+      $res=ob_get_contents();
+      ob_end_clean();
       return($res);
   }