X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fphp_setup.inc;h=8260e9593c8f680621dc26a0e333be6c6b6c03b2;hb=a592ccbe84332d113bcb4f5866cd9786f4aa59dc;hp=c6769741cf2e655bdff4ada2bd1594980f1d9443;hpb=385c34aae7951f24c79bdd4d26812677a1f38ab6;p=gosa.git diff --git a/include/php_setup.inc b/include/php_setup.inc index c6769741c..8260e9593 100644 --- a/include/php_setup.inc +++ b/include/php_setup.inc @@ -20,7 +20,11 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline) { - global $error_collector; + global $error_collector,$error_collector_mailto,$config; + + if(function_exists("gosa_log")){ + gosa_log($errno." ".$errstr." ".$errfile." ".$errline); + } /* Return if error reporting is set to zero */ if (error_reporting() == 0){ @@ -53,24 +57,92 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline) } } + if((isset($config->data))){ + if((isset($config->data['MAIN']['DISPLAYERRORS']))&&(!preg_match("/^true$/i",$config->data['MAIN']['DISPLAYERRORS']))){ + + /* Write to syslog */ + gosa_log ("PHP error: $errstr ($errfile, line $errline)"); + return; + } + } + + /* Create header as needed */ if ($error_collector == ""){ - if ($_SESSION['js']==FALSE){ + + /* Mailto body header */ + if(function_exists("prepare4mailbody")){ + $error_collector_mailto .=prepare4mailbody( + "Oups. Seems like you've catched some kind of bug inside GOsa/PHP. You may want to help ". + "us to improve the software stability. If so, please provide some more information below.". + "\n\n". + "*** GOsa bug report ***". + "\nGOsa Version: ".get_gosa_version(). + "\nDate: ".date("d.m.Y"). + "\nTime: ".date("H:i:s"). + "\nUser-Agent: ".$_SERVER['HTTP_USER_AGENT']." ". + "(Javascript is ".( (isset($_SESSION['js']) && $_SESSION['js']==FALSE) ? "inactive" : "active" ).")". + "\n\n". + "Please describe what you did to produce this error as detailed as possible. Can you ". + "reproduce this bug using the demo on http://www.gosa-project.org ?". + "\n\n". + "*** PHP runtime information ***". + "\nPHP Version: ".phpversion(). + "\nRunning on: ".php_uname(). + "\nLoaded Extensions: ".print_array(get_loaded_extensions()). + "\nLDAP Module Version: ".get_module_setting('ldap','RCS Version'). + "\n\n". + "*** PHP error information ***\n\n"); + } + + if (isset($_SESSION['js']) && $_SESSION['js']==FALSE){ $error_collector= "
"; } else { - $error_collector= "
\"\" "._("Generating this page caused the PHP interpreter to raise some errors!")."