Code

Fixed win Workstation.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 29 Jan 2007 08:14:03 +0000 (08:14 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 29 Jan 2007 08:14:03 +0000 (08:14 +0000)
- Don't display the $ off the workstation name when editing.
- Fixed dns entries, don't create entries like this name$.domain.de

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

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

index d3c614a88331bd549b3dc65195652bcd9e6f2958..a7310a89ff2f7a73fdc2113672af2b42983383c5 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 4809e74e2e22fecb68aa4335309b500058f5bdae..8b7fcbe9546c9d0337dc7e67236c6b446cbb5926 100644 (file)
@@ -62,6 +62,8 @@ class wingeneric extends plugin
 
     /* Save dn for later references */
     $this->orig_dn= $this->dn;
+
+    $this->cn= preg_replace("/\\\$\$/","",$this->cn);
   }
 
   function execute()
@@ -226,7 +228,7 @@ class wingeneric extends plugin
       $this->handle_post_events("modify");
     }
 
-    $this->netConfigDNS->cn = $this->cn;
+    $this->netConfigDNS->cn = preg_replace("/\\\$\$/","",$this->cn);
     $this->netConfigDNS->save($this->dn);
     show_ldap_error($ldap->get_error(), _("Saving Samba workstation failed"));
 
index 429b8035db7314275d6246a92395564020bbeae9..3f03437fa837401b896944d1e758ae91e0e2d0fb 100644 (file)
@@ -18,7 +18,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;