summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1fa1c1f)
raw | patch | inline | side by side (parent: 1fa1c1f)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 28 Jun 2007 09:27:36 +0000 (09:27 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 28 Jun 2007 09:27:36 +0000 (09:27 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6725 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/html/index.php b/html/index.php
index b7f1ae83ae8f5e79290d66e38ef82b44a4d5725c..756d503782033ee7c98f871ab4e123477114ae3c 100644 (file)
--- a/html/index.php
+++ b/html/index.php
$smarty->assign("errors", $_SESSION['errors']);
}
if ($error_collector != ""){
- $smarty->assign("php_errors", $error_collector."</div>");
+ $smarty->assign("php_errors", preg_replace("/%BUGBODY%/",$error_collector_mailto,$error_collector)."</div>");
} else {
$smarty->assign("php_errors", "");
}
diff --git a/html/main.php b/html/main.php
index ffb834262b423289f2d2e5e4d0a3d836d0fef5f3..57996e0df2b13922e41eb0acae1d11db3ca4b89d 100644 (file)
--- a/html/main.php
+++ b/html/main.php
if (isset($_SESSION['errors'])){
$smarty->assign("errors", $_SESSION['errors']);
}
+
if ($error_collector != ""){
- $smarty->assign("php_errors", $error_collector."</div>");
+ $smarty->assign("php_errors", preg_replace("/%BUGBODY%/",$error_collector_mailto,$error_collector)."</div>");
} else {
$smarty->assign("php_errors", "");
}
diff --git a/html/setup.php b/html/setup.php
index 5adc78a6d1c500e551b33a84c7405af8f0ebf49a..06164aa001de834fed06b04d9f97f7b4463ab10a 100644 (file)
--- a/html/setup.php
+++ b/html/setup.php
$smarty->assign("bottom", $_SESSION['setup']->get_bottom_html());
if ($error_collector != ""){
- $smarty->assign("php_errors", $error_collector."</div>");
+ $smarty->assign("php_errors", preg_replace("/%BUGBODY%/",$error_collector_mailto,$error_collector)."</div>");
} else {
$smarty->assign("php_errors", "");
}
diff --git a/include/functions.inc b/include/functions.inc
index 544fb6352346c90f38aca7d48f6707628e1adcef..4cac0b7c7580ce08eae29e9f90d9c5742344011c 100644 (file)
--- a/include/functions.inc
+++ b/include/functions.inc
}
+function prepare4mailbody($string)
+{
+ $string = $string;
+
+ $from = array("/\n/" , "/&/" ,"/(\'|\")/");
+ $to = array("%0A" , "%26" ,"");
+
+ $string = preg_replace($from,$to,$string);
+
+ return($string);
+}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
diff --git a/include/php_setup.inc b/include/php_setup.inc
index ebddd810af024e1c61becb511f2a490a52ca3e42..f443562eb5378ada1172bbbf02ee2783e7f0f8ff 100644 (file)
--- a/include/php_setup.inc
+++ b/include/php_setup.inc
function gosaRaiseError($errno, $errstr, $errfile, $errline)
{
- global $error_collector,$config;
+ global $error_collector,$error_collector_mailto,$config;
/* Return if error reporting is set to zero */
if (error_reporting() == 0){
/* Create header as needed */
if ($error_collector == ""){
+
+ /* Mailto body header */
+ $error_collector_mailto .=prepare4mailbody(
+ "GOsa bug report".
+ "\nGOsa Version : ".get_gosa_version().
+ "\nDate : ".date("H:i:s d.m.Y").
+ "\n".
+ "\nTrace : ".
+ "\n");
+
if (isset($_SESSION['js']) && $_SESSION['js']==FALSE){
$error_collector= "<div>";
} else {
- $error_collector= "<table summary=\"\" width=\"100%\" style='background-color:#E0E0E0;border-bottom:1px solid black;z-index:150;'><tr><td><img alt=\"\" align=\"middle\" src='".get_template_path('images/warning.png')."'> <font style='font-size:14px;font-weight:bold'>"._("Generating this page caused the PHP interpreter to raise some errors!")."</font></td><td align=right><button onClick='toggle(\"errorbox\")'>"._("Toggle information")."</button></td></tr></table><div id='errorbox' style='position:absolute; z-index:150; visibility: hidden'>";
+ $error_collector= "
+ <table summary=\"\" width=\"100%\" style='background-color:#E0E0E0;border-bottom:1px solid black;z-index:150;'>
+ <tr>
+ <td>
+ <img alt=\"\" align=\"middle\" src='".get_template_path('images/warning.png')."'>
+ <font style='font-size:14px;font-weight:bold'>".
+ _("Generating this page caused the PHP interpreter to raise some errors!")."
+ </font>
+ </td>
+ <td align=right>
+ <button onClick='toggle(\"errorbox\")'>".
+ _("Toggle information")."
+ </button>
+ <a href=\"mailto:gosa-bugs@oss.gonicus.de?subject=GOsa%20bugreport&body=%BUGBODY%\">
+ <img src='images/mailto.png' title='"._("Send bug report to the GOsa Team")."' class='center'> "._("Send bugreport")."
+ </a>
+ </td>
+ </tr>
+ </table>
+ <div id='errorbox' style='position:absolute; z-index:150; visibility: hidden'>";
}
}
$error_collector.= "<tr style='background-color:$color'><td style='padding-left:20px' width=\"30%\">"._("Trace")."[$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>";
- }
+
+ /* Add trace part to mailto body */
+ $error_collector_mailto .= prepare4mailbody(
+ "\nTrace[".$index."]:".$loc.
+ "\nFile : ".$file.
+ "\nLine : ".$line.
+ "\nType : ".$type.
+ "\n ".$args.
+ "\n");
+ }
}
/* Close error table */
/* Register error handler */
$error_collector= "";
+$error_collector_mailto= "";
set_error_handler('gosaRaiseError');
$variables_order= "ES";