From: hickert Date: Wed, 20 Oct 2010 09:03:44 +0000 (+0000) Subject: Added error reporting to ldap::exportLdif X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=bd1132c0c35247d55cf49c3d97dae02ca8cb436d;p=gosa.git Added error reporting to ldap::exportLdif git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20097 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_ldap.inc b/gosa-core/include/class_ldap.inc index d531476cb..9c8a3996f 100644 --- a/gosa-core/include/class_ldap.inc +++ b/gosa-core/include/class_ldap.inc @@ -973,6 +973,13 @@ class LDAP } $scope = (!empty($scope))?' -s '.$scope: ''; + // First check if we are able to call 'ldapsearch' on the command line. + $check = shell_exec('which ldapsearch'); + if(empty($check)){ + $this->error = sprintf(_("Missing command line programm '%s'!"), 'ldapsearch'); + return(NULL); + } + // Prepare parameters to be valid for shell execution $dn = escapeshellarg($dn); $pwd = $this->bindpw; @@ -1002,7 +1009,8 @@ class LDAP // Close the process and check its return value if(proc_close($process) != 0){ - trigger_error($err); + $this->error = $err; + return(NULL); } } return($res);