From: hickert Date: Tue, 26 Aug 2008 13:45:51 +0000 (+0000) Subject: Added action install X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5cc54c34dda1873e329bfc3297c603525bb3a1e4;p=gosa.git Added action install git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12277 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/opsi/admin/opsi/class_opsi.inc b/gosa-plugins/opsi/admin/opsi/class_opsi.inc index ec2c51a05..0082123cd 100644 --- a/gosa-plugins/opsi/admin/opsi/class_opsi.inc +++ b/gosa-plugins/opsi/admin/opsi/class_opsi.inc @@ -92,11 +92,10 @@ class opsi extends gosaSupportDaemon /*! \brief Trigger an event like wake or install for a specific hostId. */ - public function send_action($type,$hostId) + public function send_action($type,$hostId,$mac) { switch($type){ - case 'install' : $this->job_opsi_install_client($hostId); break; - case 'wake' : $this->job_opsi_wake_client($hostId); break; + case 'install' : $this->job_opsi_install_client($hostId,$mac); break; default : trigger_error('Unknown type '.$type.'.'); } } @@ -416,9 +415,9 @@ class opsi extends gosaSupportDaemon @param @return */ - public function job_opsi_install_client($hostId) + public function job_opsi_install_client($hostId,$mac) { - $data = array("hostId" => $hostId); + $data = array("hostId" => $hostId,"macaddress"=>$mac); /* Check parameter */ if(empty($hostId)){ @@ -429,25 +428,6 @@ class opsi extends gosaSupportDaemon /* Query SI server */ $this->send_data("job_opsi_install_client",$this->target,$data,TRUE); } - - - /*! \brief Triggers install/reinstall of an opsi client. - @param - @return - */ - public function job_opsi_wake_client($hostId) - { - $data = array("hostId" => $hostId); - - /* Check parameter */ - if(empty($hostId)){ - trigger_error("No valid host id given, check parameter 1."); - return; - } - - /* Query SI server */ - $this->send_data("job_opsi_wake_client",$this->target,$data,TRUE); - } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc b/gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc index 1e2f691e3..d3c2743bf 100644 --- a/gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc +++ b/gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc @@ -118,7 +118,7 @@ class opsigeneric extends plugin if(!preg_match("/\./",$this->hostId)){ $messages[] = msgPool::invalid(_("Name"),$this->hostId,"",_("The client name must contain a domain part (e.g. '.company.de').")); } - if(!tests::is_mac($this->mac)){ + if(!tests::is_mac($this->mac) || empty($this->mac)){ $messages[] = msgPool::invalid(_("MAC address"),$this->mac,"","00:0C:7F:31:33:F1"); } return($messages); @@ -307,7 +307,7 @@ class opsigeneric extends plugin if(isset($_POST['opsi_action']) && isset($_POST['opsi_trigger_action']) && $this->parent_mode){ $action = $_POST['opsi_action']; if(in_array($action,array("wake","install"))){ - $this->opsi->send_action($action,$this->hostId); + $this->opsi->send_action($action,$this->hostId,$this->mac); if($this->opsi->is_error()){ msg_dialog::display(_("Error"),msgPool::siError($this->opsi->get_error()),ERROR_DIALOG); } diff --git a/gosa-plugins/opsi/admin/opsi/generic.tpl b/gosa-plugins/opsi/admin/opsi/generic.tpl index a62329a53..d34a2a0e1 100644 --- a/gosa-plugins/opsi/admin/opsi/generic.tpl +++ b/gosa-plugins/opsi/admin/opsi/generic.tpl @@ -74,7 +74,6 @@ {else} {/if} - {/if}