From 2f9491c9fe382c97d9598d95ddd5b57766f22052 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 22 Jul 2008 12:53:25 +0000 Subject: [PATCH] Prepared dhcp plugins for ACLs. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11749 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../services/dhcp/class_dhcpAdvanced.inc | 4 +++ .../systems/services/dhcp/class_dhcpGroup.inc | 7 ++++-- .../systems/services/dhcp/class_dhcpHost.inc | 3 +++ .../services/dhcp/class_dhcpNetwork.inc | 3 +++ .../services/dhcp/class_dhcpPlugin.inc | 7 +++++- .../systems/services/dhcp/class_dhcpPool.inc | 3 +++ .../services/dhcp/class_dhcpService.inc | 3 +++ .../services/dhcp/class_dhcpSharedNetwork.inc | 3 +++ .../services/dhcp/class_dhcpSubnet.inc | 3 +++ .../systems/services/dhcp/class_servDHCP.inc | 9 ++++--- .../systems/services/dhcp/dhcp_advanced.tpl | 16 ++++++++++++ .../systems/services/dhcp/dhcp_group.tpl | 2 ++ .../admin/systems/services/dhcp/dhcp_host.tpl | 8 ++++++ .../systems/services/dhcp/dhcp_network.tpl | 24 ++++++++++++++++++ .../admin/systems/services/dhcp/dhcp_pool.tpl | 6 +++++ .../systems/services/dhcp/dhcp_service.tpl | 8 ++++++ .../services/dhcp/dhcp_sharedNetwork.tpl | 18 +++++++++++++ .../systems/services/dhcp/dhcp_subnet.tpl | 25 ++++++++++++++++--- 18 files changed, 141 insertions(+), 11 deletions(-) diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpAdvanced.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpAdvanced.inc index 3e2be402e..9f9df65fc 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpAdvanced.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpAdvanced.inc @@ -30,6 +30,7 @@ class dhcpAdvanced extends plugin /* attribute list for save action */ var $attributes= array(); var $objectclasses= array(); + var $parent; function dhcpAdvanced() { @@ -71,6 +72,9 @@ class dhcpAdvanced extends plugin $smarty= get_smarty(); + /* Assign ACLs */ + $smarty->assign("acl",$this->parent->getacl("")); + /* Assign arrays */ $statements= array(); foreach ($this->statements as $key => $val){ diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpGroup.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpGroup.inc index 8e92b5ce0..08d728efb 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpGroup.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpGroup.inc @@ -23,10 +23,10 @@ class dhcpGroup extends dhcpPlugin /* attribute list for save action */ var $objectclasses= array('top', 'dhcpGroup', 'dhcpOptions'); - function dhcpGroup(&$attrs) + function dhcpGroup($parent,&$attrs) { /* Load statements / options */ - dhcpPlugin::dhcpPlugin($attrs); + dhcpPlugin::dhcpPlugin($parent,$attrs); } function execute() @@ -34,6 +34,9 @@ class dhcpGroup extends dhcpPlugin $smarty= get_smarty(); $smarty->assign("cn", $this->cn); + /* Assign ACLs */ + $smarty->assign("acl",$this->parent->getacl("")); + /* Show main page */ $display= $smarty->fetch (get_template_path('dhcp_group.tpl', TRUE, dirname(__FILE__))).$this->network->execute(); diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpHost.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpHost.inc index 87f4f247a..89b0c1d80 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpHost.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpHost.inc @@ -49,6 +49,9 @@ class dhcpHost extends dhcpPlugin $smarty->assign("dhcpHWAddress", preg_replace('/^[^ ]+ /', '', $this->dhcpHWAddress)); $smarty->assign("realGosaHost",$this->realGosaHost); + /* Assign ACLs */ + $smarty->assign("acl",$this->parent->getacl("")); + /* Create fixed address */ if (isset($this->statements['fixed-address'])){ $smarty->assign("fixedaddr", $this->statements['fixed-address']); diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpNetwork.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpNetwork.inc index 1b9453542..6054eb696 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpNetwork.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpNetwork.inc @@ -70,6 +70,9 @@ class dhcpNetwork extends plugin /* Show main page */ $smarty= get_smarty(); + /* Assign ACLs */ + $smarty->assign("acl",$this->parent->getacl("")); + /* * Assemble options */ diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpPlugin.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpPlugin.inc index 615981ce1..ac8d0f86a 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpPlugin.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpPlugin.inc @@ -34,8 +34,10 @@ class dhcpPlugin extends plugin var $attributes= array(); var $objectclasses= array(); - function dhcpPlugin($attrs) + function dhcpPlugin(&$parent,$attrs) { + $this->parent = $parent; + /* Load statements / options */ if (is_array($attrs)){ $this->dn= $attrs['dn']; @@ -82,6 +84,9 @@ class dhcpPlugin extends plugin $this->advanced->options= $this->options; $this->advanced->statements= $this->statements; + $this->network->parent = $parent; + $this->advanced->parent = $parent; + /* Save CN for later reference */ $this->orig_cn= $this->cn; } diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpPool.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpPool.inc index 0de8a8682..e2cff119b 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpPool.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpPool.inc @@ -49,6 +49,9 @@ class dhcpPool extends dhcpPlugin $smarty->assign("range_start", $this->range_start); $smarty->assign("range_stop", $this->range_stop); + /* Assign ACLs */ + $smarty->assign("acl",$this->parent->getacl("")); + /* Show main page */ $display= $smarty->fetch(get_template_path('dhcp_pool.tpl', TRUE, dirname(__FILE__))).$this->network->execute(); diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpService.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpService.inc index 5856976d3..59c565884 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpService.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpService.inc @@ -58,6 +58,9 @@ class dhcpService extends dhcpPlugin /* Show main page */ $smarty= get_smarty(); + /* Assign ACLs */ + $smarty->assign("acl",$this->parent->getacl("")); + $smarty->assign('ddns_styles', $this->ddns_styles); foreach (array('max_lease_time', 'default_lease_time', 'ddns_update_style') as $value){ if (isset($this->statements[preg_replace('/_/', '-', $value)])){ diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSharedNetwork.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSharedNetwork.inc index f51be78dc..e512cb663 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSharedNetwork.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSharedNetwork.inc @@ -37,6 +37,9 @@ class dhcpSharedNetwork extends dhcpPlugin { $smarty= get_smarty(); + /* Assign ACLs */ + $smarty->assign("acl",$this->parent->getacl("")); + /* Fill template */ $smarty->assign ("cn", $this->cn); foreach (array("server-identifier", "default-lease-time", "max-lease-time", "min-lease-time") as $attr){ diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSubnet.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSubnet.inc index 18c02eced..fe10195cc 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSubnet.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSubnet.inc @@ -57,6 +57,9 @@ class dhcpSubnet extends dhcpPlugin $smarty->assign("cn", $this->cn); $smarty->assign("dhcp_netmask", $this->dhcpNetMask); + /* Assign ACLs */ + $smarty->assign("acl",$this->parent->getacl("")); + /* Prepare range */ if ($this->use_range){ $smarty->assign("use_range", "checked"); diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc index 219fa5f87..9872d70c7 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc @@ -121,7 +121,7 @@ class servdhcp extends goService $section= $_POST['section']; $tmp = new dhcpNewSectionDialog(NULL); if (isset($tmp->sectionMap[$section])){ - $this->dialog= new $section($this->current_object); + $this->dialog= new $section($this,$this->current_object); $this->current_object= ""; } else { $this->dialog= FALSE; @@ -154,6 +154,7 @@ class servdhcp extends goService } $data= $this->dialog->save(); if ($this->current_object == ""){ + /* New object */ $newsects= array(); foreach ($this->dhcpSections as $key => $dsc){ @@ -242,7 +243,7 @@ class servdhcp extends goService if (isset($this->dhcpObjectCache[$dn])){ $section= $this->objectType($dn); $this->current_object= $dn; - $this->dialog= new $section($this->dhcpObjectCache[$dn]); + $this->dialog= new $section($this,$this->dhcpObjectCache[$dn]); } } @@ -264,7 +265,7 @@ class servdhcp extends goService if (isset($this->dhcpObjectCache[$dn])){ $section= $this->objectType($dn); $this->current_object= $dn; - $this->dialog= new $section($this->dhcpObjectCache[$dn]); + $this->dialog= new $section($this,$this->dhcpObjectCache[$dn]); } } @@ -274,7 +275,7 @@ class servdhcp extends goService if (isset($this->dhcpObjectCache[$dn])){ $section= $this->objectType($dn); $this->current_object= $dn; - $this->dialog= new $section($this->dhcpObjectCache[$dn]); + $this->dialog= new $section($this,$this->dhcpObjectCache[$dn]); } } diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_advanced.tpl b/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_advanced.tpl index b743a73d6..803fd261c 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_advanced.tpl +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_advanced.tpl @@ -14,26 +14,42 @@
{t}DHCP statements{/t}
+{render acl=$acl} +{/render}
+{render acl=$acl}   +{/render} +{render acl=$acl}   +{/render} +{render acl=$acl} +{/render}
{t}DHCP options{/t}
+{render acl=$acl} +{/render}
+{render acl=$acl}   +{/render} +{render acl=$acl}   +{/render} +{render acl=$acl} +{/render} diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_group.tpl b/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_group.tpl index 930fc05ee..ba57fb381 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_group.tpl +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_group.tpl @@ -6,8 +6,10 @@ {t}Name{/t}{$must} +{render acl=$acl} +{/render} diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_host.tpl b/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_host.tpl index 602c51255..d49c4d680 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_host.tpl +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_host.tpl @@ -7,16 +7,20 @@ {t}Name{/t}{$must} +{render acl=$acl} +{/render} {t}Fixed address{/t} +{render acl=$acl} +{/render} @@ -26,15 +30,19 @@ {t}Hardware type{/t} +{render acl=$acl} +{/render} {t}Hardware address{/t}{$must} +{render acl=$acl} +{/render} diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_network.tpl b/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_network.tpl index d9374a195..5716a7eb0 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_network.tpl +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_network.tpl @@ -7,20 +7,26 @@ {t}Router{/t} +{render acl=$acl} +{/render} {t}Netmask{/t} +{render acl=$acl} +{/render} {t}Broadcast{/t} +{render acl=$acl} +{/render} @@ -31,15 +37,19 @@ {t}Filename{/t} +{render acl=$acl} +{/render} {t}Next server{/t} +{render acl=$acl} +{/render} @@ -51,29 +61,43 @@ {t}Domain{/t} +{render acl=$acl} +{/render}
{t}DNS server{/t}
+{render acl=$acl} +{/render}
+{render acl=$acl}   +{/render} +{render acl=$acl} +{/render} +{render acl=$acl} +{/render}

{t}Domain Name Service options{/t}

+{render acl=$acl} {t}Assign hostnames found via reverse mapping{/t} +{/render}
+{render acl=$acl} {t}Assign hostnames from host declarations{/t} +{/render} diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_pool.tpl b/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_pool.tpl index dcbd05c3d..7b1ec4f5e 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_pool.tpl +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_pool.tpl @@ -4,14 +4,20 @@ {t}Name{/t}{$must}  +{render acl=$acl} +{/render} {t}Range{/t}{$must}  +{render acl=$acl} +{/render}  -  +{render acl=$acl} +{/render} diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_service.tpl b/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_service.tpl index 6ca515e67..94f709ae7 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_service.tpl +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_service.tpl @@ -3,12 +3,16 @@
+{render acl=$acl} {t}Authoritative service{/t}
+{/render}
{t}Dynamic DNS update{/t} +{render acl=$acl} +{/render}
@@ -17,13 +21,17 @@
{t}Default lease time (s){/t} +{render acl=$acl} +{/render}
{t}Maximum lease time (s){/t} +{render acl=$acl} +{/render}
diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_sharedNetwork.tpl b/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_sharedNetwork.tpl index 374da3500..b7467147f 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_sharedNetwork.tpl +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_sharedNetwork.tpl @@ -9,14 +9,18 @@ {t}Name{/t}{$must} +{render acl=$acl} +{/render} {t}Server identifier{/t} +{render acl=$acl} +{/render} @@ -27,8 +31,10 @@
+{render acl=$acl} {t}Authoritative server{/t} +{/render}
@@ -48,22 +54,28 @@ {t}Default lease time{/t} +{render acl=$acl}  {t}seconds{/t} +{/render} {t}Max. lease time{/t} +{render acl=$acl}  {t}seconds{/t} +{/render} {t}Min. lease time{/t} +{render acl=$acl}  {t}seconds{/t} +{/render} @@ -75,20 +87,26 @@
+{render acl=$acl} {t}Allow unknown clients{/t} +{/render}
+{render acl=$acl} {t}Allow bootp clients{/t} +{/render}
+{render acl=$acl} {t}Allow booting{/t} +{/render}
diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_subnet.tpl b/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_subnet.tpl index 05425fbdc..7f19551b1 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_subnet.tpl +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_subnet.tpl @@ -6,24 +6,41 @@ - + - +
{t}Network address{/t}{$must} +{render acl=$acl} + +{/render} +
{t}Netmask{/t}{$must}
+{render acl=$acl} + +{/render} +
- + +{/render} -
+{render acl=$acl} + {t}Range for dynamic address assignment{/t}
  + +{render acl=$acl} + +{/render}  -  +{render acl=$acl} +{/render}
-- 2.30.2