diff --git a/plugins/admin/systems/class_servService.inc b/plugins/admin/systems/class_servService.inc
index b596f22cb485a7bce37d282a3de479636afa2544..22fb7ba96afc9c7cd624c7a21177d3b8924d9fd2 100644 (file)
foreach ($this->attributes as $attr){
$smarty->assign("$attr", $this->$attr);
$smarty->assign("$attr"."ACL", chkacl($this->acl, $attr));
- if($this->$attr)
- $smarty->assign($attr."State","");
- else
- $smarty->assign($attr."State","disabled");
+ $smarty->assign($attr."State","");
}
} else {
$smarty->assign("$oc", "");
- $smarty->assign("$oc"."ACL", "");
+ $smarty->assign("$oc"."ACL", chkacl($this->acl, $oc));
$smarty->assign("$oc"."State", "disabled");
}
}
/* Save data to object */
function save_object()
{
- plugin::save_object();
-
- /* Save checkbox state */
- foreach ($this->additionaloc as $oc => $dummy){
- if (isset($_POST[$oc]) && $_POST[$oc] == '1'){
- $this->objectclasses[$oc]= $oc;
- } else {
- unset($this->objectclasses[$oc]);
+ if (isset($_POST['servicetab'])){
+ plugin::save_object();
+
+ /* Save checkbox state */
+ foreach ($this->additionaloc as $oc => $dummy){
+ if (isset($_POST[$oc]) && $_POST[$oc] == '1'){
+ $this->objectclasses[$oc]= $oc;
+ } else {
+ unset($this->objectclasses[$oc]);
+ }
}
}
}
}
$this->attrs = array_reverse($this->attrs);
+
+ /* Check if we are able to set these attributes */
+#fixme : It Would be better to check ObjectClass rights to, but what is to do if there are insuficient rights
+ foreach($this->additionaloc as $oc => $attrs)
+ {
+ foreach($attrs as $val)
+ {
+ if(chkacl($this->acl,$val)=="")
+ {
+ unset($this->attrs[$val]);
+ unset($this->$val);
+ }
+ }
+ }
-// print_a($this->attrs);
-
/* Write to LDAP */
$ldap= $this->config->get_ldap_link();
$ldap->cd($this->dn);
} else {
$this->handle_post_events("add");
}
-
}
}