index dfa0f784fbbb2260a9edd3577c684bfe814bebe0..7a35f41db24fe33c231f1141411884aea1aebc2a 100644 (file)
foreach ($this->additionaloc as $oc => $dummy){
if (isset($this->objectclasses[$oc])){
$smarty->assign("$oc", "checked");
+ $smarty->assign("$oc"."State", "");
$smarty->assign("$oc"."ACL", chkacl($this->acl, $oc));
+
} else {
+ $smarty->assign("$oc", "");
+ $smarty->assign("$oc"."ACL", chkacl($this->acl, $oc));
$smarty->assign("$oc"."State", "disabled");
}
}
foreach($this->objectclasses as $oc){
$objectclasses[]= $oc;
}
- $this->objectclasses= $objectclasses;
+
plugin::save();
-
- /* Remove objectclasses */
- unset ($this->attrs['objectClass']);
- foreach($this->objectclasses as $oc){
- $this->attrs['objectClass'][]= $oc;
- }
+
- /* Adapt sieve server if needed */
- if (in_array('goImapServer', $this->objectclasses)){
- $this->attrs['goImapSieveServer']= preg_replace('/:.*$/', '',
- preg_replace('/^{([^}]+)}$/', '\\1',
- $this->attrs['goImapConnect']));
+
+ $test = $this->objectclasses;
+ $tmp = array_flip($this->attrs['objectClass']);
+
+ foreach($this->additionaloc as $key=>$val) {
+ unset($tmp[$key]);
+ }
+
+ $classes = (array_flip(array_merge(array_flip($test),$tmp)));
+
+ unset($this->attrs['objectClass']);
+
+ foreach($classes as $class){
+ $this->attrs['objectClass'][]=$class;
}
+
/* Remove unneeded attributes */
foreach ($this->additionaloc as $oc => $attrs){
- if (!in_array($oc, $this->objectclasses)){
+ if (!in_array($oc, $this->attrs['objectClass'])){
foreach ($attrs as $attr){
$this->attrs[$attr]= array();
}
}
}
+ $this->attrs = array_reverse($this->attrs);
+
+
/* Write to LDAP */
$ldap= $this->config->get_ldap_link();