Code

Updated terminal/workstation
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 10 Apr 2008 13:12:52 +0000 (13:12 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 10 Apr 2008 13:12:52 +0000 (13:12 +0000)
-Updated terminal & wotkstation moving

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

gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc
gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc
gosa-plugins/goto/admin/systems/goto/tabs_terminal.inc
gosa-plugins/goto/admin/systems/goto/tabs_workstation.inc

index f80dc1c969d9f3829319a825e0c56a5d0d9ecc58..7fe73099a5d0c1bf19be60d6815b4c39a8e7446b 100644 (file)
@@ -441,12 +441,6 @@ class termgeneric extends plugin
   /* Save to LDAP */
   function save()
   {
-
-    /* Move object if requested */
-    if( $this->orig_dn != 'new' && $this->dn != $this->orig_dn){
-      $this->move($this->orig_dn, $this->dn);
-    }
-
     /* Detect mode changes */
     $activate= (isset($this->saved_attributes['gotoMode']) &&
         $this->gotoMode != $this->saved_attributes['gotoMode'] &&
index 2f9de0459bf31ff66338402f23bb62046d7ba627..894e24667ad76347163761a781bc6f82d61fd40b 100644 (file)
@@ -30,6 +30,7 @@ class workgeneric extends plugin
   var $cn= "";
   var $l= "";
   var $orig_dn= "";
+  var $orig_cn= "";
 
   /* Plugin side filled */
   var $modes= array();
@@ -151,6 +152,7 @@ class workgeneric extends plugin
 
     /* Save 'dn' for later referal */
     $this->orig_dn= $this->dn;
+    $this->orig_cn= $this->cn;
   }
 
 
@@ -356,6 +358,9 @@ class workgeneric extends plugin
         unset($og->member[$this->dn]);
         $og->save ();
       }
+
+      /* Remove all accessTo/trust dependencies */
+      update_accessTo($this->cn,"");
     }
 
     /* Clean queue form entries with this mac 
@@ -544,7 +549,9 @@ class workgeneric extends plugin
       $this->handle_post_events("add",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber));
     } else {
       if ($this->orig_dn != $this->dn){
-        $this->move($this->orig_dn, $this->dn);
+
+        /* Remove all accessTo/trust dependencies */
+        update_accessTo($this->orig_cn,$this->cn);
       }
       $ldap->cd($this->dn);
       $this->cleanup();
@@ -553,7 +560,6 @@ class workgeneric extends plugin
         msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()));
       }
       new log("modify","workstation/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
-
       $this->handle_post_events("modify",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber));
     }
 
index ab2779a2f80dc7cf29b269e9d9b11387f3a376a9..f7cb52b3b56f6732038ecad7a51106461be71269 100644 (file)
@@ -59,6 +59,13 @@ class termtabs extends tabs
     $this->dn= "cn=".$baseobject->cn.",".get_ou('terminalou').$baseobject->base;
     $baseobject->dn= $this->dn;
 
+    if($this->dn != $baseobject->orig_dn && $baseobject->orig_dn != "new"){
+
+      /* Udpate acls */
+      $baseobject->update_acls($baseobject->orig_dn,$this->dn);
+      $baseobject->move($baseobject->orig_dn,$this->dn);
+    }
+
     foreach ($this->by_object as $key => $obj){
       $this->by_object[$key]->dn= $this->dn;
       $this->by_object[$key]->cn= $baseobject->cn;
index d2ca696aa8ac7356847064d2f5cb780991062865..4700f83042274d7c716f06a26178fc9f52a5bb9e 100644 (file)
@@ -54,6 +54,14 @@ class worktabs extends tabs
        'dn' to all plugins */
     $baseobject= $this->by_object['workgeneric'];
     $this->dn= "cn=".$baseobject->cn.",".get_ou('workstationou').$baseobject->base;
+
+    if($this->dn != $baseobject->orig_dn && $baseobject->orig_dn != "new"){
+
+      /* Udpate acls */
+      $baseobject->update_acls($baseobject->orig_dn,$this->dn);
+      $baseobject->move($baseobject->orig_dn,$this->dn);
+    }
+
     $baseobject->dn= $this->dn;
 
     foreach ($this->by_object as $key => $obj){