X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Finclude%2Fphp_setup.inc;h=2024321f3e6371307b6ba27898bc10026bc9103b;hb=198fc11cacca32ca2c0dc33505bde39a38b999e6;hp=a41373dc0c9abcee9623c7635d98214cb000837d;hpb=5c928f71fecc58e0f86e62f13d92fec0bdd34ea9;p=gosa.git diff --git a/gosa-core/include/php_setup.inc b/gosa-core/include/php_setup.inc index a41373dc0..2024321f3 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("core","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")." + + | ++ |