index 6df1f06a5345b83b85cb5db120d4fee91719b352..40c61eb329fbc33aa2238fc939b48fbd6d67d415 100644 (file)
}
/* Get ldap connection */
- $base = $_SESSION['faifilter']['base'];
+ $base = $_SESSION['CurrentMainBase'];
$ldap->cd($base);
$sort = array();
$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");
}
/* Check supplied data */
function check()
{
- $message= array();
+ /* Call common method to give check the hook */
+ $message= plugin::check();
if(count($this->FAIclasses) == 0){
$message[]=_("Please assign at least one class to this profile.");
}
$ldap = $this->config->get_ldap_link();
- $ldap->cd($_SESSION['faifilter']['base']);
+ $ldap->cd($_SESSION['CurrentMainBase']);
$ldap->search("(&(objectClass=FAIprofile)(cn=".$this->cn.")(!cn=".$this->old_cn."))",array("*"));
if($ldap->count()){
$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(), _("Saving FAI profile failed"));
+
+ /* Do object tagging */
+ $this->handle_object_tagging();
show_ldap_error($ldap->get_error());
}
}