summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dec3bef)
raw | patch | inline | side by side (parent: dec3bef)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 21 Aug 2007 07:50:10 +0000 (07:50 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 21 Aug 2007 07:50:10 +0000 (07:50 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7083 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/addons/gotomasses/class_goto_task.inc | patch | blob | history | |
plugins/addons/gotomasses/class_gotomasses.inc | patch | blob | history |
diff --git a/plugins/addons/gotomasses/class_goto_task.inc b/plugins/addons/gotomasses/class_goto_task.inc
index 5552313648fc54523e77fe8ccad74acab29f6661..a4b540561b1477cc5a525677a534f5536841e712 100644 (file)
var $Weekday = "*";
var $Action = "install";
var $Comment = "";
+ var $OGroup = "keep_current";
+ var $OGroups = array();
var $Target = array();
-
var $Actions = array();
- var $OGroup = "";
- var $OGroups = array();
var $new = FALSE;
var $attributes = array("OGroup","Minute","Hour","Day","Month","Weekday","Action","Comment","Target");
}
}
-
/********
* Add target from list
********/
return($this->dialog->execute());
}
-
/********
* Display this plugin
********/
$acl_target = $this->parent->getacl("Target");
foreach($this->Target as $key => $target){
-
$field1 = array("string" => $target);
if(preg_match("/w/i",$acl_target)){
$field2 = array("string" => "<input type='image' src='images/edittrash.png' name='remove_".$key."'>" ,
$field2 = array("string" => "",
"attach" => "style='width:40px;border-right:0px;'");
}
-
$divlist->AddEntry(array($field1,$field2));
}
$smarty = get_smarty();
-
foreach($this->attributes as $attr){
$smarty->assign($attr."ACL", $this->parent->getacl($attr));
$smarty->assign($attr,$this->$attr);
$smarty->assign("Days" , $tmp['Day']);
$smarty->assign("Months" , $tmp['Month']);
$smarty->assign("Weekdays", $tmp['Weekday']);
-
- $smarty->assign("OGroups" , $this->OGroups);
+ $smarty->assign("OGroups" , $this->OGroups);
$smarty->assign("Expert" , $this->Expert);
-
$smarty->assign("Actions" , $this->Actions);
$smarty->assign("Target_list" , $divlist->DrawList());
$smarty->assign("new" , $this->new);
diff --git a/plugins/addons/gotomasses/class_gotomasses.inc b/plugins/addons/gotomasses/class_gotomasses.inc
index 0399ec4fc187e0b11e70c59b50680846b000b607..88a3e1b267762c9eb51f6cce5e1e85adb0854ab4 100644 (file)
/* Remove entry from list */
if($s_action == "remove" && isset($this->tasks[$s_entry])){
-
if(!$this->acl_is_removeable()){
print_red(_("You are not allowed to remove a task."));
}else{
{
$ret = "";
foreach($data['Target'] as $target){
- $ret .= preg_replace("/^[^:]+:/i","",$target).", ";
+ $ret .= $target.", ";
}
return(preg_replace("/, $/","",$ret));
}
{
$ui = get_userinfo();
-
+ /* Check file existence */
if(!file_exists($this->data_file) || !is_readable($this->data_file)){
print_red(sprintf(_("Can't locate or read gotomasses storage file '%s'."),$this->data_file));
return(FALSE);
}
+ /* check if file is readable */
$fp = @fopen($this->data_file,"r");
if(!$fp){
print_red(sprintf(_("Can't read gotomasses storage file '%s'."),$this->data_file));
function save_gotomasses_data()
{
$str = "#GOsa generated file, please just modify if you realy know what you do.";
-
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['Weekday'],5," ")." ";
$str .= str_pad($task['Action'] ,5," ")." ";
$str .= str_pad($task['OGroup'] ,5," ")." ";
-
foreach($task['Target'] as $target){
$str .= $target.",";
}
$str = preg_replace("/,$/","",$str);
}
+ /* check file existence*/
$ui = get_userinfo();
-
if(!file_exists($this->data_file) || !is_writeable($this->data_file)){
print_red(sprintf(_("Can't locate or write gotomasses storage file '%s'."),$this->data_file));
return(FALSE);
}
+ /* check permissions */
$fp = @fopen($this->data_file,"w");
if(!$fp){
print_red(sprintf(_("Can't read gotomasses storage file '%s'."),$this->data_file));
return(FALSE);
}
+ /* Write contents */
$str .= "\n";
fwrite($fp,$str);
fclose($fp);
function save_object()
{
- if(isset($_POST['gotomasses'])){
- }
}