From 2dacb5cae501242730882fb3f7a7366b238c8bd1 Mon Sep 17 00:00:00 2001 From: cajus Date: Sat, 8 Mar 2008 15:21:51 +0000 Subject: [PATCH] Added ldap error message to replace show_ldap_errors git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9465 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_ldap.inc | 7 ++++ gosa-core/include/utils/class_msgPool.inc | 44 ++++++++++++++++------- 2 files changed, 38 insertions(+), 13 deletions(-) diff --git a/gosa-core/include/class_ldap.inc b/gosa-core/include/class_ldap.inc index c01428d42..af6fec7a3 100644 --- a/gosa-core/include/class_ldap.inc +++ b/gosa-core/include/class_ldap.inc @@ -694,6 +694,13 @@ class LDAP{ return ($error); } + + function success() + { + return (preg_match('/Success/i', $this->error)); + } + + function get_error() { if ($this->error == 'Success'){ diff --git a/gosa-core/include/utils/class_msgPool.inc b/gosa-core/include/utils/class_msgPool.inc index 0286f9591..7b55aee9f 100644 --- a/gosa-core/include/utils/class_msgPool.inc +++ b/gosa-core/include/utils/class_msgPool.inc @@ -1,4 +1,10 @@ _("read operation"), _("add operation"), _("modify operation"), + _("delete operation"), _("search operation"), _("authentication")); + + if (isset($typemap[$type])){ + $headline= sprintf(_("LDAP %s failed!"), $typemap[$type]); + } else { + $headline= _("LDAP operation failed!"); + } + + /* Fill DN information */ + if ($dn != ""){ + $dn_info= "

"._("Object").": ".LDAP::fix($dn); + } + + return $headline.$dn_info."

"._("Error").": ".$error; + } + + } + +?> -- 2.30.2