From a04b1f2478909c46f345a2bfc390c5543ad975bd Mon Sep 17 00:00:00 2001 From: cajus Date: Tue, 16 May 2006 05:14:19 +0000 Subject: [PATCH] * Updated TODO * Finalized new print_red message git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3353 594d385d-05f5-0310-b6e9-bd551577e9d8 --- TODO | 2 -- include/functions.inc | 56 ++++++++++++++++++------------------------- 2 files changed, 23 insertions(+), 35 deletions(-) diff --git a/TODO b/TODO index 12a409d67..3b471aad2 100644 --- a/TODO +++ b/TODO @@ -34,8 +34,6 @@ Now: * evaluate what effects a ldap->cat(..., $this->attributes) will have to other plugins in class_plugin.inc * Changing LDAP-Servers -> start tab! Actions? -* Redo print_red(). Just show the first error, redesign it. -* Base-chooser geht nicht mehr Target for 2.5: diff --git a/include/functions.inc b/include/functions.inc index 00919813f..1e9b5b633 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -960,45 +960,35 @@ function print_red() $_SESSION['errorsAlreadyPosted'][$string]++; }else{ -# if((!empty($_SESSION['LastError'])) && ($_SESSION['errorsAlreadyPosted'][$_SESSION['LastError']]>1)){ -# $_SESSION['errors'].= "
". -# "
\"\"". -# "".sprintf(_("Last message repeated %s times."),$_SESSION['errorsAlreadyPosted'][$_SESSION['LastError']])."". -# "\"\"src=\"".get_template_path('images/warning.png').
\n"; -# } - -# if($string != NULL){ -# $_SESSION['errors'].= "
". -# "
\"\"". -# "$string". -# "\"\"src=\"".get_template_path('images/warning.png').
\n"; -######### Test ######### if($string != NULL){ - if (!preg_match('/[.!?]$/', $string)){ - $string.= "."; + if (preg_match("/"._("LDAP error:")."/", $string)){ + $addmsg= _("Problems with the LDAP server mean that you probably lost the last changes. Please check your LDAP setup for possible errors and try again."); + $img= "images/error.png"; + } else { + if (!preg_match('/[.!?]$/', $string)){ + $string.= "."; + } + $string= preg_replace('/
/', ' ', $string); + $img= "images/warning.png"; + $addmsg= _("Please check your input and fix the error. Press 'OK' to close this message box."); } - $string= preg_replace('/
/', ' ', $string); if(isset($_SESSION['errors']) && strlen($_SESSION['errors'])==0) { - $_SESSION['errors'].= "
". - "". - "". - "

"._("An error occured while processing your request")."

". - "$string "._("Please check your input and fix the error. Press 'OK' to close this message box.")."

"; + $_SESSION['errors'].= "
". + "". + "

"._("An error occured while processing your request"). + "

$string

$addmsg

"; } - ######################### + }else{ return; } - #$_SESSION['errorsAlreadyPosted'] = array(); $_SESSION['errorsAlreadyPosted'][$string] = 1; } @@ -1158,9 +1148,9 @@ function show_ldap_error($message, $addon= "") { if (!preg_match("/Success/i", $message)){ if ($addon == ""){ - print_red (_("LDAP error:")." $message"); + print_red (_("LDAP error: $message")); } else { - print_red ("$addon (LDAP error: $message)"); + print_red ("$addon

"._("LDAP error:")." $message"); } return TRUE; } else { -- 2.30.2