summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 00b4684)
raw | patch | inline | side by side (parent: 00b4684)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 19 Jun 2009 08:18:38 +0000 (08:18 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 19 Jun 2009 08:18:38 +0000 (08:18 +0000) |
-
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13736 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13736 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/systems/admin/systems/class_termDNS.inc | patch | blob | history |
diff --git a/gosa-plugins/systems/admin/systems/class_termDNS.inc b/gosa-plugins/systems/admin/systems/class_termDNS.inc
index cba4c1bf993aef67524529183b9acd064e8b79ec..c31dbeba919b1b916e3233e62d596d71710e544a 100644 (file)
var $dnsEntry = array();
var $DNSenabled = false;
var $hide_dns_check_box = FALSE;
+ var $namingAttr = "cn";
/* Terminal dns
*/
- function termDNS (&$config, $parent,$objectClasses,$IPisMust = false)
+ function termDNS (&$config, $parent,$objectClasses,$IPisMust = false,$namingAttr = "cn")
{
/* We need to know which objectClasses are used, to store the ip/mac
* Because of different type of devices
$this->parent = $parent;
$this->objectclasses = $objectClasses;
$this->IPisMust = $IPisMust;
+ $this->namingAttr = $namingAttr;
plugin::plugin ($config, $parent->dn);
- if(isset($this->attrs['cn'][0])){
- $this->OrigCn = preg_replace("/\\\$\$/","",$this->attrs['cn'][0]);
- $this->cn = preg_replace("/\\\$\$/","",$this->attrs['cn'][0]);
+ if(isset($this->attrs[$namingAttr][0])){
+ $this->OrigCn = preg_replace("/\\\$\$/","",$this->attrs[$namingAttr][0]);
+ $this->cn = preg_replace("/\\\$\$/","",$this->attrs[$namingAttr][0]);
}
/* Create list of additional ipHostNumber.
************/
/* Hide all dhcp specific code, if dhcp plugin is not present in config */
- $dhcpEnabled = FALSE;
+ $this->dhcpEnabled = FALSE;
if($this->config->search("servdhcp","class",array("tabs"))){
$this->dhcpEnabled = TRUE;
}
}
/* Updated IP host number */
- if($this->dhcp_is_Account){
+ if($this->dhcp_is_Account && $this->dhcpHostEntry['dhcpStatements']){
foreach($this->dhcpHostEntry['dhcpStatements'] as $id => $value){
if(preg_match("/^fixed-address/",$value)){
$this->dhcpHostEntry['dhcpStatements'][$id] = "fixed-address ".$this->ipHostNumber;
if(($this->initial_dhcpParentNode != $this->dhcpParentNode) ||
($this->cn != $this->OrigCn)){
$attrs = $this->dhcpHostEntry;
- $attrs['cn'] = $this->cn;
+ $attrs[$this->namingAttr] = $this->cn;
unset($attrs['dn']);
unset($attrs['MODIFIED']);
$ldap->cd("cn=".$this->cn.",".$this->dhcpParentNode);
{
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->config->current['BASE']);
- $ldap->search ("(&(objectClass=dhcpHost)(cn=".$this->cn."))",array("cn","dn"));
+ $ldap->search ("(&(objectClass=dhcpHost)(cn=".$this->cn."))",array("uid","cn","dn"));
if($ldap->count()){
$attr = $ldap->fetch();