X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Finclude%2Fphp_setup.inc;h=aa69f7eaa6536ea0242600fffff5099a7d8ff198;hb=53553834328f43ffd06c805c940b18738349ab94;hp=a6790334c5e05df572925738c060e9d46d20c2e7;hpb=1d023cf88eb787c06ca928914caff5e28c29500d;p=gosa.git diff --git a/gosa-core/include/php_setup.inc b/gosa-core/include/php_setup.inc index a6790334c..aa69f7eaa 100644 --- a/gosa-core/include/php_setup.inc +++ b/gosa-core/include/php_setup.inc @@ -26,36 +26,41 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline) { global $error_collector,$config, $error_collector_mailto; + // To avoid recursion - restore original error handler. + restore_error_handler(); + /* Return if error reporting is set to zero */ if (error_reporting() == 0){ + set_error_handler('gosaRaiseError', E_WARNING | E_NOTICE | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_STRICT) ; return; } /* Workaround for buggy imap_open error outputs */ if (preg_match('/imap_open/', $errstr)){ + set_error_handler('gosaRaiseError', E_WARNING | E_NOTICE | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_STRICT) ; return; } /* Hide ldap size limit messages */ if (preg_match('/ldap_error/', $errstr)){ if (preg_match('/sizelimit/', $errstr)){ + set_error_handler('gosaRaiseError', E_WARNING | E_NOTICE | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_STRICT) ; return; } } /* 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']))){ + if(isset($config->data) && $config->get_cfg_value("displayerrors") != "true"){ - - /* Write to syslog */ - if(class_exists("log") && !preg_match("/No such object/",$errstr)){ - new log("view","error","",array(),"PHP error: $errstr ($errfile, line $errline)"); - } - return; + /* Write to syslog */ + if(class_exists("log") && !preg_match("/No such object/",$errstr)){ + new log("view","error","",array(),"PHP error: $errstr ($errfile, line $errline)"); } + + set_error_handler('gosaRaiseError', E_WARNING | E_NOTICE | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_STRICT) ; + return; } - + /* Send all errors to logging class, except "Ldap : No such object" messages*/ if(class_exists("log") && !preg_match("/No such object/",$errstr)){ new log("debug","all",$errfile,array(),"Type:".$errno.", Message:".$errstr.", File:".$errfile.", Line: ".$errline); @@ -101,7 +106,7 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline) - @@ -125,7 +130,7 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline) $error_collector_mailto .= prepare4mailbody("=== Trace ==="); /* Generate trace history */ - for ($index= 0; $index"; flush(); @@ -268,14 +274,15 @@ error_reporting (E_ALL | E_STRICT); /* Register error handler */ $error_collector= ""; $error_collector_mailto= ""; -set_error_handler('gosaRaiseError'); + +set_error_handler('gosaRaiseError', E_WARNING | E_NOTICE | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_STRICT) ; $variables_order= "ES"; ini_set("register_globals",0); ini_set("track_vars",1); ini_set("display_errors",1); ini_set("report_memleaks",1); -ini_set("include_path",".:$BASE_DIR/include:$BASE_DIR/include/utils/excel"); +ini_set("include_path",".:$BASE_DIR/include:$BASE_DIR/include/utils/excel:/usr/share/php"); /* Do smarty setup */ require("smarty/Smarty.class.php"); @@ -284,6 +291,9 @@ $smarty->template_dir = $BASE_DIR.'/ihtml/'; $smarty->caching= false; $smarty->php_handling= SMARTY_PHP_REMOVE; +/* Global FPDF define */ +define('FPDF_FONTPATH', '/usr/share/php/fpdf/font/'); + // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?>