summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9d9bcd2)
raw | patch | inline | side by side (parent: 9d9bcd2)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 18 May 2005 12:54:03 +0000 (12:54 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 18 May 2005 12:54:03 +0000 (12:54 +0000) |
diff --git a/html/main.php b/html/main.php
index d1a76442770b90d23d7bf4c13f78856b745ff6a2..cd8cfa3da08fdbebd57bc0a7325de51078273138 100644 (file)
--- a/html/main.php
+++ b/html/main.php
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* This will be removed... */
-function raiseError($errno, $errstr, $errfile, $errline)
-{
- gosa_log ("PHP error: $errstr ($errfile, line $errline)");
-}
-
-#set_error_handler('raiseError');
-/* This will be removed */
-
/* Basic setup, remove eventually registered sessions */
$timing= array();
require_once ("../include/php_setup.inc");
require_once ("functions.inc");
header("Content-type: text/html; charset=UTF-8");
+/* Reset error handler */
+$error_collector= "";
+set_error_handler('gosaRaiseError');
+
/* Find all class files and include them */
get_dir_list("$BASE_DIR/plugins");
$GLOBALS['t_language']= $lang;
$GLOBALS['t_gettext_message_dir'] = $BASE_DIR.'/locale/';
+/* Dummy */
+trigger_error("I'm a fake error. Please ignore me.", E_USER_NOTICE);
+
/* Set the text domain as 'messages' */
$domain = 'messages';
bindtextdomain($domain, "$BASE_DIR/locale");
if (isset($_SESSION['errors'])){
$smarty->assign("errors", $_SESSION['errors']);
}
+$smarty->assign("php_errors", $error_collector);
$smarty->display(get_template_path('framework.tpl'));
$_SESSION['plist']= $plist;
index 389eb96e4332b99c00285446c7bc3b08a7d37bf4..e7337090f1f5c03e3fd0685e3ec1919745acb102 100644 (file)
<!-- Headline -->
<body>
+{$php_errors}
<form action='main.php{$plug}' name='mainform' method='post' enctype='multipart/form-data'>
<table width="100%" border="0" cellspacing="0" cellpadding="0" cellpadding="3" bgcolor="#CDF6BD" height=100%>
<tr>
index b497200748a8a4b0136210458713fcdd59435699..2c5c532cb96e60ebccc4efc55ecd2a6dded10dcc 100644 (file)
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-function fake_handler($log_level, $log_text, $error_file, $error_line)
-{
-}
-
class mailMethodCyrus extends mailMethod
{
var $mbox= "-";
$cfg= $this->config[$gosaMailServer];
/* For some reason, hiding errors with @ does not wor here... */
- $tmp= set_error_handler('fake_handler');
$this->mbox = @imap_open($cfg['connect'], $cfg['admin'], $cfg['password'], OP_HALFOPEN);
- set_error_handler($tmp);
/* Mailbox reachable? */
if ($this->mbox === FALSE){
diff --git a/include/functions.inc b/include/functions.inc
index bf46a15c0861a4179e1da4a7d2bf068ad41e2bf3..d802662ff35846614fa7ac333878be0ba858a9e2 100644 (file)
--- a/include/functions.inc
+++ b/include/functions.inc
}
}
+function gosaRaiseError($errno, $errstr, $errfile, $errline)
+{
+ global $error_collector;
+
+ $error_collector.= "PHP error: $errstr ($errfile, line $errline)<br>";
+ $error_collector.= sprintf(_("File %s, line %s: %s"), $errfile, $errline, $errstr)."<br>";
+ gosa_log ("PHP error: $errstr ($errfile, line $errline)");
+}
+
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>
diff --git a/include/php_setup.inc b/include/php_setup.inc
index e74f4eebe7481447b6ec86979315d837280c75ec..4fdccbc2dd28c65241ca6144f84f4b6db37793d8 100644 (file)
--- a/include/php_setup.inc
+++ b/include/php_setup.inc
ini_set("register_globals",0);
ini_set("track_vars",1);
ini_set("include_path",".:$BASE_DIR/include");
-#ini_set("display_errors",0);
+ini_set("display_errors",0);
/* Do smarty setup */
require("smarty/Smarty.class.php");