From: hickert Date: Fri, 9 Apr 2010 15:07:41 +0000 (+0000) Subject: Updated macro editing X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8badf9a4726a528459a388f8c2609693a3be67db;p=gosa.git Updated macro editing -Save LDAP entries even if mysql-transactions fails ... else we loss all macro changes. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17569 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/gofon/gofon/macro/class_gofonMacro.inc b/gosa-plugins/gofon/gofon/macro/class_gofonMacro.inc index 64c36bf49..725df304a 100644 --- a/gosa-plugins/gofon/gofon/macro/class_gofonMacro.inc +++ b/gosa-plugins/gofon/gofon/macro/class_gofonMacro.inc @@ -508,35 +508,35 @@ class macro extends plugin $str = $this->add_to_database(true); if($str){ msg_dialog::display(_("Error"), $str, ERROR_DIALOG); - }else{ - /* Write back to ldap */ - $ldap= $this->config->get_ldap_link(); - $ldap->cat($this->dn, array('dn')); - $a= $ldap->fetch(); + } + + /* Write back to ldap */ + $ldap= $this->config->get_ldap_link(); + $ldap->cat($this->dn, array('dn')); + $a= $ldap->fetch(); - if (count($a)){ + if (count($a)){ $ldap->cd($this->dn); $this->cleanup(); $ldap->modify ($this->attrs); $this->handle_post_events("modify"); - } else { + } else { $ldap->cd($this->config->current['BASE']); $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn)); $ldap->cd($this->dn); $ldap->add($this->attrs); $this->handle_post_events("add"); - } - if (!$ldap->success()){ + } + 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){ + /* Log last action */ + if($this->initially_was_account){ new log("modify","gofonmacro/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - }else{ + }else{ new log("create","gofonmacro/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - } } }