summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 59b10ad)
raw | patch | inline | side by side (parent: 59b10ad)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 21 May 2008 05:18:40 +0000 (05:18 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 21 May 2008 05:18:40 +0000 (05:18 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10971 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc b/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc
index 3bfd30e8fd4becf5f4b250236c0d57787d9c6023..3732d034fe04c0d4f94575f6a6017f7fc033be30 100644 (file)
protected $server_list = array(); // Used as cache in the target list.
protected $visible_for = HIDDEN_EVENT;
+
+ protected $attributes = array();
function set_type($type)
{
return($this->s_Schedule_Action);
}
- //
+
/*! \brief Returns the event tag to schedule a new action
@param Returns the event e.g. 'trigger_action_wake'
*/
return($this->s_Trigger_Action);
}
+
/*! brief Returns an array containig all attributes \
That should be written.
@return Array e.g. 'status' => 'bla blub'
*/
public function save()
{
- return(array("timestamp" => $this->_timestamp_to_event($this->timestamp)));
+ $ret = array();
+ foreach($this->attributes as $attr){
+ $ret[$attr] = $this->$attr;
+ }
+ $ret['timestamp'] = $this->_timestamp_to_event($this->timestamp);
+ return($ret);
}
{
return(array());
}
+
+
+ /*! \brief Update a class variable from outside
+ */
+ public function set_value($name,$value)
+ {
+ if(isset($this->$name) && in_array($name,$this->attributes)){
+ $this->$name = $value;
+ }
+ }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
diff --git a/gosa-plugins/goto/addons/goto/events/class_DaemonEvent_notify.inc b/gosa-plugins/goto/addons/goto/events/class_DaemonEvent_notify.inc
index 734e928c52f6c7d39cbb8a793e3ece5912014435..533723c305cd676b2df97b78482018fecf0af884 100644 (file)
var $subject = "";
var $from = "";
+ var $attributes = array("from","users","groups","message","subject");
+
public function __construct($config,$data = array())
{
DaemonEvent::__construct($config,$data);
public function save()
{
$ret = DaemonEvent::save();
- $ret['users'] = array_values($this->users);
- $ret['groups'] = array_values($this->groups);
- $ret['subject'] = base64_encode($this->subject);
- $ret['from'] = $this->from;
- $ret['message'] = base64_encode($this->message);
+ $ret['users'] = array_values( $ret['users']);
+ $ret['groups'] = array_values( $ret['groups']);
+ $ret['subject'] = base64_encode($ret['subject']);
+ $ret['message'] = base64_encode($ret['message']);
return($ret);
}
}
diff --git a/gosa-plugins/goto/addons/goto/events/class_DaemonEvent_reinstall.inc b/gosa-plugins/goto/addons/goto/events/class_DaemonEvent_reinstall.inc
index 70c4d60df380abc79a6e6d0d7e79e7fca2b7d89f..8b596c192c8a9a1ff672ec3554f3fbe009d004d8 100644 (file)
$display.= $this->get_footer();
return($display);
}
-
- public function save()
- {
- $ret = DaemonEvent::save();
- return($ret);
- }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>