index 2bd27b0160650e3836e9ed121daa9d61035fb91e..82289820300c81a961f69b28b8b35a63711b7d59 100644 (file)
{
global $error_collector,$config, $error_collector_mailto;
- /* Return if error reporting is set to zero */
+ // To avoid recursion - restore original error handler.
+ restore_error_handler();
+
+ /* Return if error reporting is set to zero
+ * Also exclude statements prefixed with @ - Comment out the block below to see suppressed errors.
+ * e.g. @call_function_but_hide_errors()
+ */
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) && $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);
"*** PHP error information ***\n\n");
}
- if (session::global_is_set('js') && session::global_get('js')==FALSE){
+ if (session::is_set('js') && session::get('js')==FALSE){
$error_collector= "<div>";
} else {
$error_collector= "
</a>
</td>
<td align=right>
- <button onClick='toggle(\"errorbox\")'>".
+ <button onClick=\"$('errorbox').toggle();\">".
_("Toggle information")."
</button>
</td>
</tr>
</table>
- <div id='errorbox' style='position:absolute; z-index:150; visibility: hidden'>";
+ <div id='errorbox' style='position:absolute; z-index:150; display: none;'>";
}
}
$error_collector.= "</table>";
/* Flush in case of fatal errors */
+ set_error_handler('gosaRaiseError', E_WARNING | E_NOTICE | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_STRICT) ;
if (preg_match('/^fatal/i', $errstr)){
echo $error_collector."</div>";
flush();
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");
$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:
?>