X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Ffunctions.inc;h=0cb50d54baef4386113ee88aef4807ff8d92f4bb;hb=3fad6ea3ba20f4cfef3cf7d62c5a0082159dd208;hp=cee7bf691a4b24ddfebe3c103e8f62e9b6e375b8;hpb=b3a4e5f5d7b3b3a25ca1405defe9e23f8de6f965;p=gosa.git
diff --git a/include/functions.inc b/include/functions.inc
index cee7bf691..0cb50d54b 100644
--- a/include/functions.inc
+++ b/include/functions.inc
@@ -492,7 +492,7 @@ function get_lock ($object)
function get_list($filter, $subtreeACL, $base= "", $attributes= array(), $flags= GL_SUBSEARCH)
{
- global $config;
+ global $config, $ui;
/* Get LDAP link */
$ldap= $config->get_ldap_link($flags & GL_SIZELIMIT);
@@ -504,6 +504,12 @@ function get_list($filter, $subtreeACL, $base= "", $attributes= array(), $flags=
$ldap->cd ($base);
}
+ /* Strict filter for administrative units? */
+ if ($ui->gosaUnitTag != "" && isset($config->current['STRICT_UNITS']) &&
+ preg_match('/TRUE/i', $config->current['STRICT_UNITS'])){
+ $filter= "(&(gosaUnitTag=".$ui->gosaUnitTag.")$filter)";
+ }
+
/* Perform ONE or SUB scope searches? */
if ($flags & GL_SUBSEARCH) {
$ldap->search ($filter, $attributes);
@@ -953,50 +959,42 @@ function print_red()
if (isset($_SESSION['DEBUGLEVEL'])){
if($_SESSION['LastError'] == $string){
-
+
if((!isset($_SESSION['errorsAlreadyPosted'][$string]))){
$_SESSION['errorsAlreadyPosted'][$string] = 1;
}
- $_SESSION['errorsAlreadyPosted'][$string] ++;
+ $_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']])." ".
-# "
\n";
-# }
-
-# if($string != NULL){
-# $_SESSION['errors'].= " ".
-# "".
-# "$string ".
-# "
\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.");
+ }
+
+ if(isset($_SESSION['errors']) && strlen($_SESSION['errors'])==0) {
+ $_SESSION['errors'].= "".
+ " ".
+ ""._("An error occured while processing your request").
+ " $string $addmsg".
+ _("OK")."
";
}
- $string= preg_replace('/ /', ' ', $string);
- $_SESSION['errors'].= "";
- #########################
}else{
return;
}
- $_SESSION['errorsAlreadyPosted'] = array();
$_SESSION['errorsAlreadyPosted'][$string] = 1;
}
@@ -1005,7 +1003,6 @@ function print_red()
echo "Error: $string\n";
}
$_SESSION['LastError'] = $string;
-
}
@@ -1157,9 +1154,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 {