From 25ce39453c48a2f61f588d9fe991a85fc16f3137 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 23 Nov 2007 11:22:16 +0000 Subject: [PATCH] Skip logging of 'No such object' ldap messages. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7868 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/functions.inc | 6 ++++-- include/php_setup.inc | 16 +++++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/include/functions.inc b/include/functions.inc index d628de47a..57debec9e 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -1236,8 +1236,10 @@ function show_ldap_error($message, $addon= "") msg_dialog::display(_("LDAP error:"),$message,ERROR_DIALOG); #print_red (_("LDAP error:")." $message"); } else { - msg_dialog::display(sprintf(_("LDAP error in plugin '%s':"),"".$addon.""),$message,ERROR_DIALOG); - #print_red ("$addon

"._("LDAP error:")." $message"); + if(!preg_match("/No such object/i",$message)){ + msg_dialog::display(sprintf(_("LDAP error in plugin '%s':"),"".$addon.""),$message,ERROR_DIALOG); +#print_red ("$addon

"._("LDAP error:")." $message"); + } } return TRUE; } else { diff --git a/include/php_setup.inc b/include/php_setup.inc index 139f195d9..a9afd8377 100644 --- a/include/php_setup.inc +++ b/include/php_setup.inc @@ -22,10 +22,6 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline) { global $error_collector,$config, $error_collector_mailto; - if(@class_exists("log")){ - new log("debug","all",$errfile,array(),"Type:".$errno.", Message:".$errstr.", File:".$errfile.", Line: ".$errline); - } - if(function_exists("gosa_log")){ gosa_log($errno." ".$errstr." ".$errfile." ".$errline); } @@ -47,15 +43,25 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline) } } + /* Error messages are hidden in GOsa, so we only send them to the logging class and abort here */ if((isset($config->data))){ if((isset($config->data['MAIN']['DISPLAYERRORS']))&&(!preg_match("/^true$/i",$config->data['MAIN']['DISPLAYERRORS']))){ + /* Write to syslog */ - new log("view","error","",array(),"PHP error: $errstr ($errfile, line $errline)"); + if(!preg_match("/No such object/",$message)){ + new log("view","error","",array(),"PHP error: $errstr ($errfile, line $errline)"); + } return; } } + + /* Send all errors to logging class, except "Ldap : No such object" messages*/ + if(@class_exists("log") && !preg_match("/No such object/",$message)){ + new log("debug","all",$errfile,array(),"Type:".$errno.", Message:".$errstr.", File:".$errfile.", Line: ".$errline); + } + /* Create header as needed */ if ($error_collector == ""){ -- 2.30.2