summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7a2768d)
raw | patch | inline | side by side (parent: 7a2768d)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 23 Nov 2010 09:56:46 +0000 (09:56 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 23 Nov 2010 09:56:46 +0000 (09:56 +0000) |
-Added error reporting
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20339 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20339 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/ihtml/themes/default/ldifViewer.tpl | patch | blob | history | |
gosa-core/plugins/generic/references/class_ldifViewer.inc | patch | blob | history |
diff --git a/gosa-core/ihtml/themes/default/ldifViewer.tpl b/gosa-core/ihtml/themes/default/ldifViewer.tpl
index 6b46ce19ede73297f146a7a3aa7188fa9619e3e3..a0b9917e7a6b06a8ce62d209a77732998b5e3fd1 100644 (file)
<h3>{t}Raw LDAP entry{/t}</h3>
<hr>
+
+{if $success}
<pre>
{$ldif}
</pre>
+{else}
+ <p>{msgPool type=ldapError err=$error}</p>
+{/if}
<hr>
<div class="plugin-actions">
<button name='cancelLdifViewer'>{msgPool type='cancelButton'}</button>
diff --git a/gosa-core/plugins/generic/references/class_ldifViewer.inc b/gosa-core/plugins/generic/references/class_ldifViewer.inc
index cbe34f9cd02732859405e2b8c9def6b4d487af21..846f33e91364f5f5f60261b00416efdf022fddff 100644 (file)
class ldifViewer extends plugin
{
- private $ldif;
+ private $ldif;
+ private $success= FALSE;
+ private $error= "";
function __construct($config, $dn)
{
$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')));
}