From c0e14c9f6183ceaa308d1a2a8e996615eb52fe2f Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 10 Apr 2008 13:12:52 +0000 Subject: [PATCH] Updated terminal/workstation -Updated terminal & wotkstation moving git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10324 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../goto/admin/systems/goto/class_terminalGeneric.inc | 6 ------ .../admin/systems/goto/class_workstationGeneric.inc | 10 ++++++++-- gosa-plugins/goto/admin/systems/goto/tabs_terminal.inc | 7 +++++++ .../goto/admin/systems/goto/tabs_workstation.inc | 8 ++++++++ 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc index f80dc1c96..7fe73099a 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc @@ -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'] && diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc index 2f9de0459..894e24667 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc @@ -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)); } diff --git a/gosa-plugins/goto/admin/systems/goto/tabs_terminal.inc b/gosa-plugins/goto/admin/systems/goto/tabs_terminal.inc index ab2779a2f..f7cb52b3b 100644 --- a/gosa-plugins/goto/admin/systems/goto/tabs_terminal.inc +++ b/gosa-plugins/goto/admin/systems/goto/tabs_terminal.inc @@ -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; diff --git a/gosa-plugins/goto/admin/systems/goto/tabs_workstation.inc b/gosa-plugins/goto/admin/systems/goto/tabs_workstation.inc index d2ca696aa..4700f8304 100644 --- a/gosa-plugins/goto/admin/systems/goto/tabs_workstation.inc +++ b/gosa-plugins/goto/admin/systems/goto/tabs_workstation.inc @@ -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){ -- 2.30.2