Code

Updated generateLdif method
[gosa.git] / gosa-core / include / php_setup.inc
index 2a4556f458e883803514914e7100267f821dbc24..c1e7184a548eb1fda0474ae8f27bf46235672077 100644 (file)
@@ -53,7 +53,7 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline)
   }
 
   /* 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"){
+  if(isset($config->data) && $config->get_cfg_value("core","displayErrors") != "true"){
 
     /* Write to syslog */
     if(class_exists("log") && !preg_match("/No such object/",$errstr)){
@@ -69,6 +69,12 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline)
     new log("debug","all",$errfile,array(),"Type:".$errno.", Message:".$errstr.", File:".$errfile.", Line: ".$errline);
   }
 
+  // Log errors in usage DB
+  if(class_exists('stats') && !preg_match("/No such object/",$errstr)){
+      stats::log('error', $class = 'ERROR', $category = array(),  $action = __FUNCTION__, 
+              $amount = 1, $duration = 0, $errno);
+  }
+
   /* Create header as needed */
   if ($error_collector == ""){
 
@@ -101,7 +107,7 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline)
            <td><span>"._("Generating this page caused the PHP interpreter to raise some errors!")."</span></td>
            <td align='right'>
             <a href=\"mailto:gosa-bugs@oss.gonicus.de?subject=GOsa%20bugreport&amp;body=%BUGBODY%\">
-                ".image('images/mailto.png')."&nbsp;"._("Send bugreport")."
+                ".image('images/mailto.png')."&nbsp;"._("Send bug report")."
             </a>
            </td>
            <td align='right'>
@@ -181,7 +187,7 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline)
         $line="";
       }
       $color= ($index&1)?'#404040':'606060';
-      $error_collector.= "<tr style='background-color:$color'><td style='padding-left:20px' width=\"30%\">"._("Trace")."[$index]: $loc</td>";
+      $error_collector.= "<tr style='background-color:$color'><td style='padding-left:20px' width=\"30%\">"._("Traceback")."[$index]: $loc</td>";
       $error_collector.= "<td>"._("File").": $file ("._('Line')." $line)</td><td width=\"10%\">"._("Type").": $type</td></tr>";
       $error_collector.= "<tr style='background-color:$color'><td colspan=3 style='padding-left:20px;'>"._("Arguments").": $args</td></tr>";