Code

Updated winstation dns/dhcp handling, user uid instead of cn
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 23 Jun 2009 12:21:13 +0000 (12:21 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 23 Jun 2009 12:21:13 +0000 (12:21 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@13774 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_termDNS.inc
plugins/admin/systems/class_winGeneric.inc

index 5f861551e5746e1ee1f15423031d73b942505964..ef0ced1b8b660fbdb04981c3147a7183db2a0986 100644 (file)
@@ -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]);
     }
 
  
index 9867125230c21e5d9e244731cab17449bf1352fa..0f927711abfd44975ed514f1608ad78a978293c0 100644 (file)
@@ -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"));