1 <?php
2 class goSpamServerRule extends plugin {
4 var $attributes = array("name","rule");
5 var $name = "";
6 var $rule = "";
8 var $orig_name = "";
10 function goSpamServerRule($config,$dn,$name = "",$rule ="")
11 {
12 plugin::plugin($config,$dn);
13 $this->name = $this->orig_name= $name;
14 $this->rule = $rule;
15 }
18 function execute()
19 {
20 $smarty = get_smarty();
21 foreach($this->attributes as $attr){
22 $smarty->assign($attr,$this->$attr);
23 }
24 return($smarty->fetch(get_template_path("goSpamServerRule.tpl",TRUE,dirname(__FILE__))));
25 }
27 function save_object()
28 {
29 plugin::save_object();
30 foreach($this->attributes as $attr){
31 if(isset($_POST[$attr])){
32 $this->$attr = $_POST[$attr];
33 }
34 }
35 }
38 function save()
39 {
40 $ret =array();
41 $ret['orig_name'] = $this->orig_name;
42 $ret['name'] = $this->name;
43 $ret['rule'] = $this->rule;
44 return($ret);
45 }
47 function check()
48 {
49 $messages = plugin::check();
50 return($messages);
51 }
52 }
53 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
54 ?>