From e5b1d96367b02ea623b55feeb0747b6ad95a635e Mon Sep 17 00:00:00 2001 From: cajus Date: Fri, 20 May 2005 09:47:27 +0000 Subject: [PATCH] * Fixed ldap error assignement * Added workaround for error handler in PHP5 git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@272 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_ldap.inc | 12 ++++++------ include/functions.inc | 18 ++++++++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/include/class_ldap.inc b/include/class_ldap.inc index f3650a55e..74020d3c9 100644 --- a/include/class_ldap.inc +++ b/include/class_ldap.inc @@ -152,7 +152,7 @@ class LDAP{ if ($basedn == "") $basedn = $this->basedn; $this->sr = @ldap_list($this->cid, $basedn, $filter); - $ldap->error = @ldap_error($this->cid); + $this->error = @ldap_error($this->cid); $this->resetResult(); $this->hasres=true; return($this->sr); @@ -208,7 +208,7 @@ class LDAP{ $att= @ldap_get_attributes($this->cid, $this->re); $att['dn']= @ldap_get_dn($this->cid, $this->re); } - $ldap->error = @ldap_error($this->cid); + $this->error = @ldap_error($this->cid); if (!isset($att)){ $att= array(); } @@ -249,7 +249,7 @@ class LDAP{ { $rv = @ldap_get_dn($this->cid, $this->re); - $ldap->error = @ldap_error($this->cid); + $this->error = @ldap_error($this->cid); $rv= preg_replace("/[ ]*,[ ]*/", ",", $rv); return($rv); } @@ -268,7 +268,7 @@ class LDAP{ if($this->hascon){ if($this->hasres){ $rv = @ldap_count_entries($this->cid, $this->sr); - $ldap->error = @ldap_error($this->cid); + $this->error = @ldap_error($this->cid); return($rv); }else{ $this->error = "Perform a Fetch with no Search"; @@ -288,7 +288,7 @@ class LDAP{ $dn = $this->basedn; $r = @ldap_mod_del($this->cid, $dn, $attrs); - $ldap->error = @ldap_error($this->cid); + $this->error = @ldap_error($this->cid); return($r); }else{ $this->error = "Could not connect to LDAP server"; @@ -304,7 +304,7 @@ class LDAP{ $dn = $this->basedn; $r = @ldap_mod_replace($this->cid, $dn, $attrs); - $ldap->error = @ldap_error($this->cid); + $this->error = @ldap_error($this->cid); return($r); }else{ $this->error = "Could not connect to LDAP server"; diff --git a/include/functions.inc b/include/functions.inc index 58d618b8b..8323cbfe1 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -1515,21 +1515,27 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline) $svn_path = '$HeadURL$'; - if (!preg_match('%/gosa/trunk/%', $svn_path)){ - gosa_log ("PHP error: $errstr ($errfile, line $errline)"); - return; - } - /* FIXME: workaround for buggy imap_open */ if (preg_match('/imap_open/', $errstr)){ return; } + /* FIXME: workaround for PHP5 */ + if (preg_match('/var: Deprecated./', $errstr)){ + return; + } + + + if (!preg_match('%/gosa/trunk/%', $svn_path)){ + gosa_log ("PHP error: $errstr ($errfile, line $errline)"); + return; + } + /* Extract traceback data */ $trace= debug_backtrace(); /* Create error header */ - $error_collector.= ""; + $error_collector.= "

"._("PHP error")."

\"$errstr\"
"; /* Generate trace history */ for ($index= 1; $index

"._("PHP error")." \"$errstr\"