summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 265040e)
raw | patch | inline | side by side (parent: 265040e)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 26 Aug 2008 13:45:51 +0000 (13:45 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 26 Aug 2008 13:45:51 +0000 (13:45 +0000) |
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 ec2c51a05c7807910e1c619bf04231d6612a6fb6..0082123cd81552ac5f2425c84cd8e3d6ac04d7f5 100644 (file)
/*! \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.'.');
}
}
@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)){
/* 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 1e2f691e3912bcaf7bdc71d6d3de1746298acde8..d3c2743bf6c21cfb49053c03ac78f014c7ad8974 100644 (file)
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);
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);
}
index a62329a532d8df753ea0c71203ff1364e7b932fa..d34a2a0e121eb1a49854f05ada1e523326a34210 100644 (file)
{else}
<option value="install">{t}Install{/t}</option>
{/if}
- <option value="wake">{t}Wake{/t}</option>
</select>
<input type='submit' name='opsi_trigger_action' value="{t}Execute{/t}">
{/if}