index a3976d254e099afc1c05d757d3add7badb22c478..65871611b31db6f43195d4ea74c3c9d924ceaa8b 100644 (file)
$ldap = $this->config->get_ldap_link();
$ldap->cd ($this->dn);
$ldap->rmdir_recursive($this->dn);
+ show_ldap_error($ldap->get_error(), _("Removing FAI profile failed"));
$this->handle_post_events("remove");
}
$ldap = $this->config->get_ldap_link();
$ldap->cd($_SESSION['CurrentMainBase']);
- $ldap->search("(&(objectClass=FAIprofile)(cn=".$this->cn.")(!cn=".$this->old_cn."))",array("*"));
+ if ($this->old_cn == ""){
+ $ldap->search("(&(objectClass=FAIprofile)(cn=".$this->cn."))",array("*"));
+ } else {
+ $ldap->search("(&(objectClass=FAIprofile)(cn=".$this->cn.")(!cn=".$this->old_cn."))",array("*"));
+ }
if($ldap->count()){
$message[]=_("There is already a profile with this class name defined.");
$this->attrs['FAIclass']=trim($this->FAIclass);
- $ldap->cat($this->dn);
+ $ldap->cat($this->dn,array("objectClass"));
if($ldap->count()!=0){
/* Write FAIscript to ldap*/
$ldap->cd($this->dn);
$this->cleanup();
-$ldap->modify ($this->attrs);
-
+ $ldap->modify ($this->attrs);
}else{
/* Write FAIscript to ldap*/
$ldap->cd($this->config->current['BASE']);
$ldap->cd($this->dn);
$ldap->add($this->attrs);
}
- show_ldap_error($ldap->get_error());
+ show_ldap_error($ldap->get_error(), _("Saving FAI profile failed"));
/* Do object tagging */
$this->handle_object_tagging();