1 <?php
2 class ArpNewDevice extends plugin
3 {
4 var $cn= "";
5 var $description = "";
6 var $netConfigDNS = NULL;
7 var $attributes= array("cn","description");
8 var $objectclasses = array("gotoHard");
10 var $ignore_account = TRUE;
12 function ArpNewDevice ($config, $dn= NULL, $parent= NULL)
13 {
14 plugin :: plugin($config,$dn);
15 $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses);
16 $this->acl = "#all#";
17 $this->netConfigDNS->acl = $this->acl;
18 }
20 function execute()
21 {
22 /* Display sub dialog from network settings */
23 $this->netConfigDNS->acl = $this->acl;
24 if($this->netConfigDNS->dialog){
25 $this->dialog = TRUE;
26 return($this->netConfigDNS->execute());
27 }else{
28 $this->dialog = FALSE;
29 }
31 $smarty = get_smarty();
32 foreach($this->attributes as $attr){
33 $smarty->assign($attr,$this->$attr);
34 }
35 $this->netConfigDNS->cn= $this->cn;
36 $smarty->assign("netconfig", $this->netConfigDNS->execute());
37 return($smarty->fetch (get_template_path('ArpNewDevice.tpl', TRUE)));
38 }
40 function check()
41 {
42 $message= plugin::check();
43 $message= array_merge($message, $this->netConfigDNS->check());
44 return($message);
45 }
47 function save_object()
48 {
49 if(isset($_POST['ArpNewDevice_posted'])){
50 plugin::save_object();
51 $this->netConfigDNS->save_object();
52 }
53 }
55 function save()
56 {
57 $this->netConfigDNS->acl = $this->acl;
58 plugin::save();
59 $this->netConfigDNS->cn = $this->cn;
60 $this->netConfigDNS->save($this->dn);
61 $ldap = $this->config->get_ldap_link();
62 $ldap->cd($this->config->current['BASE']);
63 $ldap->rmdir_recursive($this->dn);
64 show_ldap_error($ldap->get_error(),_("Could not remove arp-alert device after writing dns and dhcp configuration."));
65 }
66 }
68 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
69 ?>