f3cfc4ed6693935e0c90cb9d5d4f98bbe50781b8
1 <?php
3 class termDNS extends plugin
4 {
5 /* CLI vars */
6 var $cli_summary= "Manage server basic objects";
7 var $cli_description= "Some longer text\nfor help";
8 var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
10 /* attribute list for save action */
11 var $ignore_account= TRUE;
12 var $attributes= array("ipHostNumber","macAddress");
13 var $objectclasses= array("whatever");
15 var $ipHostNumber ="";
16 var $macAddress ="";
18 function termDNS ($config, $dn,$objectClasses)
19 {
20 $this->objectclasses= $objectClasses;
21 plugin::plugin ($config, $dn);
22 }
24 function execute()
25 {
26 /* Call parent execute */
27 $smarty= get_smarty();
28 $display= "";
29 foreach($this->attributes as $attr){
30 $smarty->assign($attr,$this->$attr);
31 }
32 $smarty->assign("staticAddress","<font class=\"must\">*</font>");
33 $display.= $smarty->fetch(get_template_path('network.tpl', TRUE));
34 return($display);
35 }
37 function remove_from_parent()
38 {
39 /* This cannot be removed... */
40 }
43 /* Save data to object */
44 function save_object()
45 {
46 plugin::save_object();
47 foreach($this->attributes as $attr){
48 if(isset($_POST[$attr])){
49 $this->$attr = $_POST[$attr];
50 }
51 }
52 }
55 /* Check supplied data */
56 function check()
57 {
58 $message= array();
60 return ($message);
61 }
64 /* Save to LDAP */
65 function save($dn)
66 {
67 $org_dn = $dn;
68 $this->dn = $dn;
69 plugin::save();
71 /* Write back to ldap */
72 $ldap= $this->config->get_ldap_link();
73 $ldap->cd($this->dn);
74 $ldap->modify($this->attrs);
75 }
76 }
78 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
79 ?>