Code

Moved conferences from base to ,ou=conferences,ou=asterisk,ou=configs,ou=systems,
[gosa.git] / plugins / gofon / conference / class_phoneConferenceGeneric.inc
index 7b5fed530ba63620e7b61fb0ebf3ff3b38fdeb0b..ab70ac5fbb31b9761ceccdf276a48474b823d29a 100644 (file)
@@ -466,16 +466,17 @@ class conference extends plugin
     }
 
     $ldap= $this->config->get_ldap_link();
-
+    $ldap->cd($this->config->current['BASE']);
     $ldap->cat($this->dn, array('dn'));
-    $a= $ldap->fetch();
-    $ldap->cd($this->dn);
-    if (count($a)){
+
+    if ($ldap->count()){
+      $ldap->cd($this->dn);
       $this->cleanup();
       $ldap->modify ($this->attrs); 
-
       $this->handle_post_events('modify');
     } else {
+      $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
+      $ldap->cd($this->dn);
       $ldap->add($this->attrs);
       $this->handle_post_events('add');
     }