From 362e2b9a81d3bde32512811ede7525ab017eead5 Mon Sep 17 00:00:00 2001 From: cajus Date: Sat, 8 Mar 2008 17:22:52 +0000 Subject: [PATCH] Removed show_ldap_error() calls git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9468 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../addons/addressbook/class_addressbook.inc | 7 +++-- .../connectivity/class_intranetAccount.inc | 8 ++++-- .../dfs/addons/godfs/class_dfsManagment.inc | 4 ++- .../dfs/addons/godfs/class_dfsgeneric.inc | 9 ++++-- .../systems/services/dhcp/class_servDHCP.inc | 24 ++++++++++++---- .../systems/services/dns/class_servDNS.inc | 20 +++++++++---- gosa-plugins/fai/admin/fai/class_FAI.inc | 4 ++- gosa-plugins/fai/admin/fai/class_faiHook.inc | 4 ++- .../fai/admin/fai/class_faiPackage.inc | 4 ++- .../fai/admin/fai/class_faiPartitionTable.inc | 4 ++- .../fai/admin/fai/class_faiProfile.inc | 4 ++- .../fai/admin/fai/class_faiScript.inc | 4 ++- .../fai/admin/fai/class_faiTemplate.inc | 4 ++- .../fai/admin/fai/class_faiVariable.inc | 4 ++- .../blocklists/class_blocklistGeneric.inc | 8 ++++-- .../gofax/faxaccount/class_gofaxAccount.inc | 8 ++++-- .../admin/ogroups/gofon/class_phonequeue.inc | 8 ++++-- .../systems/gofon/class_phoneGeneric.inc | 8 ++++-- .../services/gofon/class_goFonServer.inc | 4 ++- .../class_phoneConferenceGeneric.inc | 4 ++- .../gofon/gofon/macro/class_gofonMacro.inc | 12 ++++++-- .../macro/class_gofonMacroParameters.inc | 4 ++- .../gofon/phoneaccount/class_phoneAccount.inc | 8 ++++-- .../applications/class_applicationGeneric.inc | 12 ++++++-- .../class_applicationParameters.inc | 8 ++++-- .../admin/devices/class_deviceGeneric.inc | 4 ++- .../groups/apps/class_groupApplication.inc | 18 ++++++++---- .../admin/mimetypes/class_mimetypeGeneric.inc | 12 ++++++-- .../admin/ogroups/goto/class_termgroup.inc | 11 ++++++-- .../admin/systems/goto/class_ArpNewDevice.inc | 4 ++- .../admin/systems/goto/class_printGeneric.inc | 8 ++++-- .../systems/goto/class_terminalGeneric.inc | 8 ++++-- .../systems/goto/class_terminalService.inc | 8 ++++-- .../systems/goto/class_terminalStartup.inc | 4 ++- .../systems/goto/class_workstationGeneric.inc | 12 ++++++-- .../systems/goto/class_workstationService.inc | 4 ++- .../systems/goto/class_workstationStartup.inc | 4 ++- .../services/kiosk/class_goKioskService.inc | 4 ++- .../services/ntp/class_goNtpServer.inc | 4 ++- .../services/shares/class_goShareServer.inc | 16 ++++++++--- .../terminal/class_goTerminalServer.inc | 4 ++- .../environment/class_environment.inc | 8 ++++-- .../class_password-methods-heimdal.inc | 8 ++++-- .../services/kolab/class_servKolab.inc | 12 ++++++-- .../connectivity/kolab/class_kolabAccount.inc | 8 ++++-- .../admin/groups/mail/class_groupMail.inc | 8 ++++-- .../admin/ogroups/mail/class_mailogroup.inc | 8 ++++-- .../services/mail/class_goMailServer.inc | 5 +++- .../services/spam/class_goSpamServer.inc | 4 ++- .../services/virus/class_goVirusServer.inc | 4 ++- .../mail/personal/mail/class_mailAccount.inc | 8 ++++-- .../personal/nagios/class_nagiosAccount.inc | 8 ++++-- .../personal/netatalk/class_netatalk.inc | 8 ++++-- .../openxchange/class_oxchangeAccount.inc | 17 ++++++++--- .../connectivity/phpgw/class_phpgwAccount.inc | 8 ++++-- .../class_phpscheduleitAccount.inc | 8 ++++-- .../connectivity/pptp/class_pptpAccount.inc | 8 ++++-- .../pureftpd/class_pureftpdAccount.inc | 8 ++++-- .../admin/systems/samba/class_winGeneric.inc | 8 ++++-- .../personal/samba/class_sambaAccount.inc | 8 ++++-- .../personal/scalix/class_scalixAccount.inc | 8 ++++-- .../connectivity/squid/class_proxyAccount.inc | 8 ++++-- .../admin/systems/class_componentGeneric.inc | 9 ++++-- .../admin/systems/class_servGeneric.inc | 8 ++++-- .../systems/admin/systems/class_termDNS.inc | 28 +++++++++++++------ .../systems/services/class_goService.inc | 12 ++++++-- .../webdav/class_webdavAccount.inc | 8 ++++-- 67 files changed, 409 insertions(+), 139 deletions(-) diff --git a/gosa-plugins/addressbook/addons/addressbook/class_addressbook.inc b/gosa-plugins/addressbook/addons/addressbook/class_addressbook.inc index 92c8a3a9d..76b2a6111 100644 --- a/gosa-plugins/addressbook/addons/addressbook/class_addressbook.inc +++ b/gosa-plugins/addressbook/addons/addressbook/class_addressbook.inc @@ -202,7 +202,9 @@ class addressbook extends plugin $ldap= $this->config->get_ldap_link(); $ldap->rmdir ($this->dn); new log("remove","addressbook/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of addressbook entry '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class())); + } new log("remove","addressbook/".get_class($this),$this->dn,array(),"Address book object'".$this->dn."' has been removed"); } else { @@ -763,7 +765,8 @@ class addressbook extends plugin $ldap->cd ($this->dn); $this->cleanup(); $ldap->$mode ($this->attrs); - if (show_ldap_error($ldap->get_error(), sprintf(_("Removing of addressbook entry '%s' failed."),$this->dn))){ + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class())); return (1); } diff --git a/gosa-plugins/connectivity/personal/connectivity/class_intranetAccount.inc b/gosa-plugins/connectivity/personal/connectivity/class_intranetAccount.inc index e1c9ffca9..fddfeba42 100644 --- a/gosa-plugins/connectivity/personal/connectivity/class_intranetAccount.inc +++ b/gosa-plugins/connectivity/personal/connectivity/class_intranetAccount.inc @@ -115,7 +115,9 @@ class intranetAccount extends plugin /* Log last action */ new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/intranet account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class())); + } /* Optionally execute a command after we're done */ $this->postremove(array("uid"=>$this->uid)); @@ -180,7 +182,9 @@ class intranetAccount extends plugin new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/intranet account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } /* Optionally execute a command after we're done */ $this->postcreate(array("uid" => $this->uid)); diff --git a/gosa-plugins/dfs/addons/godfs/class_dfsManagment.inc b/gosa-plugins/dfs/addons/godfs/class_dfsManagment.inc index ad1b60fc5..5d754aeff 100644 --- a/gosa-plugins/dfs/addons/godfs/class_dfsManagment.inc +++ b/gosa-plugins/dfs/addons/godfs/class_dfsManagment.inc @@ -144,7 +144,9 @@ class dfsManagment extends plugin { $ldap = $this->config->get_ldap_link(); $ldap->cd($this->basedn); $ldap->rmdir($this->basedn); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of DFS share with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->basedn, LDAP_DEL, get_class())); + } del_lock (session::get('objectinfo')); unset ($this->dfstab); diff --git a/gosa-plugins/dfs/addons/godfs/class_dfsgeneric.inc b/gosa-plugins/dfs/addons/godfs/class_dfsgeneric.inc index f787f5f21..4e09f582f 100644 --- a/gosa-plugins/dfs/addons/godfs/class_dfsgeneric.inc +++ b/gosa-plugins/dfs/addons/godfs/class_dfsgeneric.inc @@ -166,7 +166,10 @@ # add $ldap->add($this->attrs); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving dfs/generic with dn '%s' failed."),$this->basedn)); + + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } } } @@ -193,7 +196,9 @@ $ldap = $this->config->get_ldap_link(); $ldap->cd($this->basedn); $ldap->rmdir($this->basedn); - show_ldap_error($ldap->get_error(), sprintf(_("Removing dfs/generic with dn '%s' failed."),$this->basedn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->basedn, LDAP_DEL, get_class())); + } } } diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc index 329d76d8d..5feb68fe7 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc @@ -379,7 +379,9 @@ class servdhcp extends goService foreach ($this->dhcpObjectCache as $dn => $content){ if ($this->objectType($dn) == 'dhcpService'){ $ldap->rmdir_recursive($dn); - show_ldap_error($ldap->get_error(), _("Removing DHCP entries failed")); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $dn, LDAP_DEL, get_class())); + } } } @@ -394,7 +396,9 @@ class servdhcp extends goService $this->cleanup(); $ldap->modify ($this->attrs); - show_ldap_error($ldap->get_error(), _("Removing DHCP entries failed")); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } /* Optionally execute a command after we're done */ $this->handle_post_events("remove"); @@ -447,7 +451,9 @@ class servdhcp extends goService /* Check if exists, then remove... */ if($ldap->cat($dn)){ $ldap->rmdir_recursive($dn); - show_ldap_error($ldap->get_error(), _("Can't remove DHCP object!")); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $dn, LDAP_MOD, get_class())); + } } continue; } @@ -521,13 +527,17 @@ class servdhcp extends goService $ldap->cd($dn); if ($modify){ $ldap->modify($attrs); - show_ldap_error($ldap->get_error(), _("Can't save DHCP object!")); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $dn, LDAP_MOD, get_class())); + } /* Optionally execute a command after we're done */ $this->handle_post_events("modify"); } else { $ldap->add($attrs); - show_ldap_error($ldap->get_error(), _("Can't save DHCP object!")); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $dn, LDAP_ADD, get_class())); + } /* Optionally execute a command after we're done */ $this->handle_post_events("create"); @@ -552,7 +562,9 @@ class servdhcp extends goService $this->cleanup(); $ldap->modify ($this->attrs); - show_ldap_error($ldap->get_error(), _("Saving DHCP service failed")); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } /* Optionally execute a command after we're done */ if ($this->initially_was_account == $this->is_account){ diff --git a/gosa-plugins/dns/admin/systems/services/dns/class_servDNS.inc b/gosa-plugins/dns/admin/systems/services/dns/class_servDNS.inc index cddac417d..b235712f4 100644 --- a/gosa-plugins/dns/admin/systems/services/dns/class_servDNS.inc +++ b/gosa-plugins/dns/admin/systems/services/dns/class_servDNS.inc @@ -449,7 +449,9 @@ class servdns extends goService $ldap->cd($dn); $ldap->modify($attrs); new log("modify","unknown/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Updating of system server/dns with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } } } @@ -463,7 +465,9 @@ class servdns extends goService $ldap->cd($dn); $ldap->rmdir_recursive($dn); new log("remove","unknown/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of system server/dns with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class())); + } /* Handle Post events */ if(preg_match("/^zoneName=/",$dn)){ @@ -486,7 +490,9 @@ class servdns extends goService if($ldap->fetch()){ $ldap->cd($dn); $ldap->modify ($attrs); - show_ldap_error($ldap->get_error(), sprintf(_("Saving of system server/dns with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } /* Handle Post events */ if(preg_match("/^zoneName=/",$dn)){ @@ -495,7 +501,9 @@ class servdns extends goService }else{ $ldap->cd($dn); $ldap->add($attrs); - show_ldap_error($ldap->get_error(), sprintf(_("Saving of system server/dns with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_ADD, get_class())); + } /* Handle Post events */ if(preg_match("/^zoneName=/",$dn)){ @@ -526,7 +534,9 @@ class servdns extends goService $attrs[$flag] = $value; $this->$flag = $value; $ldap->modify($attrs); - show_ldap_error($ldap->get_error(), sprintf(_("Set status flag for system server/dns with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } $this->action_hook(); } } diff --git a/gosa-plugins/fai/admin/fai/class_FAI.inc b/gosa-plugins/fai/admin/fai/class_FAI.inc index e6e34b77a..33bc842cb 100644 --- a/gosa-plugins/fai/admin/fai/class_FAI.inc +++ b/gosa-plugins/fai/admin/fai/class_FAI.inc @@ -491,7 +491,9 @@ class FAI $ldap->add($attrs); } - show_ldap_error($ldap->get_error(),sprintf(_("Release management failed, can't save '%s'"),$dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $dn, 0, get_class())); + } } diff --git a/gosa-plugins/fai/admin/fai/class_faiHook.inc b/gosa-plugins/fai/admin/fai/class_faiHook.inc index e150dc518..c5e8c47dc 100644 --- a/gosa-plugins/fai/admin/fai/class_faiHook.inc +++ b/gosa-plugins/fai/admin/fai/class_faiHook.inc @@ -465,7 +465,9 @@ class faiHook extends plugin $ldap = $this->config->get_ldap_link(); FAI::prepare_to_save_FAI_object($this->dn,$this->attrs); - show_ldap_error($ldap->get_error(), sprintf(_("Saving of FAI/hook with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } if($this->initially_was_account){ new log("modify","fai/".get_class($this),$this->dn,$this->attributes); diff --git a/gosa-plugins/fai/admin/fai/class_faiPackage.inc b/gosa-plugins/fai/admin/fai/class_faiPackage.inc index 9ae6b8e7c..44cb460fb 100644 --- a/gosa-plugins/fai/admin/fai/class_faiPackage.inc +++ b/gosa-plugins/fai/admin/fai/class_faiPackage.inc @@ -489,7 +489,9 @@ class faiPackage extends plugin } FAI::prepare_to_save_FAI_object($this->dn,$this->attrs); - show_ldap_error($ldap->get_error(), sprintf(_("Saving of FAI/package list with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } if($this->initially_was_account){ new log("modify","fai/".get_class($this),$this->dn,$this->attributes); diff --git a/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc b/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc index 21a4dab5f..161deb2c5 100644 --- a/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc +++ b/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc @@ -410,7 +410,9 @@ class faiPartitionTable extends plugin $ldap = $this->config->get_ldap_link(); FAI::prepare_to_save_FAI_object($this->dn,$this->attrs); - show_ldap_error($ldap->get_error(), sprintf(_("Saving of FAI/partition table with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } if($this->initially_was_account){ new log("modify","fai/".get_class($this),$this->dn,$this->attributes); diff --git a/gosa-plugins/fai/admin/fai/class_faiProfile.inc b/gosa-plugins/fai/admin/fai/class_faiProfile.inc index 5383da68a..7f337fd80 100644 --- a/gosa-plugins/fai/admin/fai/class_faiProfile.inc +++ b/gosa-plugins/fai/admin/fai/class_faiProfile.inc @@ -443,7 +443,9 @@ class faiProfile extends plugin new log("create","fai/".get_class($this),$this->dn,$this->attributes); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of FAI/profile with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } } diff --git a/gosa-plugins/fai/admin/fai/class_faiScript.inc b/gosa-plugins/fai/admin/fai/class_faiScript.inc index 33d9e0b3a..068ac801f 100644 --- a/gosa-plugins/fai/admin/fai/class_faiScript.inc +++ b/gosa-plugins/fai/admin/fai/class_faiScript.inc @@ -511,7 +511,9 @@ class faiScript extends plugin $ldap = $this->config->get_ldap_link(); FAI::prepare_to_save_FAI_object($this->dn,$this->attrs); - show_ldap_error($ldap->get_error(), sprintf(_("Creating of FAI/script with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } if($this->initially_was_account){ new log("modify","fai/".get_class($this),$this->dn,$this->attributes); diff --git a/gosa-plugins/fai/admin/fai/class_faiTemplate.inc b/gosa-plugins/fai/admin/fai/class_faiTemplate.inc index ffb910eac..9015ba878 100644 --- a/gosa-plugins/fai/admin/fai/class_faiTemplate.inc +++ b/gosa-plugins/fai/admin/fai/class_faiTemplate.inc @@ -443,7 +443,9 @@ class faiTemplate extends plugin $ldap = $this->config->get_ldap_link(); FAI::prepare_to_save_FAI_object($this->dn,$this->attrs); - show_ldap_error($ldap->get_error(), sprintf(_("Saving of FAI/template with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } if($this->initially_was_account){ new log("modify","fai/".get_class($this),$this->dn,$this->attributes); diff --git a/gosa-plugins/fai/admin/fai/class_faiVariable.inc b/gosa-plugins/fai/admin/fai/class_faiVariable.inc index ddd1b1b47..e13a8f38b 100644 --- a/gosa-plugins/fai/admin/fai/class_faiVariable.inc +++ b/gosa-plugins/fai/admin/fai/class_faiVariable.inc @@ -332,7 +332,9 @@ class faiVariable extends plugin $ldap = $this->config->get_ldap_link(); FAI::prepare_to_save_FAI_object($this->dn,$this->attrs); - show_ldap_error($ldap->get_error(), sprintf(_("Saving of FAI/variable with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } if($this->initially_was_account){ new log("modify","fai/".get_class($this),$this->dn,$this->attributes); diff --git a/gosa-plugins/gofax/gofax/blocklists/class_blocklistGeneric.inc b/gosa-plugins/gofax/gofax/blocklists/class_blocklistGeneric.inc index 7545ee273..0ea12925a 100644 --- a/gosa-plugins/gofax/gofax/blocklists/class_blocklistGeneric.inc +++ b/gosa-plugins/gofax/gofax/blocklists/class_blocklistGeneric.inc @@ -189,7 +189,9 @@ class blocklistGeneric extends plugin $ldap= $this->config->get_ldap_link(); $ldap->rmDir($this->dn); new log("remove","gofaxlist/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of blocklist with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } $this->handle_post_events("remove"); } @@ -260,7 +262,9 @@ class blocklistGeneric extends plugin new log("create","gofaxlist/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); $this->handle_post_events("add"); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of blocklist with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } } diff --git a/gosa-plugins/gofax/gofax/faxaccount/class_gofaxAccount.inc b/gosa-plugins/gofax/gofax/faxaccount/class_gofaxAccount.inc index 67a15aab0..ff4661024 100644 --- a/gosa-plugins/gofax/gofax/faxaccount/class_gofaxAccount.inc +++ b/gosa-plugins/gofax/gofax/faxaccount/class_gofaxAccount.inc @@ -654,7 +654,9 @@ class gofaxAccount extends plugin new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/fax account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } /* Optionally execute a command after we're done */ $this->handle_post_events('remove',array("uid"=> $this->uid)); @@ -781,7 +783,9 @@ class gofaxAccount extends plugin new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/fax account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } /* Optionally execute a command after we're done */ if ($this->initially_was_account == $this->is_account){ diff --git a/gosa-plugins/gofon/admin/ogroups/gofon/class_phonequeue.inc b/gosa-plugins/gofon/admin/ogroups/gofon/class_phonequeue.inc index 0dd77e3f6..fe9bfed33 100644 --- a/gosa-plugins/gofon/admin/ogroups/gofon/class_phonequeue.inc +++ b/gosa-plugins/gofon/admin/ogroups/gofon/class_phonequeue.inc @@ -834,7 +834,9 @@ class phonequeue extends plugin new log("modify","ogroups/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); } - show_ldap_error($ldap->get_error(), _("Saving phone queue failed")); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } /* Optionally execute a command after we're done */ if ($this->initially_was_account == $this->is_account){ @@ -887,7 +889,9 @@ class phonequeue extends plugin $this->cleanup(); $ldap->modify ($this->attrs); new log("remove","ogroups/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), _("Removing phone queue failed")); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } } diff --git a/gosa-plugins/gofon/admin/systems/gofon/class_phoneGeneric.inc b/gosa-plugins/gofon/admin/systems/gofon/class_phoneGeneric.inc index 059f5f50f..cfe9b34f1 100644 --- a/gosa-plugins/gofon/admin/systems/gofon/class_phoneGeneric.inc +++ b/gosa-plugins/gofon/admin/systems/gofon/class_phoneGeneric.inc @@ -273,7 +273,9 @@ class phoneGeneric extends plugin new log("remove","phone/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of system phone/generic with dn '%s' failed!"),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } $this->handle_post_events("remove",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); /* Delete references to object groups */ @@ -434,7 +436,9 @@ class phoneGeneric extends plugin } $this->netConfigDNS->cn = $this->cn; $this->netConfigDNS->save(); - show_ldap_error($ldap->get_error(), sprintf(_("Saving of phone/generic with dn '%s' failed!"),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } } diff --git a/gosa-plugins/gofon/admin/systems/services/gofon/class_goFonServer.inc b/gosa-plugins/gofon/admin/systems/services/gofon/class_goFonServer.inc index c95c6b733..1f422633e 100644 --- a/gosa-plugins/gofon/admin/systems/services/gofon/class_goFonServer.inc +++ b/gosa-plugins/gofon/admin/systems/services/gofon/class_goFonServer.inc @@ -142,7 +142,9 @@ class goFonServer extends goService{ foreach($dns as $dn){ $ldap->cd($dn); $ldap->modify(array("goFonHomeServer" => $this->dn)); - show_ldap_error($ldap->get_error(),sprintf(_("Updating gofon home server failed for '%s'."),$dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $dn, LDAP_MOD, get_class())); + } } } diff --git a/gosa-plugins/gofon/gofon/conference/class_phoneConferenceGeneric.inc b/gosa-plugins/gofon/gofon/conference/class_phoneConferenceGeneric.inc index 8b990a594..03ed72b46 100644 --- a/gosa-plugins/gofon/gofon/conference/class_phoneConferenceGeneric.inc +++ b/gosa-plugins/gofon/gofon/conference/class_phoneConferenceGeneric.inc @@ -700,7 +700,9 @@ class conference extends plugin new log("create","gofonconference/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of goFonConference/generic with dn '%s' failed!"),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } /* Optionally execute a command after we're done */ $this->postcreate(); diff --git a/gosa-plugins/gofon/gofon/macro/class_gofonMacro.inc b/gosa-plugins/gofon/gofon/macro/class_gofonMacro.inc index 08f2e0b9c..509188ff4 100644 --- a/gosa-plugins/gofon/gofon/macro/class_gofonMacro.inc +++ b/gosa-plugins/gofon/gofon/macro/class_gofonMacro.inc @@ -475,7 +475,9 @@ class macro extends plugin /* Remove phone macro */ $ldap->rmDir($this->dn); new log("remove","gofonmacro/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of goFonMacro/generic account with dn '%s' failed!"),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class())); + } /* Delete references to object groups */ $ldap->cd ($this->config->current['BASE']); @@ -484,7 +486,9 @@ class macro extends plugin $og= new ogroup($this->config, $ldap->getDN()); unset($og->member[$this->dn]); $og->save (); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of goFonMacro/generic account with dn '%s' failed!"),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } } } @@ -518,7 +522,9 @@ class macro extends plugin $ldap->add($this->attrs); $this->handle_post_events("add"); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of goFonMacro/generic account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } /* Log last action */ if($this->initially_was_account){ diff --git a/gosa-plugins/gofon/gofon/macro/class_gofonMacroParameters.inc b/gosa-plugins/gofon/gofon/macro/class_gofonMacroParameters.inc index f963e2df8..97d8a822b 100644 --- a/gosa-plugins/gofon/gofon/macro/class_gofonMacroParameters.inc +++ b/gosa-plugins/gofon/gofon/macro/class_gofonMacroParameters.inc @@ -393,7 +393,9 @@ class macroParameter extends plugin $ldap->add($this->attrs); $this->handle_post_events("add"); } - show_ldap_error($ldap->get_error(), sprintf(_("Removing of goFonMacro/generic account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } } function PrepareForCopyPaste($source) diff --git a/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc b/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc index 963e595d9..30e330337 100644 --- a/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc +++ b/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc @@ -1274,7 +1274,9 @@ class phoneAccount extends plugin new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/phone account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } /* Optionally execute a command after we're done */ @@ -1412,7 +1414,9 @@ class phoneAccount extends plugin $ldap->modify ($this->attrs); new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/phone account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } /* Optionally execute a command after we're done */ @mysql_close($r_con); diff --git a/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc b/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc index c1e152c2c..1410422ba 100644 --- a/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc +++ b/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc @@ -278,7 +278,9 @@ class application extends plugin $ldap->rmDir($this->dn); new log("remove","application/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of application with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class())); + } /* Optionally execute a command after we're done */ $this->handle_post_events("remove"); @@ -290,7 +292,9 @@ class application extends plugin $og= new ogroup($this->config, $ldap->getDN()); unset($og->member[$this->dn]); $og->save (); - show_ldap_error($ldap->get_error(), sprintf(_("Removing application from objectgroup '%s' failed"), $og->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } } } @@ -512,7 +516,9 @@ class application extends plugin new log("create","application/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); $this->handle_post_events("add"); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of application with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } } function set_picture($filename) diff --git a/gosa-plugins/goto/admin/applications/class_applicationParameters.inc b/gosa-plugins/goto/admin/applications/class_applicationParameters.inc index d77a98bd8..e04c10cdc 100644 --- a/gosa-plugins/goto/admin/applications/class_applicationParameters.inc +++ b/gosa-plugins/goto/admin/applications/class_applicationParameters.inc @@ -151,7 +151,9 @@ class applicationParameters extends plugin $this->cleanup(); $ldap->modify ($this->attrs); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of application parameters with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } /* Optionally execute a command after we're done */ $this->handle_post_events('remove'); @@ -213,7 +215,9 @@ class applicationParameters extends plugin $this->cleanup(); $ldap->modify ($this->attrs); - show_ldap_error($ldap->get_error(), sprintf(_("Saving of application parameters with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } /* Optionally execute a command after we're done */ $this->handle_post_events('modify'); diff --git a/gosa-plugins/goto/admin/devices/class_deviceGeneric.inc b/gosa-plugins/goto/admin/devices/class_deviceGeneric.inc index bc870eb74..eed97d25d 100644 --- a/gosa-plugins/goto/admin/devices/class_deviceGeneric.inc +++ b/gosa-plugins/goto/admin/devices/class_deviceGeneric.inc @@ -183,7 +183,9 @@ class deviceGeneric extends plugin $ldap->cd($this->dn); $ldap->add($this->attrs); } - show_ldap_error($ldap->get_error(),_("Device could not be saved.")); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } } diff --git a/gosa-plugins/goto/admin/groups/apps/class_groupApplication.inc b/gosa-plugins/goto/admin/groups/apps/class_groupApplication.inc index 77743284e..903f6ce05 100644 --- a/gosa-plugins/goto/admin/groups/apps/class_groupApplication.inc +++ b/gosa-plugins/goto/admin/groups/apps/class_groupApplication.inc @@ -516,9 +516,9 @@ class appgroup extends plugin } foreach($a_remove as $remove){ $ldap->rmdir_recursive($remove); - show_ldap_error($ldap->get_error(), - sprintf(_("Removing of group/application account with dn '%s' failed, could not remove '%s'."), - $this->dn,$remove)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class())); + } } $this->_load_menu_structure(); } @@ -1068,7 +1068,9 @@ class appgroup extends plugin $ldap->cat($dn); if($ldap->count()){ $ldap->rmdir_recursive($dn); - show_ldap_error($ldap->get_error(), _("Could not save group application settings.")); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $dn, LDAP_DEL, get_class())); + } } } foreach($Actions['Add'] as $dn => $data){ @@ -1076,7 +1078,9 @@ class appgroup extends plugin $ldap->cat($dn); if(!$ldap->count()){ $ldap->add($data); - show_ldap_error($ldap->get_error(), _("Could not save group application settings.")); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $dn, LDAP_DEL, get_class())); + } } } foreach($Actions['Edit'] as $dn => $data){ @@ -1084,7 +1088,9 @@ class appgroup extends plugin $ldap->cat($dn); if($ldap->count()){ $ldap->modify($data); - show_ldap_error($ldap->get_error(), _("Could not save group application settings.")); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $dn, LDAP_DEL, get_class())); + } } } $this->_load_menu_structure(); diff --git a/gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc b/gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc index eab0bf62b..456cf30ba 100644 --- a/gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc +++ b/gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc @@ -491,7 +491,9 @@ class mimetype extends plugin $ldap->add($this->attrs); new log("create","mimetypes/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of mime type/generic with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } } @@ -501,7 +503,9 @@ class mimetype extends plugin plugin::remove_from_parent(); $ldap = $this->config->get_ldap_link(); $ldap->rmDir($this->dn); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of mime type/generic with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class())); + } new log("remove","mimetypes/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); /* Optionally execute a command after we're done */ @@ -514,7 +518,9 @@ class mimetype extends plugin $og= new ogroup($this->config, $ldap->getDN()); unset($og->member[$this->dn]); $og->save (); - show_ldap_error($ldap->get_error(), sprintf(_("Removing mime type from objectgroup '%s' failed"), $og->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $og->dn, 0, get_class())); + } } } diff --git a/gosa-plugins/goto/admin/ogroups/goto/class_termgroup.inc b/gosa-plugins/goto/admin/ogroups/goto/class_termgroup.inc index 4e3338458..2299d1adf 100644 --- a/gosa-plugins/goto/admin/ogroups/goto/class_termgroup.inc +++ b/gosa-plugins/goto/admin/ogroups/goto/class_termgroup.inc @@ -166,7 +166,9 @@ class termgroup extends plugin if(preg_match("/(w|t|s)/i",$allobs[$key]['type'])){ $ldap->cd ($key); $ldap->modify($attrs); - show_ldap_error($ldap->get_error(),sprintf(_("Setting action state (FAIstate) failed for object '%s', value was '%s'."),$key,$action)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $key->dn, LDAP_MOD, get_class())); + } } } } @@ -236,7 +238,8 @@ class termgroup extends plugin $ldap->cd($dn); $ldap->modify($attrs); - show_ldap_error($ldap->get_error(), sprintf(_("Saving of system workstation/generic (FAIstate) with dn '%s' failed."),$dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $dn, LDAP_MOD, get_class())); } } } @@ -367,7 +370,9 @@ class termgroup extends plugin if(!$this->didAction){ $this->handle_post_events("modify"); } - show_ldap_error($ldap->get_error(), _("Saving workstation failed")); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } } diff --git a/gosa-plugins/goto/admin/systems/goto/class_ArpNewDevice.inc b/gosa-plugins/goto/admin/systems/goto/class_ArpNewDevice.inc index 7bc8128eb..455406ae8 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_ArpNewDevice.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_ArpNewDevice.inc @@ -65,7 +65,9 @@ class ArpNewDevice extends plugin $ldap = $this->config->get_ldap_link(); $ldap->cd($this->config->current['BASE']); $ldap->rmdir_recursive($this->dn); - show_ldap_error($ldap->get_error(),_("Could not remove arp-alert device after writing dns and dhcp configuration.")); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $key->dn, LDAP_DEL, get_class())); + } } } diff --git a/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc index 756b90c9a..0b89ef20e 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc @@ -595,7 +595,9 @@ class printgeneric extends plugin new log("remove","printer/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of system print/generic with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class())); + } $this->handle_post_events("remove",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); /* Delete references to object groups */ @@ -851,7 +853,9 @@ class printgeneric extends plugin $this->handle_post_events("modify",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); new log("modify","printer/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of system print/generic with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } if(preg_match("/printer/i",$this->BelongsTo)){ $this->netConfigDNS->cn = $this->cn; diff --git a/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc index 5d1f47366..7928972f7 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc @@ -316,7 +316,9 @@ class termgeneric extends plugin new log("remove","terminal/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of object system terminal/generic with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class())); + } /* Optionally execute a command after we're done */ $this->handle_post_events("remove",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); @@ -517,7 +519,9 @@ class termgeneric extends plugin $this->netConfigDNS->cn = $this->cn; $this->netConfigDNS->save(); - show_ldap_error($ldap->get_error(), sprintf(_("Saving of object system terminal/generic with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } /* Send installation activation */ diff --git a/gosa-plugins/goto/admin/systems/goto/class_terminalService.inc b/gosa-plugins/goto/admin/systems/goto/class_terminalService.inc index 043c1920c..63fe1fce1 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_terminalService.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_terminalService.inc @@ -443,7 +443,9 @@ class termservice extends plugin $ldap = $this->config->get_ldap_link(); $ldap->cd($this->dn); $ldap->modify($this->attrs); - show_ldap_error($ldap->get_error(),_("Could not remove terminal service.")); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } } @@ -582,7 +584,9 @@ class termservice extends plugin $ldap->modify ($this->attrs); new log("modify","terminal/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Saving of object system terminal/service with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } $this->handle_post_events("modify"); } diff --git a/gosa-plugins/goto/admin/systems/goto/class_terminalStartup.inc b/gosa-plugins/goto/admin/systems/goto/class_terminalStartup.inc index f8289e76b..c0d4a5803 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_terminalStartup.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_terminalStartup.inc @@ -440,7 +440,9 @@ class termstartup extends plugin new log("modify","terminal/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Saving of system terminal/startup with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } $this->handle_post_events("modify"); /* Send ldap configuration update diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc index a103b807b..4a9290e10 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc @@ -322,7 +322,9 @@ class workgeneric extends plugin $ldap= $this->config->get_ldap_link(); $ldap->rmdir($this->dn); new log("remove","workstation/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of system workstation/generic with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class())); + } /* Optionally execute a command after we're done */ $this->handle_post_events("remove", array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); @@ -502,7 +504,9 @@ class workgeneric extends plugin $ldap->cd($this->dn); $ldap->add($this->attrs); new log("create","workstation/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Saving of system workstation/generic with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } $this->handle_post_events("add",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); } else { if ($this->orig_dn != $this->dn){ @@ -511,6 +515,9 @@ class workgeneric extends plugin $ldap->cd($this->dn); $this->cleanup(); $ldap->modify ($this->attrs); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } new log("modify","workstation/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); $this->handle_post_events("modify",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); @@ -523,7 +530,6 @@ class workgeneric extends plugin $this->netConfigDNS->cn = $this->cn; $this->netConfigDNS->save(); - show_ldap_error($ldap->get_error(), sprintf(_("Saving of system workstation/generic with dn '%s' failed."),$this->dn)); if ($activate && class_available("DaemonEvent")){ diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc index f0a883ce6..d10108a2a 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc @@ -449,7 +449,9 @@ class workservice extends plugin $this->cleanup(); $ldap->modify ($this->attrs); new log("modify","workstation/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Saving of system workstation/service with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } $this->handle_post_events("modify"); } diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc index 1fb52f333..59582f76d 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc @@ -893,7 +893,9 @@ class workstartup extends plugin $ldap->modify ($this->attrs); new log("modify","workstation/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Saving of system workstation/startup with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } $this->handle_post_events("modify"); /* Check if LDAP server has changed */ diff --git a/gosa-plugins/goto/admin/systems/services/kiosk/class_goKioskService.inc b/gosa-plugins/goto/admin/systems/services/kiosk/class_goKioskService.inc index 7b15b7946..f804633f1 100644 --- a/gosa-plugins/goto/admin/systems/services/kiosk/class_goKioskService.inc +++ b/gosa-plugins/goto/admin/systems/services/kiosk/class_goKioskService.inc @@ -228,7 +228,9 @@ class goKioskService extends goService{ $ldap->cd($this->config->current['BASE']); $ldap->cd($this->dn); $ldap->modify($this->attrs); - show_ldap_error($ldap->get_error(),_("Wohl kaum")); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } } diff --git a/gosa-plugins/goto/admin/systems/services/ntp/class_goNtpServer.inc b/gosa-plugins/goto/admin/systems/services/ntp/class_goNtpServer.inc index b179ae95b..a13f932b8 100644 --- a/gosa-plugins/goto/admin/systems/services/ntp/class_goNtpServer.inc +++ b/gosa-plugins/goto/admin/systems/services/ntp/class_goNtpServer.inc @@ -94,7 +94,9 @@ class goNtpServer extends goService{ $ldap->cd($this->dn); $ldap->add($this->attrs); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving server services/goNtpServer with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } if($this->initially_was_account){ $this->handle_post_events("modify"); new log("modify","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); diff --git a/gosa-plugins/goto/admin/systems/services/shares/class_goShareServer.inc b/gosa-plugins/goto/admin/systems/services/shares/class_goShareServer.inc index 105076c95..b29744a66 100644 --- a/gosa-plugins/goto/admin/systems/services/shares/class_goShareServer.inc +++ b/gosa-plugins/goto/admin/systems/services/shares/class_goShareServer.inc @@ -188,7 +188,9 @@ class goShareServer extends goService{ $ldap->cd($this->dn); $ldap->add($this->attrs); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of system server/shares with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } if($this->initially_was_account){ $this->handle_post_events("modify"); new log("modify","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); @@ -259,7 +261,9 @@ class goShareServer extends goService{ if (count($attrs) == 0) { $ldap->cd($mountsdn); $ldap->add($mounts); - show_ldap_error($ldap->get_error(), sprintf(_("Creating system server/shares (mount container) with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_ADD, get_class())); + } new log("modify","server/".get_class($this),$mountsdn,array_keys($mounts),$ldap->get_error()); } @@ -273,7 +277,9 @@ class goShareServer extends goService{ if (count($attrs) != 0) { $ldap->rmdir($mountdn); - show_ldap_error($ldap->get_error(), sprintf(_("Removing system server/shares (mount container) with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $mountdn, LDAP_DEL, get_class())); + } new log("remove","server/".get_class($this),$mountdn,array_keys($mount),$ldap->get_error()); } } @@ -284,7 +290,9 @@ class goShareServer extends goService{ $mountdn = "cn=".$mount["cn"].","."$mountsdn"; $ldap->cd($mountdn); $ldap->add($mount); - show_ldap_error($ldap->get_error(), sprintf(_("Saving system server/shares (mount container) with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $mount, LDAP_ADD, get_class())); + } new log("create","server/".get_class($this),$mountdn,array_keys($mount),$ldap->get_error()); } } diff --git a/gosa-plugins/goto/admin/systems/services/terminal/class_goTerminalServer.inc b/gosa-plugins/goto/admin/systems/services/terminal/class_goTerminalServer.inc index 0dc4184cb..463d9a48b 100644 --- a/gosa-plugins/goto/admin/systems/services/terminal/class_goTerminalServer.inc +++ b/gosa-plugins/goto/admin/systems/services/terminal/class_goTerminalServer.inc @@ -102,7 +102,9 @@ class goTerminalServer extends goService{ $ldap->cd($this->dn); $ldap->add($this->attrs); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving server services/terminalServer with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } if($this->initially_was_account){ $this->handle_post_events("modify"); new log("modify","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); diff --git a/gosa-plugins/goto/personal/environment/class_environment.inc b/gosa-plugins/goto/personal/environment/class_environment.inc index 775cd3ed1..deb06944b 100644 --- a/gosa-plugins/goto/personal/environment/class_environment.inc +++ b/gosa-plugins/goto/personal/environment/class_environment.inc @@ -1019,7 +1019,9 @@ class environment extends plugin new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); } - show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/environment account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } /* Optionally execute a command after we're done */ $this->handle_post_events("remove",array("uid" => $this->uid)); @@ -1276,7 +1278,9 @@ class environment extends plugin new log("create",$cat."/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/environment account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } $this->handle_post_events($mode,array("uid"=>$this->uid)); } diff --git a/gosa-plugins/heimdal/admin/systems/services/kerberos/class_password-methods-heimdal.inc b/gosa-plugins/heimdal/admin/systems/services/kerberos/class_password-methods-heimdal.inc index 05e9dc568..bcc87fe19 100644 --- a/gosa-plugins/heimdal/admin/systems/services/kerberos/class_password-methods-heimdal.inc +++ b/gosa-plugins/heimdal/admin/systems/services/kerberos/class_password-methods-heimdal.inc @@ -143,7 +143,9 @@ class passwordMethodheimdal extends passwordMethod $ldap->cat($this->dn,array("dn")); if($ldap->count()){ $ldap->rmdir($this->dn); - show_ldap_error($ldap->get_error(),_("Tried to remove heimdal extension.")); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class())); + } } } } @@ -402,7 +404,9 @@ class passwordMethodheimdal extends passwordMethod }else{ $ldap->modify($data); } - show_ldap_error($ldap->get_error(),_("Could not add or update heimdal extensions.")); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $dn, 0, get_class())); + } } } } diff --git a/gosa-plugins/kolab/admin/systems/services/kolab/class_servKolab.inc b/gosa-plugins/kolab/admin/systems/services/kolab/class_servKolab.inc index 6e665b66d..02a546cfb 100644 --- a/gosa-plugins/kolab/admin/systems/services/kolab/class_servKolab.inc +++ b/gosa-plugins/kolab/admin/systems/services/kolab/class_servKolab.inc @@ -190,7 +190,9 @@ class servkolab extends goService { /* Remove complete entry */ $ldap->rmdir ($this->dn); - show_ldap_error($ldap->get_error(), sprintf(_("Removing host entry from system server/kolab with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class())); + } } else { /* Only modify kolabHost */ @@ -204,7 +206,9 @@ class servkolab extends goService { $ldap->cd($this->dn); $this->cleanup(); $ldap->modify ($attrs); - show_ldap_error($ldap->get_error(), sprintf(_("Removing host entry from system server/kolab with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } } new log("remove","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); @@ -349,7 +353,9 @@ class servkolab extends goService { new log("modify","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving system server/kolab with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } /* Optionally execute a command after we're done */ if ($this->initially_was_account == $this->is_account) { diff --git a/gosa-plugins/kolab/personal/connectivity/kolab/class_kolabAccount.inc b/gosa-plugins/kolab/personal/connectivity/kolab/class_kolabAccount.inc index d1d54190e..d4b40b295 100644 --- a/gosa-plugins/kolab/personal/connectivity/kolab/class_kolabAccount.inc +++ b/gosa-plugins/kolab/personal/connectivity/kolab/class_kolabAccount.inc @@ -329,7 +329,9 @@ class kolabAccount extends plugin new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); $this->handle_post_events('remove',array("uid" => $this->uid)); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/kolab account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } } @@ -464,7 +466,9 @@ class kolabAccount extends plugin new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/kolab account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } /* Optionally execute a command after we're done */ if ($this->initially_was_account == $this->is_account){ diff --git a/gosa-plugins/mail/admin/groups/mail/class_groupMail.inc b/gosa-plugins/mail/admin/groups/mail/class_groupMail.inc index bd8dbb3e9..2b95184f6 100644 --- a/gosa-plugins/mail/admin/groups/mail/class_groupMail.inc +++ b/gosa-plugins/mail/admin/groups/mail/class_groupMail.inc @@ -751,7 +751,9 @@ class mailgroup extends plugin $ldap->cd($this->dn); $ldap->modify ($this->attrs); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of groups/mail with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } new log("remove","groups/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); @@ -983,7 +985,9 @@ I: Only insider delivery */ $ldap->cd($this->dn); $this->cleanup(); $ldap->modify ($this->attrs); - show_ldap_error($ldap->get_error(), sprintf(_("Saving of groups/mail with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } if($this->initially_was_account){ new log("modify","groups/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); diff --git a/gosa-plugins/mail/admin/ogroups/mail/class_mailogroup.inc b/gosa-plugins/mail/admin/ogroups/mail/class_mailogroup.inc index 85aadf3e7..ab20b922f 100644 --- a/gosa-plugins/mail/admin/ogroups/mail/class_mailogroup.inc +++ b/gosa-plugins/mail/admin/ogroups/mail/class_mailogroup.inc @@ -115,7 +115,9 @@ class mailogroup extends plugin new log("create","ogroups/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of object group/mail with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } /* Optionally execute a command after we're done */ if ($this->initially_was_account == $this->is_account){ @@ -150,7 +152,9 @@ class mailogroup extends plugin new log("remove","ogroups/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of object group/mail with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } } diff --git a/gosa-plugins/mail/admin/systems/services/mail/class_goMailServer.inc b/gosa-plugins/mail/admin/systems/services/mail/class_goMailServer.inc index 9180cfa54..2b89ca8a8 100644 --- a/gosa-plugins/mail/admin/systems/services/mail/class_goMailServer.inc +++ b/gosa-plugins/mail/admin/systems/services/mail/class_goMailServer.inc @@ -578,7 +578,10 @@ class goMailServer extends goService{ $ldap->cd($this->dn); $ldap->add($this->attrs); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving server services/mail with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } + if($this->initially_was_account){ $this->handle_post_events("modify"); new log("modify","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); diff --git a/gosa-plugins/mail/admin/systems/services/spam/class_goSpamServer.inc b/gosa-plugins/mail/admin/systems/services/spam/class_goSpamServer.inc index 31fe828d0..be993d6ca 100644 --- a/gosa-plugins/mail/admin/systems/services/spam/class_goSpamServer.inc +++ b/gosa-plugins/mail/admin/systems/services/spam/class_goSpamServer.inc @@ -274,7 +274,9 @@ class gospamserver extends goService{ new log("create","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of server services/spamassassin with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } } function check() diff --git a/gosa-plugins/mail/admin/systems/services/virus/class_goVirusServer.inc b/gosa-plugins/mail/admin/systems/services/virus/class_goVirusServer.inc index f91c5f5ae..e95b05b12 100644 --- a/gosa-plugins/mail/admin/systems/services/virus/class_goVirusServer.inc +++ b/gosa-plugins/mail/admin/systems/services/virus/class_goVirusServer.inc @@ -150,7 +150,9 @@ class govirusserver extends goService{ new log("create","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of server services/anti virus with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } } function check() diff --git a/gosa-plugins/mail/personal/mail/class_mailAccount.inc b/gosa-plugins/mail/personal/mail/class_mailAccount.inc index 2f16c6dd2..63cf3260e 100644 --- a/gosa-plugins/mail/personal/mail/class_mailAccount.inc +++ b/gosa-plugins/mail/personal/mail/class_mailAccount.inc @@ -686,7 +686,9 @@ class mailAccount extends plugin /* Add "view" to logging class */ new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/mail account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } /* Connect to IMAP server for account deletion */ if ($this->gosaMailServer != ""){ @@ -852,7 +854,9 @@ class mailAccount extends plugin $this->cleanup(); $ldap->modify ($this->attrs); - show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/mail account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } /* Log last action */ if($this->initially_was_account){ diff --git a/gosa-plugins/nagios/personal/nagios/class_nagiosAccount.inc b/gosa-plugins/nagios/personal/nagios/class_nagiosAccount.inc index 1b7b580e5..9a10451b2 100644 --- a/gosa-plugins/nagios/personal/nagios/class_nagiosAccount.inc +++ b/gosa-plugins/nagios/personal/nagios/class_nagiosAccount.inc @@ -169,7 +169,9 @@ class nagiosAccount extends plugin new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/nagios account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } /* Optionally execute a command after we're done */ if ($this->initially_was_account == $this->is_account){ @@ -252,7 +254,9 @@ class nagiosAccount extends plugin new log("view","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/nagios account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } /* remove the entry from LDAP */ unset ($this->attrs['uid']); diff --git a/gosa-plugins/netatalk/personal/netatalk/class_netatalk.inc b/gosa-plugins/netatalk/personal/netatalk/class_netatalk.inc index 59b67c257..d4298095b 100644 --- a/gosa-plugins/netatalk/personal/netatalk/class_netatalk.inc +++ b/gosa-plugins/netatalk/personal/netatalk/class_netatalk.inc @@ -284,7 +284,9 @@ class netatalk extends plugin { new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/netatalk account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } /* Optionally execute a command after we're done */ if ($this->initially_was_account == $this->is_account) { @@ -346,7 +348,9 @@ class netatalk extends plugin { new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/netatalk account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } /* remove the entry from LDAP */ unset ($this->attrs['uid']); diff --git a/gosa-plugins/openxchange/personal/connectivity/openxchange/class_oxchangeAccount.inc b/gosa-plugins/openxchange/personal/connectivity/openxchange/class_oxchangeAccount.inc index e7ab39c2a..5ff347c9b 100644 --- a/gosa-plugins/openxchange/personal/connectivity/openxchange/class_oxchangeAccount.inc +++ b/gosa-plugins/openxchange/personal/connectivity/openxchange/class_oxchangeAccount.inc @@ -737,7 +737,9 @@ class oxchangeAccount extends plugin if($ldap->dn_exists("ou=addr,".$this->dn)){ $ldap->rmdir_recursive("ou=addr,".$this->dn); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/oxchange addressbook account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class())); + } } $ldap->cd($this->dn); @@ -748,7 +750,9 @@ class oxchangeAccount extends plugin new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/oxchange addressbook account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } /* Optionally execute a command after we're done */ $this->postremove(array("uid" => $this->uid)); @@ -852,14 +856,19 @@ class oxchangeAccount extends plugin new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/oxchange account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } /* Optionally execute a command after we're done */ $this->postcreate(array("uid" => $this->uid)); if($needupdate){ $ldap->create_missing_trees("ou=addr,".$this->dn); - show_ldap_error($ldap->get_error(), sprintf(_("Creating of user/oxchange account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } + /* Finally save data to postgresql server */ pg_set_client_encoding ("UNICODE"); $nv = "SELECT nextval ('serial_id')"; diff --git a/gosa-plugins/phpgw/personal/connectivity/phpgw/class_phpgwAccount.inc b/gosa-plugins/phpgw/personal/connectivity/phpgw/class_phpgwAccount.inc index 0e2ac36b1..51d11f798 100644 --- a/gosa-plugins/phpgw/personal/connectivity/phpgw/class_phpgwAccount.inc +++ b/gosa-plugins/phpgw/personal/connectivity/phpgw/class_phpgwAccount.inc @@ -81,7 +81,9 @@ class phpgwAccount extends plugin $this->cleanup(); $ldap->modify ($this->attrs); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/PHPgw account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); @@ -135,7 +137,9 @@ class phpgwAccount extends plugin new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/PHPgw account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } /* Optionally execute a command after we're done */ if ($this->initially_was_account == $this->is_account){ diff --git a/gosa-plugins/phpscheduleit/personal/connectivity/phpscheduleit/class_phpscheduleitAccount.inc b/gosa-plugins/phpscheduleit/personal/connectivity/phpscheduleit/class_phpscheduleitAccount.inc index 41454ea7c..521dbf71c 100644 --- a/gosa-plugins/phpscheduleit/personal/connectivity/phpscheduleit/class_phpscheduleitAccount.inc +++ b/gosa-plugins/phpscheduleit/personal/connectivity/phpscheduleit/class_phpscheduleitAccount.inc @@ -82,7 +82,9 @@ class phpscheduleitAccount extends plugin $this->attributes, "Save"); $this->cleanup(); $ldap->modify ($this->attrs); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/PHPscheduleit account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } if($this->is_account){ new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); @@ -137,7 +139,9 @@ class phpscheduleitAccount extends plugin new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/PHPscheduleit account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } /* Optionally execute a command after we're done */ if ($this->initially_was_account == $this->is_account){ diff --git a/gosa-plugins/pptp/personal/connectivity/pptp/class_pptpAccount.inc b/gosa-plugins/pptp/personal/connectivity/pptp/class_pptpAccount.inc index 0c8c659cf..70318d8a9 100644 --- a/gosa-plugins/pptp/personal/connectivity/pptp/class_pptpAccount.inc +++ b/gosa-plugins/pptp/personal/connectivity/pptp/class_pptpAccount.inc @@ -98,7 +98,9 @@ class pptpAccount extends plugin /* Log last action */ new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/PPTP account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } /* Optionally execute a command after we're done */ $this->handle_post_events('remove',array("uid" => $this->uid)); @@ -152,7 +154,9 @@ class pptpAccount extends plugin new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/PPTP account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } /* Optionally execute a command after we're done */ if ($this->initially_was_account == $this->is_account){ diff --git a/gosa-plugins/pureftpd/personal/connectivity/pureftpd/class_pureftpdAccount.inc b/gosa-plugins/pureftpd/personal/connectivity/pureftpd/class_pureftpdAccount.inc index 9dacc059b..65927191a 100644 --- a/gosa-plugins/pureftpd/personal/connectivity/pureftpd/class_pureftpdAccount.inc +++ b/gosa-plugins/pureftpd/personal/connectivity/pureftpd/class_pureftpdAccount.inc @@ -135,7 +135,9 @@ class pureftpdAccount extends plugin /* Log last action */ new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/pureftpd account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } /* Optionally execute a command after we're done */ $this->handle_post_events('remove',array("uid" => $this->uid)); @@ -234,7 +236,9 @@ class pureftpdAccount extends plugin new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/pureftpd account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } /* Optionally execute a command after we're done */ if ($this->initially_was_account == $this->is_account){ diff --git a/gosa-plugins/samba/admin/systems/samba/class_winGeneric.inc b/gosa-plugins/samba/admin/systems/samba/class_winGeneric.inc index a999a1dba..295698d34 100644 --- a/gosa-plugins/samba/admin/systems/samba/class_winGeneric.inc +++ b/gosa-plugins/samba/admin/systems/samba/class_winGeneric.inc @@ -149,7 +149,9 @@ class wingeneric extends plugin $ldap= $this->config->get_ldap_link(); $ldap->rmdir($this->dn); new log("remove","winworkstation/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of system wingeneric/generic with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class())); + } $this->handle_post_events("remove"); /* Delete references to object groups */ @@ -267,7 +269,9 @@ class wingeneric extends plugin $this->netConfigDNS->cn = preg_replace("/\\\$\$/","",$this->cn); $this->netConfigDNS->save(); - show_ldap_error($ldap->get_error(), sprintf(_("Saving of system wingeneric/generic with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } /* Optionally execute a command after we're done */ $this->postcreate(); diff --git a/gosa-plugins/samba/personal/samba/class_sambaAccount.inc b/gosa-plugins/samba/personal/samba/class_sambaAccount.inc index 0f37c46ae..3d0445c7a 100644 --- a/gosa-plugins/samba/personal/samba/class_sambaAccount.inc +++ b/gosa-plugins/samba/personal/samba/class_sambaAccount.inc @@ -722,7 +722,9 @@ class sambaAccount extends plugin new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/samba account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } /* Optionally execute a command after we're done */ $this->handle_post_events("remove", array("uid" => $this->uid)); @@ -1080,7 +1082,9 @@ class sambaAccount extends plugin new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/samba account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } /* Optionally execute a command after we're done */ if ($this->initially_was_account == $this->is_account){ diff --git a/gosa-plugins/scalix/personal/scalix/class_scalixAccount.inc b/gosa-plugins/scalix/personal/scalix/class_scalixAccount.inc index 4c83e427d..dd00a6e2f 100644 --- a/gosa-plugins/scalix/personal/scalix/class_scalixAccount.inc +++ b/gosa-plugins/scalix/personal/scalix/class_scalixAccount.inc @@ -222,7 +222,9 @@ class scalixAccount extends plugin @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,$this->attributes, "Save"); $ldap->cd($this->dn); $ldap->modify($this->attrs); - show_ldap_error($ldap->get_error()); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } /* Optionally execute a command after we're done */ $this->handle_post_events("remove"); @@ -323,7 +325,9 @@ class scalixAccount extends plugin /* Save data to LDAP */ $ldap->cd($this->dn); $ldap->modify($this->attrs); - show_ldap_error($ldap->get_error()); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } /* Optionally execute a command after we're done */ if ($this->initially_was_account == $this->is_account){ diff --git a/gosa-plugins/squid/personal/connectivity/squid/class_proxyAccount.inc b/gosa-plugins/squid/personal/connectivity/squid/class_proxyAccount.inc index 4672365d5..181b5d4ae 100644 --- a/gosa-plugins/squid/personal/connectivity/squid/class_proxyAccount.inc +++ b/gosa-plugins/squid/personal/connectivity/squid/class_proxyAccount.inc @@ -171,7 +171,9 @@ class proxyAccount extends plugin /* Log last action */ new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/proxy account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } /* Optionally execute a command after we're done */ $this->handle_post_events("remove",array("uid" => $this->uid)); @@ -295,7 +297,9 @@ class proxyAccount extends plugin new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/proxy account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } /* Optionally execute a command after we're done */ if ($this->initially_was_account == $this->is_account){ diff --git a/gosa-plugins/systems/admin/systems/class_componentGeneric.inc b/gosa-plugins/systems/admin/systems/class_componentGeneric.inc index 5815a4a90..dbd26c814 100644 --- a/gosa-plugins/systems/admin/systems/class_componentGeneric.inc +++ b/gosa-plugins/systems/admin/systems/class_componentGeneric.inc @@ -151,7 +151,10 @@ class componentGeneric extends plugin new log("remove","component/".get_class($this),$this->dn,$this->attributes,$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of system component/generic with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class())); + } + $this->handle_post_events(array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); /* Delete references to object groups */ @@ -285,7 +288,9 @@ class componentGeneric extends plugin $this->netConfigDNS->cn = $this->cn; $this->netConfigDNS->save(); - show_ldap_error($ldap->get_error(), sprintf(_("Saving of system component/generic with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } } /* Return plugin informations for acl handling */ diff --git a/gosa-plugins/systems/admin/systems/class_servGeneric.inc b/gosa-plugins/systems/admin/systems/class_servGeneric.inc index f3ad76fad..54256514a 100644 --- a/gosa-plugins/systems/admin/systems/class_servGeneric.inc +++ b/gosa-plugins/systems/admin/systems/class_servGeneric.inc @@ -230,7 +230,9 @@ class servgeneric extends plugin new log("remove","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of system server/generic with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } /* Delete references to object groups */ $ldap->cd ($this->config->current['BASE']); @@ -364,7 +366,9 @@ class servgeneric extends plugin $mode= "modify"; } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of system server/generic with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class())); + } $this->netConfigDNS->cn = $this->cn; $this->netConfigDNS->save(); diff --git a/gosa-plugins/systems/admin/systems/class_termDNS.inc b/gosa-plugins/systems/admin/systems/class_termDNS.inc index 25bf4e4b5..eddac1555 100644 --- a/gosa-plugins/systems/admin/systems/class_termDNS.inc +++ b/gosa-plugins/systems/admin/systems/class_termDNS.inc @@ -425,7 +425,9 @@ class termDNS extends plugin $ldap->cd($dn); $ldap->rmdir_recursive($dn); new log("remove","unknown/".get_class($this),$dn); - show_ldap_error($ldap->get_error(), sprintf(_("Could not remove dns extension for '%s'."),$dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $dn, LDAP_DEL, get_class())); + } } } } @@ -681,7 +683,9 @@ class termDNS extends plugin /* DHCP removed */ if($this->initial_dhcp_is_Account && !$this->dhcp_is_Account){ $ldap->rmdir_recursive($this->dhcpHostEntry['dn']); - show_ldap_error($ldap->get_error(),_("Removing dhcp entry for this object failed.")); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dhcpHostEntry['dn'], LDAP_DEL, get_class())); + } $tmp = new servdhcp($this->config,$this->dhcpParentNode); $tmp->handle_post_events("remove"); @@ -698,7 +702,9 @@ class termDNS extends plugin $tmp = new servdhcp($this->config,$this->dhcpParentNode); $tmp->handle_post_events("add"); - show_ldap_error($ldap->get_error(),_("Tried to add new dhcp entry failed.")); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), "cn=".$this->cn.",".$this->dhcpParentNode, LDAP_ADD, get_class())); + } } /* DHCP still activated */ @@ -717,10 +723,14 @@ class termDNS extends plugin $tmp = new servdhcp($this->config,$this->dhcpParentNode); $tmp->handle_post_events("modify"); - show_ldap_error($ldap->get_error(),_("Tried to add new dhcp entry failed.")); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), "cn=".$this->cn.",".$this->dhcpParentNode, LDAP_ADD, get_class())); + } if($res){ $ldap->rmdir_recursive($this->dhcpHostEntry['dn']); - show_ldap_error($ldap->get_error(),_("Removing old dhcp entry failed.")); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dhcpHostEntry['dn'], LDAP_DEL, get_class())); + } } } @@ -736,7 +746,9 @@ class termDNS extends plugin $tmp = new servdhcp($this->config,$this->dhcpParentNode); $tmp->handle_post_events("modify"); - show_ldap_error($ldap->get_error(),_("Modifying dhcp entry failed.")); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dhcpHostEntry['dn'], LDAP_MOD, get_class())); + } } } } @@ -806,8 +818,8 @@ class termDNS extends plugin /* Display errors */ - if($ldap->get_error() != "Success"){ - show_ldap_error($ldap->get_error(), sprintf(_("Saving of terminal/dns account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $dn, 0, get_class())); } $tmp2 = new servdns($this->config,$this->dn); diff --git a/gosa-plugins/systems/admin/systems/services/class_goService.inc b/gosa-plugins/systems/admin/systems/services/class_goService.inc index 9c459d938..7741a1cb0 100644 --- a/gosa-plugins/systems/admin/systems/services/class_goService.inc +++ b/gosa-plugins/systems/admin/systems/services/class_goService.inc @@ -115,7 +115,9 @@ class goService extends plugin{ new log("remove","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of server services/".get_class($this)." - (".$this->DisplayName.") with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } $this->handle_post_events("remove"); } @@ -141,7 +143,9 @@ class goService extends plugin{ $this->handle_post_events("add"); new log("create","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of server services/".get_class($this)." - (".$this->DisplayName.") with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } } @@ -172,7 +176,9 @@ class goService extends plugin{ $attrs[$flag] = $value; $this->$flag = $value; $ldap->modify($attrs); - show_ldap_error($ldap->get_error(), sprintf(_("Set status flag for server services/".get_class($this)." - (".$this->DisplayName.") with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } $this->action_hook(); } } diff --git a/gosa-plugins/webdav/personal/connectivity/webdav/class_webdavAccount.inc b/gosa-plugins/webdav/personal/connectivity/webdav/class_webdavAccount.inc index 4d7c179de..a16ce246a 100644 --- a/gosa-plugins/webdav/personal/connectivity/webdav/class_webdavAccount.inc +++ b/gosa-plugins/webdav/personal/connectivity/webdav/class_webdavAccount.inc @@ -80,7 +80,9 @@ class webdavAccount extends plugin /* Log last action */ new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/webDAV account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } /* Optionally execute a command after we're done */ $this->handle_post_events('remove',array("uid" => $this->uid)); @@ -134,7 +136,9 @@ class webdavAccount extends plugin new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/webDAV account with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + } /* Optionally execute a command after we're done */ if ($this->initially_was_account == $this->is_account){ -- 2.30.2