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","PW_HISTORY_NUM","PW_MAX_LIFE",
11 "PW_MIN_CLASSES","PW_MIN_LENGTH","PW_MIN_LIFE","REF_COUNT");
13 public function __construct($config,$entry = array())
14 {
15 $this->config = $config;
16 if(count($entry)){
17 $this->is_new =FALSE;
18 $this->name = $entry['NAME'];
19 $this->data = $entry['DATA'];
20 }
21 $this->init_name = $this->name;
22 }
24 public function execute()
25 {
26 $display = plugin::execute();
27 $smarty = get_smarty();
29 foreach($this->attributes as $attr){
30 $smarty->assign($attr,$this->data[$attr]);
31 }
32 return($smarty->fetch(get_template_path("krb5_policy.tpl",TRUE,dirname(__FILE__))));
33 }
36 public function save_object()
37 {
38 if(isset($_POST['Policy_Posted'])){
39 foreach($this->attributes as $attr){
40 if(isset($_POST[$attr])){
41 $this->data[$attr] = get_post($attr);
42 }
43 }
44 }
45 }
48 public function save()
49 {
50 $ret = array();
51 $ret['INITIAL_NAME']= $this->init_name;
52 $ret['NAME'] = $this->name;
53 $ret['DATA'] = $this->data;
54 return($ret);
55 }
56 }
58 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
59 ?>