From e86ddbfbaf3faf358728e92bca45861facf004a8 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 22 Mar 2010 11:22:28 +0000 Subject: [PATCH] Updated dhcp plugin and made it w3c conform git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16990 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/services/dhcp/class_servDHCP.inc | 32 ++--- .../systems/services/dhcp/dhcpNewSection.tpl | 31 ++--- .../systems/services/dhcp/dhcp_advanced.tpl | 102 +++++++-------- .../systems/services/dhcp/dhcp_group.tpl | 21 ++- .../admin/systems/services/dhcp/dhcp_host.tpl | 66 +++++----- .../systems/services/dhcp/dhcp_network.tpl | 67 +++++----- .../admin/systems/services/dhcp/dhcp_pool.tpl | 36 +++--- .../systems/services/dhcp/dhcp_service.tpl | 61 ++++----- .../services/dhcp/dhcp_sharedNetwork.tpl | 121 +++++++++--------- .../systems/services/dhcp/dhcp_subnet.tpl | 93 +++++++------- .../systems/services/dhcp/remove_dhcp.tpl | 18 +-- .../admin/systems/services/dhcp/servdhcp.tpl | 57 ++++----- 12 files changed, 349 insertions(+), 356 deletions(-) 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 a8994c1eb..4b9485f31 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc @@ -231,8 +231,8 @@ class servdhcp extends goService foreach($_POST as $name => $value){ /* Insert new section? */ - if (preg_match('/^insertDhcp_.*_x$/', $name)){ - $id= preg_replace('/^insertDhcp_([^_]+)_x$/', '\1', $name); + if (preg_match('/^insertDhcp_.*/', $name)){ + $id= preg_replace('/^insertDhcp_(.*)$/', '\1', $name); $dn = $this->dhcpDNtoID[$id]; if (isset($this->dhcpObjectCache[$dn])){ $this->dialog= new dhcpNewSectionDialog($this->objectType($dn)); @@ -242,8 +242,8 @@ class servdhcp extends goService } /* Edit section? */ - if (preg_match('/^editDhcp_.*_x$/', $name)){ - $id= preg_replace('/^editDhcp_([^_]+)_x$/', '\1', $name); + if (preg_match('/^editDhcp_.*$/', $name)){ + $id= preg_replace('/^editDhcp_(.*)$/', '\1', $name); $dn = $this->dhcpDNtoID[$id]; if (isset($this->dhcpObjectCache[$dn])){ $section= $this->objectType($dn); @@ -253,8 +253,8 @@ class servdhcp extends goService } /* Remove section? */ - if (preg_match('/^delDhcp_.*_x$/', $name)){ - $id= preg_replace('/^delDhcp_([^_]+)_x$/', '\1', $name); + if (preg_match('/^delDhcp_.*$/', $name)){ + $id= preg_replace('/^delDhcp_(.*)$/', '\1', $name); $dn = $this->dhcpDNtoID[$id]; if (isset($this->dhcpObjectCache[$dn])){ $this->current_object= $dn; @@ -330,13 +330,15 @@ class servdhcp extends goService /* Add entries to divlist */ - $editImgIns = "". - "". - ""; - $editImgInsNoDel = "". - ""; - $editImg = "". - ""; + $editImgIns = image('images/lists/element.png[new]', 'insertDhcp_%s', _("Insert new DHCP section")); + $editImgIns.= image('images/lists/edit.png', 'editDhcp_%s', _("Edit DHCP section")); + $editImgIns.= image('images/lists/trash.png', 'delDhcp_%s', _("Remove DHCP section")); + + $editImgInsNoDel = image('images/lists/element.png[new]', 'insertDhcp_%s', _("Insert new DHCP section")); + $editImgInsNoDel.= image('images/lists/edit.png', 'editDhcp_%s', _("Edit DHCP section")); + + $editImg = image('images/lists/edit.png', 'editDhcp_%s', _("Edit DHCP section")); + $editImg.= image('images/lists/trash.png', 'delDhcp_%s', _("Remove DHCP section")); $tmp = new dhcpNewSectionDialog(NULL); foreach($this->dhcpSections as $section => $values ){ @@ -349,7 +351,7 @@ class servdhcp extends goService // Get entry ID $id = array_search($section,$this->dhcpDNtoID); - $values = "".$values.""; + $values = "".$values.""; $objtype = $this->objectType($section); $dhcpObject = new $objtype($this,$this->dhcpObjectCache[$section]); @@ -559,7 +561,7 @@ class servdhcp extends goService } /* Optionally execute a command after we're done */ - $this->handle_post_events("create"); + $this->handle_post_events("add"); } } } diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcpNewSection.tpl b/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcpNewSection.tpl index 330b7f7ed..5b70d1efa 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcpNewSection.tpl +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcpNewSection.tpl @@ -1,27 +1,28 @@ -
- {t}Create new DHCP section{/t} -
+ +
{t}Create new DHCP section{/t}
+

-{t}Please choose one of the following DHCP section types.{/t} + {t}Please choose one of the following DHCP section types.{/t}

-
-{t}Section{/t}  + +
{t}Section{/t}  +
-
- - - +
+ +
- + 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 00f0555a2..c1f3c1de1 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_advanced.tpl +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_advanced.tpl @@ -1,64 +1,52 @@ {* GOsa dhcp sharedNetwork - smarty template *} -
{if $show_advanced} - - - - - - - -
-
- {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} -
- -{else} - - - - + + + + + + + +
+
{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} +
+ {else} + {/if}
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 3349ddf48..38222a766 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_group.tpl +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_group.tpl @@ -1,15 +1,14 @@ {* GOsa dhcp sharedNetwork - smarty template *} +

{t}Generic{/t}

- + +
+ -
{t}Name{/t}{$must} - {t}Name{/t}{$must} - -{render acl=$acl} - -{/render} + {render acl=$acl} + + {/render}
@@ -18,7 +17,7 @@ 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 5ebce8123..51140e4df 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_host.tpl +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_host.tpl @@ -4,60 +4,64 @@ -

{t}Generic{/t}

+

{t}Generic{/t}

{t}Name{/t}{$must} -{render acl=$acl} - -{/render} + {render acl=$acl} + + {/render}
{t}Fixed address{/t} -{render acl=$acl} - -{/render} + {render acl=$acl} + + {/render}
+

{t}Hardware{/t}

- + +
- - - - - -
{t}Hardware type{/t} -{render acl=$acl} - {html_options options=$hwtypes selected=$hwtype} -{/render} -
{t}Hardware address{/t}{$must} -{render acl=$acl} - -{/render} -
- - + {/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 fc2d4ceb3..3a4013687 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_network.tpl +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_network.tpl @@ -3,6 +3,7 @@
+

{t}Network configuration{/t}

@@ -10,8 +11,8 @@ @@ -19,15 +20,16 @@ - + @@ -36,13 +38,14 @@

{t}Bootup{/t}

+
{t}Router{/t} {render acl=$acl} - + {/render}
{t}Netmask{/t} {render acl=$acl} - + {/render}
{t}Broadcast{/t}{t}Broadcast{/t} + {render acl=$acl} - + {/render}
@@ -50,69 +53,71 @@
{t}Filename{/t} {render acl=$acl} - + {/render}
{t}Next server{/t} {render acl=$acl} - + {/render}
- +

{t}Domain Name Service{/t}

+
{t}Domain{/t} {render acl=$acl} - - {/render} + + {/render}
+
{t}DNS server{/t}
- {t}DNS server{/t}
{render acl=$acl} - {html_options options=$dnsservers} {/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} + {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 505bc7222..46c5e2d91 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_pool.tpl +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_pool.tpl @@ -1,23 +1,23 @@ {* GOsa dhcp sharedNetwork - smarty template *} +

{t}Generic{/t}

- +
-
- {t}Name{/t}{$must}  -{render acl=$acl} - -{/render} + {t}Name{/t}{$must} + {render acl=$acl} + + {/render} - {t}Range{/t}{$must}  -{render acl=$acl} - -{/render} -  -  -{render acl=$acl} - -{/render} + {t}Range{/t} + {$must}  + {render acl=$acl} + + {/render} -  + {render acl=$acl} + + {/render}
@@ -26,7 +26,7 @@ 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 1614d0ee6..0c39f708a 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_service.tpl +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_service.tpl @@ -1,44 +1,46 @@ +

{t}Generic{/t}

- +
- -
-{render acl=$acl} - {t}Authoritative service{/t}
-{/render} -
- {t}Dynamic DNS update{/t} -{render acl=$acl} - -{/render} + {render acl=$acl} + {t}Authoritative service{/t} +
+ {/render} + +
{t}Dynamic DNS update{/t} + {render acl=$acl} + + {/render}
- - +
- - + + - - + +
{t}Default lease time (s){/t} -{render acl=$acl} - -{/render} - {t}Default lease time (s){/t} + {render acl=$acl} + + {/render} +
{t}Maximum lease time (s){/t} -{render acl=$acl} - -{/render} - {t}Maximum lease time (s){/t} + {render acl=$acl} + + {/render} +
@@ -46,7 +48,6 @@ 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 23b61228c..2204064d8 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_sharedNetwork.tpl +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_sharedNetwork.tpl @@ -1,127 +1,122 @@ {* GOsa dhcp sharedNetwork - smarty template *} +

{t}Generic{/t}

- - +
+ - -
- +
- +
{t}Name{/t}{$must} -{render acl=$acl} - -{/render} + {render acl=$acl} + + {/render}
{t}Server identifier{/t}{t}Server identifier{/t} + -{render acl=$acl} - -{/render} + {render acl=$acl} + + {/render}
- +
- - - - -
-{render acl=$acl} - {t}Authoritative server{/t} -{/render} -
+ {render acl=$acl} + {t}Authoritative server{/t} + {/render} +

- - +
+ - - +
- -

{t}Leases{/t}

- +

{t}Leases{/t}

+ +
- +
{t}Default lease time{/t}{t}Default lease time{/t} + -{render acl=$acl} -  {t}seconds{/t} -{/render} + {render acl=$acl} +  {t}seconds{/t} + {/render}
{t}Max. lease time{/t} -{render acl=$acl} -  {t}seconds{/t} -{/render} + {render acl=$acl} +  {t}seconds{/t} + {/render}
{t}Min. lease time{/t} -{render acl=$acl} -  {t}seconds{/t} -{/render} + {render acl=$acl} +  {t}seconds{/t} + {/render}
- -

{t}Access control{/t}

- +
-{render acl=$acl} - {t}Allow unknown clients{/t} -{/render} + {render acl=$acl} + {t}Allow unknown clients{/t} + {/render}
-{render acl=$acl} - {t}Allow bootp clients{/t} -{/render} + {render acl=$acl} + {t}Allow bootp clients{/t} + {/render}
-{render acl=$acl} - {t}Allow booting{/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 0d5e4595c..3dac7ec00 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_subnet.tpl +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/dhcp_subnet.tpl @@ -1,59 +1,66 @@ {* GOsa dhcp subnet - smarty template *} +

{t}Generic{/t}

- +
- + {render acl=$acl} + + {/render} + +
- + +
+ {render acl=$acl} + + {/render} + -
{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} -
-
+ + + + + + + + {/render} + + + + + + +
+ {render acl=$acl} + + {t}Range for dynamic address assignment{/t}
  + {render acl=$acl} + + {/render}  + -  + {render acl=$acl} + + {/render} +
+ + - - -
+ + + + +
diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/remove_dhcp.tpl b/gosa-plugins/dhcp/admin/systems/services/dhcp/remove_dhcp.tpl index caa28d015..d1a7f1511 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/remove_dhcp.tpl +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/remove_dhcp.tpl @@ -1,20 +1,14 @@ -
-{image path="images/warning.png" align="top"} {t}Warning{/t} +
+ {image path="images/warning.png" align="top"} {t}Warning{/t}

- {$warning} - {t}This includes 'all' DHCP subsections that are located within this section. Please double check if your really want to do this since there is no way for GOsa to get your data back.{/t} + {$warning}{t}This includes 'all' DHCP subsections that are located within this section. Please double check if your really want to do this since there is no way for GOsa to get your data back.{/t}

- -

- {t}Best thing to do before performing this action would be to save the current contents of your LDAP tree in a file. So - if you've done so - press 'Delete' to continue or 'Cancel' to abort.{/t} +

{t}Best thing to do before performing this action would be to save the current contents of your LDAP tree in a file. So - if you've done so - press 'Delete' to continue or 'Cancel' to abort.{/t}

-
- - - - + +
diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/servdhcp.tpl b/gosa-plugins/dhcp/admin/systems/services/dhcp/servdhcp.tpl index 40b695e2d..eead9fd95 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/servdhcp.tpl +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/servdhcp.tpl @@ -1,39 +1,36 @@ + + {if $dns_take_over} - - - - -
+

{t}DHCP take over will take place when saving this entry. Choose 'Cancel' to abort.{/t}

-

{t}DHCP take over will take place when saving this entry. Choose 'Cancel' to abort.{/t}

-
{else} - -{if $dhcp_server_list_cnt} - - - -{/if} - +
- {t}Take over dhcp configuration from following server{/t}  - - - -
+ + {if $dhcp_server_list_cnt} + - -
- -

{t}DHCP sections{/t}

- {$DhcpList} + {t}Take over dhcp configuration from following server{/t}  + +
+ + + {/if} + + +

{t}DHCP sections{/t}

+ {$DhcpList} + + + + {/if} -
+
- - -
{msgPool type=saveButton} + +
-- 2.30.2