Code

Created trunk inside of 2.6-lhm
[gosa.git] / trunk / gosa-plugins / mail / admin / systems / services / spam / class_goSpamServerRule.inc
1 <?php
2 class goSpamServerRule extends plugin {
4         var $attributes = array("name","rule");
5         var $name = "";
6         var $rule = "";
7         
8         var $orig_name = "";
9   var $view_logged  =FALSE;
10         
11         function goSpamServerRule(&$config,$dn,$name = "",$rule ="")
12         {
13                 plugin::plugin($config,$dn);
14                 $this->name = $this->orig_name= $name;
15                 $this->rule = $rule;
16         }
19         function execute()
20         {
21                 $smarty = get_smarty();
23     if($this->is_account && !$this->view_logged){
24       $this->view_logged = TRUE;
25       new log("view","server/".get_class($this),$this->dn);
26     }
28                 foreach($this->attributes as $attr){
29                         $smarty->assign($attr,$this->$attr);
30                 }
31                 return($smarty->fetch(get_template_path("goSpamServerRule.tpl",TRUE,dirname(__FILE__))));                       
32         }
34         function save_object()
35         {
36                 plugin::save_object();
37                 foreach($this->attributes as $attr){
38                         if(isset($_POST[$attr])){
39                                 $this->$attr = $_POST[$attr];
40                         }
41                 }
42         }
45         function save()
46         {
47                 $ret =array();
48                 $ret['orig_name'] = $this->orig_name;
49                 $ret['name'] = $this->name;
50                 $ret['rule'] = $this->rule;
51                 return($ret);
52         }
53         
54         function check()
55         {
56                 $messages = plugin::check();
57                 return($messages);
58         }
59 }
60 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
61 ?>