summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2da4793)
raw | patch | inline | side by side (parent: 2da4793)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 21 Oct 2008 09:46:17 +0000 (09:46 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 21 Oct 2008 09:46:17 +0000 (09:46 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12746 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/goto/addons/goto/class_gotomasses.inc | patch | blob | history |
diff --git a/gosa-plugins/goto/addons/goto/class_gotomasses.inc b/gosa-plugins/goto/addons/goto/class_gotomasses.inc
index 69a86d5a740463e662c9d900cfbfa9b4b83f5422..38096ff71783e2920f09e76a0968fe3f7d2fcde3 100644 (file)
"/^remove_task_/" => "remove",
"/^new_task_/" => "new_task");;
-
foreach($arr as $regex => $action){
foreach($_POST as $name => $value){
if(preg_match($regex,$name)){
* Import CSV file
************/
- if($s_action == "import_file"){
+ if($s_action == "import_file" && $this->acl_is_writeable("")){
$this->dialog = new goto_import_file($this->config,$this);
}
* Handle Priority modifications
************/
- if(preg_match("/^prio_/",$s_action)){
+ if(preg_match("/^prio_/",$s_action) && $this->acl_is_writeable("")){
switch($s_action){
case 'prio_down' : $this->update_priority($s_entry,"down");break;
case 'prio_up' : $this->update_priority($s_entry,"up");break;
************/
if(preg_match("/^resume/",$s_action) ||
- preg_match("/^pause/",$s_action) ||
- preg_match("/^abort_process/",$s_action) ||
- preg_match("/^execute_process/",$s_action)){
-
- switch($s_action){
- case 'resume' : $this->resume_queue_entries (array($s_entry));break;
- case 'pause' : $this->pause_queue_entries (array($s_entry));break;
- case 'execute_process': $this->execute_queue_entries (array($s_entry));break;
- case 'abort_process' : $this->abort_queue_entries (array($s_entry));break;
- case 'resume_all' : $this->resume_queue_entries ($this->list_get_selected_items());break;
- case 'pause_all' : $this->pause_queue_entries ($this->list_get_selected_items());break;
- case 'execute_process_all': $this->execute_queue_entries ($this->list_get_selected_items());break;
- case 'abort_process_all' : $this->abort_queue_entries ($this->list_get_selected_items());break;
-
- default : trigger_error("Undefined action setting used (".$s_action.").");
+ preg_match("/^pause/",$s_action) ||
+ preg_match("/^abort_process/",$s_action) ||
+ preg_match("/^execute_process/",$s_action)){
+
+ if($this->acl_is_writeable("")){
+ switch($s_action){
+ case 'resume' : $this->resume_queue_entries (array($s_entry));break;
+ case 'pause' : $this->pause_queue_entries (array($s_entry));break;
+ case 'execute_process': $this->execute_queue_entries (array($s_entry));break;
+ case 'abort_process' : $this->abort_queue_entries (array($s_entry));break;
+ case 'resume_all' : $this->resume_queue_entries ($this->list_get_selected_items());break;
+ case 'pause_all' : $this->pause_queue_entries ($this->list_get_selected_items());break;
+ case 'execute_process_all': $this->execute_queue_entries ($this->list_get_selected_items());break;
+ case 'abort_process_all' : $this->abort_queue_entries ($this->list_get_selected_items());break;
+
+ default : trigger_error("Undefined action setting used (".$s_action.").");
+ }
}
if($this->o_queue->is_error()){
msg_dialog::display(_("Error"), $this->o_queue->get_error(), ERROR_DIALOG);
* ADD
************/
- if(preg_match("/^add_event_/",$s_action)){
+ if(preg_match("/^add_event_/",$s_action) && $this->acl_is_writeable("")){
$type = preg_replace("/^add_event_/","",$s_action);
if(isset($this->events['BY_CLASS'][$type])){
$e_data = $this->events['BY_CLASS'][$type];
* EDIT
************/
- if($s_action == "edit"){
+ if($s_action == "edit" && $this->acl_is_writeable("")){
$id = $s_entry;
$type = FALSE;
if(isset($this->entries[$id])){
* LOG VIEW
************/
- if($s_action == "logview"){
+ if($s_action == "logview" && $this->acl_is_readable("")){
$id = $s_entry;
$type = FALSE;
if(isset($this->entries[$id])){
/* Reboot hosts with not yet startet installations and timestamps in the past
*/
- timezone::get_default_timezone();
- foreach($this->ids_to_remove as $id){
- $entry = $this->o_queue->get_entries_by_id(array($id));
- if(isset($entry['ANSWER1'])){
- $entry = $entry['ANSWER1'];
- if( $entry['STATUS'] == "waiting" &&
- $entry['HEADERTAG'] == "trigger_action_reinstall"){
- $evt = new DaemonEvent_reinstall($this->config,$entry);
- if($evt->get_timestamp(FALSE) < time()){
- $r_evt = new DaemonEvent_localboot($this->config);
- $r_evt->add_targets(array($entry['MACADDRESS']));
- $r_evt->set_type(TRIGGERED_EVENT);
- $this->o_queue->append($r_evt);
+ if($this->acl_is_removeable("")){
+ timezone::get_default_timezone();
+ foreach($this->ids_to_remove as $id){
+ $entry = $this->o_queue->get_entries_by_id(array($id));
+ if(isset($entry['ANSWER1'])){
+ $entry = $entry['ANSWER1'];
+ if( $entry['STATUS'] == "waiting" &&
+ $entry['HEADERTAG'] == "trigger_action_reinstall"){
+ $evt = new DaemonEvent_reinstall($this->config,$entry);
+ if($evt->get_timestamp(FALSE) < time()){
+ $r_evt = new DaemonEvent_localboot($this->config);
+ $r_evt->add_targets(array($entry['MACADDRESS']));
+ $r_evt->set_type(TRIGGERED_EVENT);
+ $this->o_queue->append($r_evt);
+ }
}
}
}
- }
- $this->o_queue->remove_entries($this->ids_to_remove);
- $this->save();
+ $this->o_queue->remove_entries($this->ids_to_remove);
+ $this->save();
+ }
}
/* Remove aborted */
$s = ".|"._("Actions")."|\n";
$s.= "..|<img src='images/lists/new.png' alt='' border='0' class='center'> "._("Create")."\n";
- foreach($this->events['SCHEDULED'] as $name => $event){
- $s.= "...|".$event['MenuImage']." ".$event['s_Menu_Name']."|add_event_".$name."\n";
+ if($this->acl_is_writeable("")){
+ foreach($this->events['SCHEDULED'] as $name => $event){
+ $s.= "...|".$event['MenuImage']." ".$event['s_Menu_Name']."|add_event_".$name."\n";
+ }
}
if($this->acl_is_removeable()){
$s.= "..|---|\n";
/* If WAITING add priority action
*/
- if(in_array($task['STATUS'],array("waiting"))){
+ if(in_array($task['STATUS'],array("waiting")) && $this->acl_is_writeable("")){
$prio_actions.= "<input class='center' type='image' src='plugins/goto/images/prio_increase.png'
title='"._("Move up")."' name='prio_up_".$key."'> ";
$prio_actions.= "<input class='center' type='image' src='plugins/goto/images/prio_decrease.png'
/* If WAITING add pause action
*/
- if(in_array($task['STATUS'],array("waiting"))){
+ if(in_array($task['STATUS'],array("waiting")) && $this->acl_is_writeable("")){
$prio_actions.= "<input class='center' type='image' src='images/status_pause.png'
title='"._("Pause job")."' name='pause_".$key."'> ";
}
/* If PAUSED add resume action
*/
- if(in_array($task['STATUS'],array("paused"))){
+ if(in_array($task['STATUS'],array("paused")) && $this->acl_is_writeable("")){
$prio_actions.= "<input class='center' type='image' src='images/status_start.png'
title='"._("Resume job")."' name='resume_".$key."'> ";
}
/* If PAUSED or WAITING add execution action
*/
- if(in_array($task['STATUS'],array("paused","waiting"))){
+ if(in_array($task['STATUS'],array("paused","waiting")) && $this->acl_is_writeable("")){
$prio_actions.= "<input class='center' type='image' src='images/rocket.png'
title='"._("Execute now")."' name='execute_process_".$key."'> ";
}
/* Add logview button, currently ever.
*/
- if(TRUE){
+ if($this->acl_is_readable("")){
$action .= "<input type='image' src='plugins/goto/images/view_logs.png' name='log_view_".$key."'
class='center' title='"._("View logs")."' alt='"._("View logs")."'> ";
}
/* If PAUSED or WAITING add edit action
*/
- if(in_array($task['STATUS'],array("waiting"))){
+ if(in_array($task['STATUS'],array("waiting")) && $this->acl_is_writeable("")){
$action.= "<input type='image' src='images/lists/edit.png' name='edit_task_".$key."'
class='center' title='"._("Edit")."' alt='"._("Edit")."'>";
}
/* If PROCESSING add abort action
*/
- if(in_array($task['STATUS'],array("processing")) && preg_match("/install/",$task['HEADERTAG'])){
+ if(in_array($task['STATUS'],array("processing")) && preg_match("/install/",$task['HEADERTAG']) && $this->acl_is_writeable("")){
$action.= "<img src='images/empty.png' alt=''>";
$action.= "<input class='center' type='image' src='images/small_error.png'
title='"._("Abort job")."' name='abort_process_".$key."'>";
$action.= "<input type='image' src='images/lists/trash.png' name='remove_task_".$key."'
class='center' title='"._("Remove")."' alt='"._("Remove")."'>";
}
- if(in_array($task['STATUS'],array("processing")) && !preg_match("/install/",$task['HEADERTAG'])){
+ if($this->acl_is_writeable("") && in_array($task['STATUS'],array("processing")) && !preg_match("/install/",$task['HEADERTAG'])){
$action.= "<input type='image' src='images/lists/trash.png' name='remove_task_".$key."'
class='center' title='"._("Remove")."' alt='"._("Remove")."'>";
}