From 2a477daf32224b8c12df6c66446a9d2c54c6f2e7 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 12 Jan 2010 09:14:25 +0000 Subject: [PATCH] Updated system saving git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15148 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/systems/class_systemManagement.inc | 47 ++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/gosa-plugins/systems/admin/systems/class_systemManagement.inc b/gosa-plugins/systems/admin/systems/class_systemManagement.inc index a7e9df0de..9bc5b486c 100644 --- a/gosa-plugins/systems/admin/systems/class_systemManagement.inc +++ b/gosa-plugins/systems/admin/systems/class_systemManagement.inc @@ -448,7 +448,7 @@ class systemManagement extends management }else{ $disallowed[] = $dn; - new log("security","groups/".get_class($this),$dn,array(),"Tried to trick deletion."); + new log("security","system/".get_class($this),$dn,array(),"Tried to trick deletion."); } } } @@ -763,12 +763,57 @@ class systemManagement extends management unset($this->activationQueue[$this->last_dn]); } + /* Post handling for activated systems + target opsi -> Remove source. + target gosa -> Activate system. + */ + if($this->last_tabObject instanceOf opsi_tabs){ + $ldap = $this->config->get_ldap_link(); + $ldap->cd($this->config->current['BASE']); + $ldap->rmdir ($this->last_tabObject->dn); + @DEBUG(DEBUG_LDAP,__LINE__, __FUNCTION__, __FILE__, + "Source removed: ".$this->tabObject->dn,"Opsi host activated"); + + $hostId = $this->last_tabObject->by_object['opsiGeneric']->hostId; + $mac = $this->last_tabObject->by_object['opsiGeneric']->mac; + $this->opsi->job_opsi_activate_client($hostId,$mac); + + }elseif(isset($this->last_tabObject->was_activated) && $this->last_tabObject->was_activated){ + $this->activate_new_device($this->last_tabObject->dn); + } + // Avoid using values from an older input dialog $_POST = array(); $this->handleActivationQueue(); } + protected function applyChanges() + { + $str = management::applyChanges(); + if($str) return($str); + + /* Post handling for activated systems + target opsi -> Remove source. + target gosa -> Activate system. + */ + if($this->tabObject instanceOf opsi_tabs){ + $ldap = $this->config->get_ldap_link(); + $ldap->cd($this->config->current['BASE']); + $ldap->rmdir ($this->tabObject->dn); + @DEBUG(DEBUG_LDAP,__LINE__, __FUNCTION__, __FILE__, + "Source removed: ".$this->tabObject->dn,"Opsi host activated"); + + $hostId = $this->tabObject->by_object['opsiGeneric']->hostId; + $mac = $this->tabObject->by_object['opsiGeneric']->mac; + $this->opsi->job_opsi_activate_client($hostId,$mac); + + }elseif(isset($this->tabObject->was_activated) && $this->tabObject->was_activated){ + $this->activate_new_device($this->tabObject->dn); + } + } + + /*! \brief Sets FAIstate to "install" for "New Devices". This function is some kind of "Post handler" for activated systems, it is called directly after the object (workstabs,servtabs) gets saved. -- 2.30.2