From e1dbbb4a55cb759059cdd8b0f83a5ca0428b7d2a Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 22 Aug 2007 07:00:30 +0000 Subject: [PATCH] Added wake action to gotomasses git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7093 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/addons/gotomasses/class_goto_task.inc | 4 +++- plugins/addons/gotomasses/class_gotomasses.inc | 17 ++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/plugins/addons/gotomasses/class_goto_task.inc b/plugins/addons/gotomasses/class_goto_task.inc index f67fd7f11..60a776539 100644 --- a/plugins/addons/gotomasses/class_goto_task.inc +++ b/plugins/addons/gotomasses/class_goto_task.inc @@ -64,8 +64,10 @@ class goto_task extends plugin foreach($_POST as $name => $value){ if(preg_match("/^remove_/",$name)){ $value = preg_replace("/^remove_([0-9]*)_(x|y)$/i","\\1",$name); - if(isset($this->Target[$value])){ + if(isset($this->Target[$value]) && $this->Action != "initial_install"){ unset($this->Target[$value]); + }elseif(isset($this->Initial_Target[$value]) && $this->Action == "initial_install"){ + unset($this->Initial_Target[$value]); } } } diff --git a/plugins/addons/gotomasses/class_gotomasses.inc b/plugins/addons/gotomasses/class_gotomasses.inc index b90853392..dc2bb580e 100644 --- a/plugins/addons/gotomasses/class_gotomasses.inc +++ b/plugins/addons/gotomasses/class_gotomasses.inc @@ -25,12 +25,10 @@ class gotomasses extends plugin /* Include config object */ $this->config= $config; - $this->load_gotomasses_data(); } - function execute() { $smarty = get_smarty(); @@ -293,11 +291,15 @@ class gotomasses extends plugin foreach($this->tasks as $task){ $str .= "\n#".trim($task['Comment']); $str .= "\n"; - $str .= str_pad($task['Minute'] ,5," ")." "; - $str .= str_pad($task['Hour'] ,5," ")." "; - $str .= str_pad($task['Day'] ,5," ")." "; - $str .= str_pad($task['Month'] ,5," ")." "; - $str .= str_pad($task['Weekday'],5," ")." "; + if($task['Action'] == "initial_install"){ + $str .= "* * * * * "; + }else{ + $str .= str_pad($task['Minute'] ,5," ")." "; + $str .= str_pad($task['Hour'] ,5," ")." "; + $str .= str_pad($task['Day'] ,5," ")." "; + $str .= str_pad($task['Month'] ,5," ")." "; + $str .= str_pad($task['Weekday'],5," ")." "; + } $str .= str_pad($task['Action'] ,5," ")." "; $str .= str_pad($task['OGroup'] ,5," ")." "; if($task['Action'] == "initial_install"){ @@ -368,6 +370,7 @@ class gotomasses extends plugin "update" => _("Update"), "reinstall" => _("(Re)Install"), "rescan" => _("Rescan"), + "wake" => _("Wake"), "memcheck" => _("Memory check")); return($actions); } -- 2.30.2