summaryrefslogtreecommitdiffstats
path: root/ldap-site-mngmt/webinterface/dhcp/dhcppool.php
diff options
context:
space:
mode:
Diffstat (limited to 'ldap-site-mngmt/webinterface/dhcp/dhcppool.php')
-rw-r--r--ldap-site-mngmt/webinterface/dhcp/dhcppool.php126
1 files changed, 26 insertions, 100 deletions
diff --git a/ldap-site-mngmt/webinterface/dhcp/dhcppool.php b/ldap-site-mngmt/webinterface/dhcp/dhcppool.php
index 2d7da0ff..d35edd18 100644
--- a/ldap-site-mngmt/webinterface/dhcp/dhcppool.php
+++ b/ldap-site-mngmt/webinterface/dhcp/dhcppool.php
@@ -1,18 +1,14 @@
<?php
+
include('../standard_header.inc.php');
-# 1. Seitentitel - wird in der Titelleiste des Browser angezeigt.
-$titel = "DHCP Service Management";
-# 2. Nummern der zugehörigen Menus.
-$mainnr = 5;
-$mnr = 3;
-$sbmnr = -1;
-# 3. Dateiname und evtl. Pfad des Templates für die Webseite
+# Dateiname und evtl. Pfad des Templates für die Webseite
$webseite = "dhcppool.dwt";
-include("../class.FastTemplate.php");
include('dhcp_header.inc.php');
+$mnr = 3;
+$sbmnr = -1;
###################################################################################
@@ -23,110 +19,38 @@ $sbmnr = $_GET['sbmnr'];
createMainMenu($rollen, $mainnr);
createDhcpMenu($rollen, $mnr, $auDN, $sbmnr);
-include("ip_blocks.inc.php");
-
###################################################################################
-$template->define_dynamic("Poolform", "Webseite");
-$template->assign(array("POOLFORMULAR" => "",
- #"POOLDN" => "",
+# DHCP Pools Daten holen
+$attributes = array("dn","cn","dhcphlpcont","dhcprange","description","dhcpstatements","dhcpoptallow",
+ "dhcpoptdefault-lease-time","dhcpoptdeny","dhcpoptignore","dhcpoptmax-lease-time",
+ "dhcpoptgeneric");
+$pools = get_dhcppools($auDN, $attributes);
+#print_r($pools);
+if (count($pools) == 0){
+ redirect(0, "dhcpnopool.php?mnr=".$mnr, "", $addSessionId = TRUE);
+ die;
+}
+
+$template->assign(array("POOLDN" => "",
"CN" => "",
"SUBNETDN" => "",
- #"SUBNET" => "",
- #"RANGE1" => "",
- #"RANGE2" => "",
+ "SUBNET" => "",
+ "RANGE1" => "",
+ "RANGE2" => "",
"DESCRIPTION" => "",
"STATEMENTS" => "",
+ "ALLOW" => "",
+ "DENY" => "",
+ "IGNORE" => "",
"DEFAULTLEASE" => "",
"MAXLEASE" => "",
"MNR" => $mnr));
-# DHCP Pools Daten holen
-$attributes = array("dn","cn","dhcphlpcont","dhcprange","description","dhcpstatements","dhcpoptallow",
- "dhcpoptdefault-lease-time","dhcpoptdeny","dhcpoptignore","dhcpoptmax-lease-time",
- "dhcpoptgeneric");
-$pools = get_dhcppools($auDN, $attributes);
-#print_r($pools);
-
-if (count($pools) != 0){
-
-
-
-$poolform = "
- <tr><td>
- <table cellpadding='7' cellspacing='0' border='1' align='left' width='90%' style='border-width: 0 0 0 0;'>
-
- <form action='dhcppools_change.php' method='post'>
-
- <tr>
- <td width='30%' class='tab_h'><b>Subnetz</b></td>
- <td width='50%' class='tab_h'><b>IP Ranges (innerhalb Subnetz)</b></td>
- <td width='20%' class='tab_h'><b>Unknown Clients</b></td>
- </tr>
-
- <!-- BEGIN DYNAMIC BLOCK: Dhcppools -->
-
- <tr height='50' valign='top'>
- <td class='tab_d'><b>{SUBNET}/24</b><br><br>
- <input type='checkbox' name='delpool[]' value='{POOLDN}' size='10' class='medium_form_field'>
- Pool l&ouml;schen (H&auml;kchen setzen)</td>
-
- <td class='tab_d'>
-
- <!-- BEGIN DYNAMIC BLOCK: Dhcpranges -->
-
- <input type='Text' name='range1[]' value='{RANGE1}' size='15' maxlength='15' class='medium_form_field'>
- &nbsp;&nbsp; - &nbsp;&nbsp;
- <input type='Text' name='range2[]' value='{RANGE2}' size='15' maxlength='15' class='medium_form_field'>
- <input type='hidden' name='oldrange1[]' value='{RANGE1}'>
- <input type='hidden' name='oldrange2[]' value='{RANGE2}'><br>
- <input type='hidden' name='rangepooldn[]' value='{RPOOLDN}'>
-
- <!-- END DYNAMIC BLOCK: Dhcpranges -->
-
- <input type='Text' name='addrange1[]' value='' size='15' maxlength='15' class='medium_form_field'>
- &nbsp;&nbsp; - &nbsp;&nbsp;
- <input type='Text' name='addrange2[]' value='' size='15' maxlength='15' class='medium_form_field'>
- </td>
-
- <td class='tab_d'>
- <select name='unknownclients[]' size='3' class='small_form_selectbox'>
- {UCSELECT}
- </select>
- <input type='hidden' name='olduc[]' value='{UCNOW}'> &nbsp;
- </td>
- </tr>
- <!--<tr>
- <td colspan='3' class='tab_d'><input type='checkbox' name='delpool[]' value='{POOLDN}' size='10' class='medium_form_field'>
- Pool l&ouml;schen (H&auml;kchen setzen)</td>
- </tr>-->
-
- <input type='hidden' name='pooldn[]' value='{POOLDN}'>
- <input type='hidden' name='subnet[]' value='{SUBNET}'>
- <input type='hidden' name='subnetau[]' value='{SUBNETAU}'>
-
- <!-- END DYNAMIC BLOCK: Dhcppools -->
-
- <input type='hidden' name='mnr' value='{MNR}'>
-
- </table></td>
- </tr>
- <tr>
- <td><input type='Submit' name='apply' value='anwenden' class='small_loginform_button'>
- </form></td>
- </tr>
-
- <tr>
- <td height='50'></td>
- </tr>";
-
-$template->assign(array("POOLFORMULAR" => $poolform));
-$template->parse("POOLFORM_LIST", "Poolform");
-#$template->clear_dynamic("Poolform");
-#$template->clear_parse("POOLFORM_LIST");
$template->define_dynamic("Dhcppools", "Webseite");
$template->define_dynamic("Dhcpranges", "Webseite");
+
# Für jeden Pool ...
foreach ($pools as $pool){
@@ -192,13 +116,15 @@ foreach ($pools as $pool){
"STATEMENTS" => $pool['dhcpstatements'],
"UCSELECT" => $ucselectbox,
"UCNOW" => $unknownclients,
+ "ALLOW" => $pool['dhcpoptallow'],
+ "DENY" => $pool['dhcpoptdeny'],
+ "IGNORE" => $pool['dhcpoptignore'],
"DEFAULTLEASE" => $pool['dhcpoptdefault-lease-time'],
"MAXLEASE" => $pool['dhcpoptmax-lease-time'],
"MNR" => $mnr));
$template->parse("DHCPPOOLS_LIST", ".Dhcppools");
}
-}
###################################################################################