1 <?php
3 class servdhcp 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();
13 var $objectclasses= array("whatever");
14 var $view_logged = FALSE;
16 function servdhcp ($config, $dn= NULL, $parent= NULL)
17 {
18 plugin::plugin ($config, $dn, $parent);
19 }
21 function execute()
22 {
23 /* Call parent execute */
24 plugin::execute();
26 if($this->is_account && !$this->view_logged){
27 $this->view_logged = TRUE;
28 new log("view","server/".get_class($this),$this->dn);
29 }
31 /* Fill templating stuff */
32 $smarty= get_smarty();
33 $display= "";
35 /* Do we need to flip is_account state? */
36 if (isset($_POST['modify_state'])){
37 $this->is_account= !$this->is_account;
38 }
40 /* Show tab dialog headers */
41 if ($this->is_account){
42 $display= $this->show_disable_header(_("Remove DHCP service"),
43 _("This server has DHCP features enabled. You can disable them by clicking below."));
44 } else {
45 $display= $this->show_enable_header(_("Add DHCP service"),
46 _("This server has DHCP features disabled. You can enable them by clicking below."));
47 return ($display);
48 }
50 $display.= $smarty->fetch(get_template_path('servdhcp.tpl', TRUE));
51 return($display);
52 }
54 function remove_from_parent()
55 {
56 /* This cannot be removed... */
57 new log("remove","unknown/".get_class($this),$this->dn);
58 }
61 /* Save data to object */
62 function save_object()
63 {
64 plugin::save_object();
65 }
68 /* Check supplied data */
69 function check()
70 {
71 /* Call common method to give check the hook */
72 $message= plugin::check();
74 return ($message);
75 }
78 /* Save to LDAP */
79 function save()
80 {
81 plugin::save();
82 new log("modfiy","unknown/".get_class($this),$this->dn);
84 /* Optionally execute a command after we're done */
85 #$this->handle_post_events($mode);
86 }
88 }
90 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
91 ?>