Code

Fixed typo
[gosa.git] / plugins / gofon / macro / class_gofonMacro.inc
index e16118e9d3c6c481209ac09103c83e5e314a24de..eca2cc524b70e61f9bd8f618db8d2e3b6acbb0fb 100755 (executable)
@@ -243,8 +243,12 @@ class macro extends plugin
                        $ldap->modify($this->attrs);
                        $this->handle_post_events("modify");
                } else {
-                       $ldap->cd($this->config->current['BASE']);
-                       $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
+                       if(count($this->attrs['goFonMacroParameter']==0)){
+                               unset($this->attrs['goFonMacroParameter']);
+                       }               
+               
+                       $ldap->cd($this->dn);
+                       $ldap->create_missing_trees( $this->dn);
                        $ldap->cd($this->dn);
                        $ldap->add($this->attrs);
                        $this->handle_post_events("add");