X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fphp_setup.inc;h=ec13459435faafcdfcb6492c3f538883d69db13b;hb=a2227f5221dbb0f33f4bd21d785569f5abb1225b;hp=08f75dfc1360279ca3ebdbc03822d41e030631f7;hpb=fcc078a3131b821697c17c5a3e912e210f75d715;p=gosa.git
diff --git a/include/php_setup.inc b/include/php_setup.inc
index 08f75dfc1..ec1345943 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,$config;
+
+ if(@class_exists("log")){
+ new log("debug","all",$errfile,array(),"Type:".$errno.", Message:".$errstr.", File:".$errfile.", Line: ".$errline);
+ }
/* Return if error reporting is set to zero */
if (error_reporting() == 0){
@@ -53,12 +57,22 @@ 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 */
+ new log("view","error","",array(),"PHP error: $errstr ($errfile, line $errline)");
+ return;
+ }
+ }
+
+
/* Create header as needed */
if ($error_collector == ""){
- if ($_SESSION['js']==FALSE){
+ if (isset($_SESSION['js']) && $_SESSION['js']==FALSE){
$error_collector= "
";
} else {
- $error_collector= "
"._("Generating this page caused the PHP interpreter to raise some errors!")." | |
";
+ $error_collector= "
"._("Generating this page caused the PHP interpreter to raise some errors!")." | |
";
}
}
@@ -70,7 +84,7 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline)
$trace= debug_backtrace();
/* Generate trace history */
- for ($index= 1; $index"._("Trace")."[$index]: $loc | ";
$error_collector.= ""._("File").": $file ("._('Line')." $line) | "._("Type").": $type | ";
@@ -115,9 +145,6 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline)
/* Close error table */
$error_collector.= "";
- /* Write to syslog */
- gosa_log ("PHP error: $errstr ($errfile, line $errline)");
-
/* Flush in case of fatal errors */
if (preg_match('/^fatal/i', $errstr)){
echo $error_collector."
";
@@ -155,5 +182,10 @@ $smarty->template_dir = $BASE_DIR.'/ihtml/';
$smarty->caching= false;
$smarty->php_handling= SMARTY_PHP_REMOVE;
+/* Set timezone */
+if (function_exists("date_default_timezone_set")){
+ date_default_timezone_set("GMT");
+}
+
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>