From: hickert Date: Tue, 23 Nov 2010 09:56:46 +0000 (+0000) Subject: Updated ldif viewer X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d184b8e73244b0afe59cc6f91adc7585d353317d;p=gosa.git Updated ldif viewer -Added error reporting git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20339 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/ihtml/themes/default/ldifViewer.tpl b/gosa-core/ihtml/themes/default/ldifViewer.tpl index 6b46ce19e..a0b9917e7 100644 --- a/gosa-core/ihtml/themes/default/ldifViewer.tpl +++ b/gosa-core/ihtml/themes/default/ldifViewer.tpl @@ -1,8 +1,13 @@

{t}Raw LDAP entry{/t}


+ +{if $success}
 {$ldif}
 
+{else} +

{msgPool type=ldapError err=$error}

+{/if}
diff --git a/gosa-core/plugins/generic/references/class_ldifViewer.inc b/gosa-core/plugins/generic/references/class_ldifViewer.inc index cbe34f9cd..846f33e91 100644 --- a/gosa-core/plugins/generic/references/class_ldifViewer.inc +++ b/gosa-core/plugins/generic/references/class_ldifViewer.inc @@ -2,7 +2,9 @@ class ldifViewer extends plugin { - private $ldif; + private $ldif; + private $success= FALSE; + private $error= ""; function __construct($config, $dn) { @@ -14,11 +16,21 @@ class ldifViewer extends plugin $this->dn = $dn; $ldap = $this->config->get_ldap_link(); $this->ldif=$ldap->generateLdif(LDAP::fix($this->dn),'(objectClass=*)','base'); + if(!$ldap->success()){ + msg_dialog::display(_("Error"), + msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_READ), + ERROR_DIALOG); + + } + $this->success = $ldap->success(); + $this->error = $ldap->get_error(); } function execute() { $smarty = get_smarty(); + $smarty->assign('success', $this->success); + $smarty->assign('error', $this->error); $smarty->assign('ldif', set_post($this->ldif)); return($smarty->fetch(get_template_path('ldifViewer.tpl'))); }