Code

Added patch from 2.5.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 30 Jan 2007 03:54:46 +0000 (03:54 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 30 Jan 2007 03:54:46 +0000 (03:54 +0000)
don't save $ within dns entries for winstations
don't display $ when editing entry

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5650 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 0e5263634a7e106fd617ed14918ed96a1dad6ec0..f0712a6b23c67949d03f1d0204b7cbfe3ed42a35 100644 (file)
@@ -44,10 +44,10 @@ class termDNS extends plugin
     plugin::plugin ($config, $dn);
 
     if(isset($this->attrs['cn'][0])){
-      $this->OrigCn = $this->attrs['cn'][0];
-      $this->cn = $this->attrs['cn'][0];
+      $this->OrigCn = preg_replace("/\\\$\$/","",$this->attrs['cn'][0]);
+      $this->cn = preg_replace("/\\\$\$/","",$this->attrs['cn'][0]);
     }
-
+  
     /* Do we have autonet support? */
     if (isset($this->config->data['MAIN']['AUTO_NETWORK_HOOK'])){
       $this->autonet= true;
index 4eb61c7c6ce794711b1bee059dc6af286beadc87..b7f0eb76502c0b4bde04f8180f682b9b7db622f0 100644 (file)
@@ -60,6 +60,8 @@ class wingeneric extends plugin
 
     /* Save dn for later references */
     $this->orig_dn= $this->dn;
+
+    $this->cn= preg_replace("/\\\$\$/","",$this->cn);
   }
 
 
@@ -254,9 +256,8 @@ class wingeneric extends plugin
       $this->handle_post_events("modify");
     }
 
-    # FIXME can't save mac address
-    #$this->netConfigDNS->cn = $this->cn;
-    #$this->netConfigDNS->save($this->dn);
+    $this->netConfigDNS->cn =  preg_replace("/\\\$\$/","",$this->cn);
+    $this->netConfigDNS->save($this->dn);
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of system wingeneric/generic with dn '%s' failed."),$this->dn));
 
     /* Optionally execute a command after we're done */
index 2b884c1d83fcbfac2dbdb47381f0ffff1c8fcaa7..7dba804dca568b3121016059977d1092ba1b6c34 100644 (file)
@@ -21,7 +21,13 @@ class wintabs extends tabs
   {
     /* Check for new 'dn', in order to propagate the
        'dn' to all plugins */
+
+    /* add $ to end of name if mising */
     $baseobject= $this->by_object['wingeneric'];
+    if(!preg_match("/\\\$\$/",$baseobject->cn)){
+      $baseobject->cn .= "$";
+    }
+
     $this->dn= "uid=$baseobject->cn,".get_winstations_ou().$baseobject->base;
     $baseobject->dn= $this->dn;