From: hickert Date: Mon, 3 Mar 2008 13:26:55 +0000 (+0000) Subject: Updated gotomasses. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=16c0b9e491672854721490a4a66a3c32f7780638;p=gosa.git Updated gotomasses. -Added abort installation event git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9241 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/addons/gotomasses/class_gotomasses.inc b/gosa-plugins/goto/addons/gotomasses/class_gotomasses.inc index fe95e9fe2..b1a375f2c 100644 --- a/gosa-plugins/goto/addons/gotomasses/class_gotomasses.inc +++ b/gosa-plugins/goto/addons/gotomasses/class_gotomasses.inc @@ -536,8 +536,39 @@ class gotomasses extends plugin if(!count($ids)){ return; } - print_red(_("Not implemented, currently.")); - return(TRUE); + + /* Entries are paused by setting the status to + * something different from 'waiting'. + * We simply use 'paused'. + */ + $data = array("status" => "paused"); + + /* Detect if the ids we got are valid and + * check if the status allows pausing. + */ + $update_ids = array(); + foreach($this->o_queue->get_entries_by_id($ids) as $entry){ + if(isset($entry['STATUS']) && preg_match("/processing/",$entry['STATUS'])){ + if(isset($entry['MACADDRESS'])){ + $update_ids[] = $entry['MACADDRESS']; + }else{ + trigger_error("No mac address found in event."); + } + } + } + + if(class_available("DaemonEvent_faireboot")){ + $tmp = new DaemonEvent_faireboot($this->config); + $tmp->add_targets($update_ids); + if(!$this->o_queue->append($tmp)){ + msg_dialog::display(_("Error"), sprintf(_("Could not update queue entry: %s"),$id) , ERROR_DIALOG); + return(FALSE); + } + }else{ + msg_dialog::display(_("Error"), + sprintf(_("The Job could not be aborted, the '%s' event class was not found."), + "DaemonEvent_faireboot") , ERROR_DIALOG); + } }