From ac6d6be832f75ae18299022d5457b8ba3e84dccd Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 16 Oct 2007 10:36:50 +0000 Subject: [PATCH] Added arp-alert device handling gosa.conf git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7570 594d385d-05f5-0310-b6e9-bd551577e9d8 --- contrib/gosa.conf | 6 ++ plugins/admin/systems/ArpNewDevice.tpl | 27 ++++++++ plugins/admin/systems/class_ArpNewDevice.inc | 69 +++++++++++++++++++ plugins/admin/systems/class_divListSystem.inc | 6 +- .../admin/systems/class_systemManagement.inc | 7 +- plugins/admin/systems/tabs_arpnewdevice.inc | 13 ++++ 6 files changed, 124 insertions(+), 4 deletions(-) create mode 100644 plugins/admin/systems/ArpNewDevice.tpl create mode 100644 plugins/admin/systems/class_ArpNewDevice.inc create mode 100644 plugins/admin/systems/tabs_arpnewdevice.inc diff --git a/contrib/gosa.conf b/contrib/gosa.conf index 027f781e4..2018dd816 100644 --- a/contrib/gosa.conf +++ b/contrib/gosa.conf @@ -170,6 +170,12 @@ + + diff --git a/plugins/admin/systems/ArpNewDevice.tpl b/plugins/admin/systems/ArpNewDevice.tpl new file mode 100644 index 000000000..a50832630 --- /dev/null +++ b/plugins/admin/systems/ArpNewDevice.tpl @@ -0,0 +1,27 @@ +

{t}Properties{/t}

+ + + + + + + + + +
+ + + +
+ + + +
+{$netconfig} + + + diff --git a/plugins/admin/systems/class_ArpNewDevice.inc b/plugins/admin/systems/class_ArpNewDevice.inc new file mode 100644 index 000000000..fb8275bef --- /dev/null +++ b/plugins/admin/systems/class_ArpNewDevice.inc @@ -0,0 +1,69 @@ +netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses); + $this->acl = "#all#"; + $this->netConfigDNS->acl = $this->acl; + } + + function execute() + { + /* Display sub dialog from network settings */ + $this->netConfigDNS->acl = $this->acl; + if($this->netConfigDNS->dialog){ + $this->dialog = TRUE; + return($this->netConfigDNS->execute()); + }else{ + $this->dialog = FALSE; + } + + $smarty = get_smarty(); + foreach($this->attributes as $attr){ + $smarty->assign($attr,$this->$attr); + } + $this->netConfigDNS->cn= $this->cn; + $smarty->assign("netconfig", $this->netConfigDNS->execute()); + return($smarty->fetch (get_template_path('ArpNewDevice.tpl', TRUE))); + } + + function check() + { + $message= plugin::check(); + $message= array_merge($message, $this->netConfigDNS->check()); + return($message); + } + + function save_object() + { + if(isset($_POST['ArpNewDevice_posted'])){ + plugin::save_object(); + $this->netConfigDNS->save_object(); + } + } + + function save() + { + $this->netConfigDNS->acl = $this->acl; + plugin::save(); + $this->netConfigDNS->cn = $this->cn; + $this->netConfigDNS->save($this->dn); + $ldap = $this->config->get_ldap_link(); + $ldap->cd($this->config->current['BASE']); + $ldap->rmdir_recursive($this->dn); + show_ldap_error($ldap->get_error(),_("Could not remove arp-alert device after writing dns and dhcp configuration.")); + } +} + +// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: +?> diff --git a/plugins/admin/systems/class_divListSystem.inc b/plugins/admin/systems/class_divListSystem.inc index 33985e164..32c68d3b3 100644 --- a/plugins/admin/systems/class_divListSystem.inc +++ b/plugins/admin/systems/class_divListSystem.inc @@ -136,9 +136,9 @@ class divListSystem extends MultiSelectWindow $cnts = array("component" => 0 , "terminal" => 0 , "workstation" => 0 , "printer" => 0 , "phone" => 0 , "server" => 0, - "NewDevice" => 0, "winstation"=> 0); + "NewDevice" => 0, "winstation"=> 0,"ArpNewDevice"=>0); - // Test Every Entry and generate divlist Array + // Test Every Entry and generate divlist Array foreach($terminals as $key => $val){ $acl= get_permissions ($val['dn'], $this->ui->subtreeACL); @@ -238,7 +238,7 @@ class divListSystem extends MultiSelectWindow $str.= "".$num_com_str." ".$cnts['component']."    "; $str.= "".$num_new_str." ".$cnts['NewDevice']."    "; + title='".$num_new_str."' alt='".$num_new_str."'> ".($cnts['NewDevice']+$cnts['ArpNewDevice'])."    "; $str.= "".$num_wws_str." ".$cnts['winstation']."    "; $str.= " array("CLASS"=>"COMPONENTTABS","TABCLASS" =>"componenttabs")); - if($type == "NewDevice"){ + if($type == "ArpNewDevice"){ + $this->systab = new ArpNewDeviceTabs($this->config,$this->config->data['TABS']['ARPNEWDEVICETABS'],$this->dn); + }elseif($type == "NewDevice"){ $this->systab = new SelectDeviceType($this->config,$this->dn) ; }elseif(isset($tabs[$type])){ @@ -845,6 +848,8 @@ class systems extends plugin $type= "phone"; }elseif (in_array_ics('goServer', $classes)){ $type= "server"; + }elseif (in_array_ics('GOhard', $classes)&& !in_array('gotoMode', $classes)){ + $type= "ArpNewDevice"; }elseif (in_array_ics('GOhard', $classes)){ $type= "NewDevice"; }elseif (in_array_ics('sambaAccount', $classes) || diff --git a/plugins/admin/systems/tabs_arpnewdevice.inc b/plugins/admin/systems/tabs_arpnewdevice.inc new file mode 100644 index 000000000..f815a5a6c --- /dev/null +++ b/plugins/admin/systems/tabs_arpnewdevice.inc @@ -0,0 +1,13 @@ + -- 2.30.2