summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4205d45)
raw | patch | inline | side by side (parent: 4205d45)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 6 Mar 2006 09:16:22 +0000 (09:16 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 6 Mar 2006 09:16:22 +0000 (09:16 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2812 594d385d-05f5-0310-b6e9-bd551577e9d8
html/main.php | patch | blob | history | |
include/functions.inc | patch | blob | history |
diff --git a/html/main.php b/html/main.php
index a2b8d72eee59d9bb9a7607a4ba8f95729761ae37..8471e3eea3751e21ed743551bfa80a99d85ef8f4 100644 (file)
--- a/html/main.php
+++ b/html/main.php
/* Reset errors */
$_SESSION['errors']= "";
+$_SESSION['errorsAlreadyPosted']= array();
+$_SESSION['LastError'] ="";
/* Check for uniqe ip address */
$ui= $_SESSION["ui"];
}
/* Close div/tables */
+
+/* Print_out last ErrorMessage repeated string.
+ */
+print_red(NULL);
+
$smarty->assign("contents", $display);
+
if (isset($_SESSION['errors'])){
$smarty->assign("errors", $_SESSION['errors']);
}
diff --git a/include/functions.inc b/include/functions.inc
index a7695a01744376076f803b212f935a993e50b49e..3aaf3bfee7e64e70ee98e37e06f9a9bcd1230cb1 100644 (file)
--- a/include/functions.inc
+++ b/include/functions.inc
$string= preg_replace ("/%s/", $array[$i], $string, 1);
}
+ if((!isset($_SESSION['errorsAlreadyPosted'])) || !is_array($_SESSION['errorsAlreadyPosted'])){
+ $_SESSION['errorsAlreadyPosted'] = array();
+ }
+
/* If DEBUGLEVEL is set, we're in web mode, use textual output in
the other case... */
+
if (isset($_SESSION['DEBUGLEVEL'])){
- $_SESSION['errors'].= "<div align=\"left\" style=\"border-width:5px;".
- "border-style:solid;border-color:red; background-color:black;".
- "margin-bottom:10px; padding:8px;\"><table style='width:100%' summary=''><tr><td><img alt=\"\" src=\"".
- get_template_path('images/warning.png')."\"></td>".
- "<td width=\"100%\" style=\"text-align:center\"><font color=\"#FFFFFF\">".
- "<b style='font-size:16px;'>$string</b></font></td><td>".
- "<img alt=\"\"src=\"".get_template_path('images/warning.png').
- "\"></td></tr></table></div>\n";
+
+ if($_SESSION['LastError'] == $string){
+
+ if((!isset($_SESSION['errorsAlreadyPosted'][$string]))){
+ $_SESSION['errorsAlreadyPosted'][$string] = 1;
+ }
+ $_SESSION['errorsAlreadyPosted'][$string] ++;
+
+ }else{
+ if((!empty($_SESSION['LastError'])) && ($_SESSION['errorsAlreadyPosted'][$_SESSION['LastError']]>1)){
+ $_SESSION['errors'].= "<div align=\"left\" style=\"border-width:5px;".
+ "border-style:solid;border-color:red; background-color:black;".
+ "margin-bottom:10px; padding:8px;\"><table style='width:100%' summary=''><tr><td><img alt=\"\" src=\"".
+ get_template_path('images/warning.png')."\"></td>".
+ "<td width=\"100%\" style=\"text-align:center\"><font color=\"#FFFFFF\">".
+ "<b style='font-size:16px;'>".sprintf(_("Last message repeated %s times."),$_SESSION['errorsAlreadyPosted'][$_SESSION['LastError']])."</b></font></td><td>".
+ "<img alt=\"\"src=\"".get_template_path('images/warning.png').
+ "\"></td></tr></table></div>\n";
+ }
+
+ if($string != NULL){
+ $_SESSION['errors'].= "<div align=\"left\" style=\"border-width:5px;".
+ "border-style:solid;border-color:red; background-color:black;".
+ "margin-bottom:10px; padding:8px;\"><table style='width:100%' summary=''><tr><td><img alt=\"\" src=\"".
+ get_template_path('images/warning.png')."\"></td>".
+ "<td width=\"100%\" style=\"text-align:center\"><font color=\"#FFFFFF\">".
+ "<b style='font-size:16px;'>$string</b></font></td><td>".
+ "<img alt=\"\"src=\"".get_template_path('images/warning.png').
+ "\"></td></tr></table></div>\n";
+ }else{
+ return;
+ }
+ $_SESSION['errorsAlreadyPosted'] = array();
+ $_SESSION['errorsAlreadyPosted'][$string] = 1;
+
+ }
+
} else {
echo "Error: $string\n";
}
+ $_SESSION['LastError'] = $string;
+
}