From 168a05cad4ea950a3cadaa11211fb4e6e34e2d31 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 23 Jun 2009 12:21:13 +0000 Subject: [PATCH] Updated winstation dns/dhcp handling, user uid instead of cn git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@13774 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_termDNS.inc | 12 +++++++----- plugins/admin/systems/class_winGeneric.inc | 6 +++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/plugins/admin/systems/class_termDNS.inc b/plugins/admin/systems/class_termDNS.inc index 5f861551e..ef0ced1b8 100644 --- a/plugins/admin/systems/class_termDNS.inc +++ b/plugins/admin/systems/class_termDNS.inc @@ -40,22 +40,24 @@ class termDNS extends plugin var $dnsEntry = array(); var $DNSenabled = false; var $hide_dns_check_box = FALSE; - + var $namingAttr = "cn"; + /* Terminal dns */ - function termDNS ($config, $dn,$objectClasses,$IPisMust = false) + function termDNS ($config, $dn,$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->objectclasses = $objectClasses; $this->IPisMust = $IPisMust; + $this->namingAttr = $namingAttr; plugin::plugin ($config, $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[$this->namingAttr][0])){ + $this->OrigCn = preg_replace("/\\\$\$/","",$this->attrs[$this->namingAttr][0]); + $this->cn = preg_replace("/\\\$\$/","",$this->attrs[$this->namingAttr][0]); } diff --git a/plugins/admin/systems/class_winGeneric.inc b/plugins/admin/systems/class_winGeneric.inc index 986712523..0f927711a 100644 --- a/plugins/admin/systems/class_winGeneric.inc +++ b/plugins/admin/systems/class_winGeneric.inc @@ -44,7 +44,7 @@ class wingeneric extends plugin function wingeneric ($config, $dn= NULL, $parent= NULL) { plugin::plugin ($config, $dn, $parent); - $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses); + $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses,FALSE,'uid'); $this->netConfigDNS->acl = $this->acl; $this->netConfigDNS->MACisMust = FALSE; @@ -115,7 +115,7 @@ class wingeneric extends plugin } $smarty->assign("base_select", $this->base); - $this->netConfigDNS->cn= $this->cn; + $this->netConfigDNS->cn= $this->uid; $smarty->assign("netconfig", $this->netConfigDNS->execute()); /* Display sub dialog from network settings */ @@ -236,7 +236,7 @@ class wingeneric extends plugin $this->handle_post_events("modify"); } - $this->netConfigDNS->cn = preg_replace("/\\\$\$/","",$this->cn); + $this->netConfigDNS->cn = preg_replace("/\\\$\$/","",$this->uid); $this->netConfigDNS->save($this->dn); show_ldap_error($ldap->get_error(), _("Saving Samba workstation failed")); -- 2.30.2