diff --git a/plugins/gofon/conference/class_phoneConferenceGeneric.inc b/plugins/gofon/conference/class_phoneConferenceGeneric.inc
index 7b5fed530ba63620e7b61fb0ebf3ff3b38fdeb0b..ab70ac5fbb31b9761ceccdf276a48474b823d29a 100644 (file)
}
$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');
}