1 <?php
4 class krb5_policy extends plugin
5 {
6 var $name = "";
7 var $data = array();
8 var $is_new = TRUE;
9 var $config;
10 var $attributes = array("MASK","POLICY_REFCNT","PW_HISTORY_NUM","PW_MAX_LIFE","PW_MIN_CLASSES","PW_MIN_LENGTH","PW_MIN_LIFE");
12 public function __construct($config,$entry = array())
13 {
14 $this->config = $config;
15 if(count($entry)){
16 $this->is_new =FALSE;
17 $this->name = $entry['NAME'];
18 $this->data = $entry['DATA'];
19 }
20 $this->init_name = $this->name;
21 }
23 public function execute()
24 {
25 $display = plugin::execute();
26 $smarty = get_smarty();
28 foreach($this->attributes as $attr){
29 $smarty->assign($attr,$this->data[$attr]);
30 }
31 return($smarty->fetch(get_template_path("krb5_policy.tpl",TRUE,dirname(__FILE__))));
32 }
35 public function save_object()
36 {
37 if(isset($_POST['Policy_Posted'])){
38 foreach($this->attributes as $attr){
39 if(isset($_POST[$attr])){
40 $this->data[$attr] = get_post($attr);
41 }
42 }
43 }
44 }
47 public function save()
48 {
49 $ret = array();
50 $ret['INITIAL_NAME']= $this->init_name;
51 $ret['NAME'] = $this->name;
52 $ret['DATA'] = $this->data;
53 return($ret);
54 }
55 }
57 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
58 ?>