X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Finclude%2Fphp_setup.inc;h=954cabbfe1b502badf9057dc1458bdb79dceaf9c;hb=1069c3be6d2a5b9cf96c8decbc6bb95d42da32cc;hp=2901f8d2a6675e6a9109bcd967bc43111b21ddc3;hpb=894aa86d1d4d57416d43052ea7b781ff680f03c9;p=gosa.git diff --git a/gosa-core/include/php_setup.inc b/gosa-core/include/php_setup.inc index 2901f8d2a..954cabbfe 100644 --- a/gosa-core/include/php_setup.inc +++ b/gosa-core/include/php_setup.inc @@ -1,61 +1,69 @@ 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); @@ -66,12 +74,16 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline) /* Mailto body header */ if(function_exists("prepare4mailbody")){ + $version= "unknown"; + if(function_exists("get_gosa_version")){ + $version= get_gosa_version(); + } $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(). + "\nGOsa Version: $version". "\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 ?". @@ -79,31 +91,25 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline) "*** PHP error information ***\n\n"); } - if (isset($_SESSION['js']) && $_SESSION['js']==FALSE){ + if (session::is_set('js') && session::get('js')==FALSE){ $error_collector= "
- |
-
-
- ![]() |
- - + | ".image('images/toolbar-warning.png')." | +"._("Generating this page caused the PHP interpreter to raise some errors!")." | ++ + ".image('images/mailto.png')." "._("Send bugreport")." + + | ++ |