summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 28c8d1f)
raw | patch | inline | side by side (parent: 28c8d1f)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 28 Jun 2007 13:19:16 +0000 (13:19 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 28 Jun 2007 13:19:16 +0000 (13:19 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6734 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/html/index.php b/html/index.php
index 7a947cd583a49b294de1ea13a4b5c2e3157225ce..0ad4f680014782c7d8eae1c48f9645bf8a5771fc 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 7e001e122b95b0735204f821156af82bd56c7cca..be5e03e17217dd4e7c87fff3421b1b67ff1f065a 100644 (file)
--- a/html/main.php
+++ b/html/main.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/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 37bfa9fa06a7a6dc8f27ebc7d1a29056406c2d36..9e0f24c9adfd6dca4f98ff747a6f0b42f0b70863 100644 (file)
--- a/include/functions.inc
+++ b/include/functions.inc
return($checks);
}
+
+function prepare4mailbody($string)
+{
+ $string = html_entity_decode($string);
+
+ $from = array(
+ "/%/",
+ "/ /",
+ "/\n/",
+ "/\r/",
+ "/!/",
+ "/#/",
+ "/\*/",
+ "/\//",
+ "/</",
+ "/>/",
+ "/\?/",
+ "/\"/");
+
+ $to = array(
+ "%25",
+ "%20",
+ "%0A",
+ "%0D",
+ "%21",
+ "%23",
+ "%2A",
+ "%2F",
+ "%3C",
+ "%3E",
+ "%3F",
+ "%22");
+
+ $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 ec13459435faafcdfcb6492c3f538883d69db13b..95fb9a53ef578065893e268a6e9aa0709b1b6459 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,$config, $error_collector_mailto;
if(@class_exists("log")){
new log("debug","all",$errfile,array(),"Type:".$errno.", Message:".$errstr.", File:".$errfile.", Line: ".$errline);
/* Create header as needed */
if ($error_collector == ""){
+
+ /* Mailto body header */
+ $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().
+ "\nDate: ".date("d.m.Y").
+ "\nTime: ".date("H:i:s").
+ "\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 ?".
+ "\n\n".
+ "*** PHP error information ***\n\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>
+ <a href=\"mailto:gosa-bugs@oss.gonicus.de?subject=GOsa%20bugreport&body=%BUGBODY%\">
+ <img border='0' src='images/mailto.png' title='"._("Send bug report to the GOsa Team")."' class='center' alt=''> "._("Send bugreport")."
+ </a>
+ </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'>";
}
}
/* Create error header */
$error_collector.= "<table summary=\"\" width=\"100%\" cellspacing=0 style='background-color:#402005;color:white;border:2px solid red'><tr><td colspan=3><h1 style='color:white'>"._("PHP error")." \"$errstr\"</h1></td></tr>";
+
+ $error_collector_mailto .= prepare4mailbody("=== Error === \n");
+ $error_collector_mailto .= prepare4mailbody("PHP error: $errstr ($errfile, line $errline)\n");
+ $error_collector_mailto .= prepare4mailbody("=== /Error === \n\n");
/* Extract traceback data - if available */
if (function_exists('debug_backtrace')){
$trace= debug_backtrace();
+ $error_collector_mailto .= prepare4mailbody("=== Trace ===");
+
/* Generate trace history */
for ($index= 0; $index<count($trace); $index++){
+
+
$ct= $trace[$index];
$loc= "";
if (isset($ct['class'])){
$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");
+
}
}
+ $error_collector_mailto .= prepare4mailbody("=== /Trace === \n");
+
/* Close error table */
$error_collector.= "</table>";
/* Register error handler */
$error_collector= "";
+$error_collector_mailto= "";
set_error_handler('gosaRaiseError');
$variables_order= "ES";
index 72f2d200960839c07a626ddff540f3ac68a8d5e3..07ccd934d915030fa02fe485d1283f09a0cbfa99 100644 (file)
/* Call parent execute */
plugin::execute();
+ $a .= $b[cbh];
+
if($this->is_account && !$this->view_logged){
$this->view_logged = TRUE;
new log("view","fai/".get_class($this),$this->dn);