summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d840543)
raw | patch | inline | side by side (parent: d840543)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 28 May 2010 11:50:49 +0000 (11:50 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 28 May 2010 11:50:49 +0000 (11:50 +0000) |
-Allow to add IP and MAC info
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18785 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18785 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/samba/admin/systems/samba/class_winGeneric.inc | patch | blob | history |
diff --git a/gosa-plugins/samba/admin/systems/samba/class_winGeneric.inc b/gosa-plugins/samba/admin/systems/samba/class_winGeneric.inc
index 1d537005f02b200699ef6a2ff0154227a4dfad34..3b234198eca474e830a4b21eb2428984a6805436 100644 (file)
plugin::plugin ($config, $dn, $parent);
$this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses,FALSE,"uid");
$this->netConfigDNS->cn = preg_replace("/\\\$\$/","",$this->uid);
- $this->netConfigDNS->objectclasses=array("ipHost","ieee802Device");
$this->netConfigDNS->MACisMust = FALSE;
$this->netConfigDNS->IPisMust = FALSE;
$this->attrs['objectClass'][] = "gosaAdministrativeUnitTag";
}
+ $curOcs = $this->attrs['objectClass'];
+ $this->cleanup();
+
+ // Prepare list of object classes
+ $ocs = array();
+ if(!empty($this->netConfigDNS->macAddress)){
+ $ocs [] = 'ieee802Device';
+ }else{
+ $curOcs = array_remove_entries(array('ieee802Device'), $curOcs);
+ $this->attrs['macAddress'] = array();
+ }
+ if(!empty($this->netConfigDNS->ipHostNumber)){
+ $ocs [] = 'ipHost';
+ }else{
+ $curOcs = array_remove_entries(array('ipHost'), $curOcs);
+ $this->attrs['ipHostNumber'] = array();
+ }
+
+ $this->attrs['objectClass']=$curOcs;
+
/* Write back to ldap */
$ldap= $this->config->get_ldap_link();
if ($this->orig_dn == 'new'){
}
$ldap->cd($this->dn);
- $this->cleanup();
$ldap->modify ($this->attrs);
new log("modify","winworkstation/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
$this->handle_post_events("modify");
}
- $this->netConfigDNS->cn = preg_replace("/\\\$\$/","",$this->uid);
- $this->netConfigDNS->save();
if (!$ldap->success()){
msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class()));
}
+
+ // Prepare list of object classes
+ $ocs = array();
+ if(!empty($this->netConfigDNS->macAddress)){
+ $ocs [] = 'ieee802Device';
+ }
+ if(!empty($this->netConfigDNS->ipHostNumber)){
+ $ocs [] = 'ipHost';
+ }
+
+ $this->netConfigDNS->objectclasses=$ocs;
+ $this->netConfigDNS->cn = preg_replace("/\\\$\$/","",$this->uid);
+ $this->netConfigDNS->save();
}
/* Return plugin informations for acl handling