Code

Updated table summary
[gosa.git] / 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     plugin::execute();
23                 $smarty = get_smarty();
25     if($this->is_account && !$this->view_logged){
26       $this->view_logged = TRUE;
27       new log("view","server/".get_class($this),$this->dn);
28     }
30                 foreach($this->attributes as $attr){
31                         $smarty->assign($attr,$this->$attr);
32                 }
33                 return($smarty->fetch(get_template_path("goSpamServerRule.tpl",TRUE,dirname(__FILE__))));                       
34         }
36         function save_object()
37         {
38                 plugin::save_object();
39                 foreach($this->attributes as $attr){
40                         if(isset($_POST[$attr])){
41                                 $this->$attr = $_POST[$attr];
42                         }
43                 }
44         }
46   function acl_is_writeable($attribute,$skip_write = FALSE)
47   {
48     if($this->read_only) return(FALSE);
49     $ui= get_userinfo();
50     return preg_match('/w/', $ui->get_permissions($this->acl_base, $this->acl_category."gospamserver", $attribute,      $skip_write));
51   }
53         function save()
54         {
55                 $ret =array();
56                 $ret['orig_name'] = $this->orig_name;
57                 $ret['name'] = $this->name;
58                 $ret['rule'] = $this->rule;
59                 return($ret);
60         }
61         
62         function check()
63         {
64                 $messages = plugin::check();
65                 return($messages);
66         }
67 }
68 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
69 ?>