Exemplo n.º 1
0
<?php

include '../standard_header.inc.php';
# Dateiname und evtl. Pfad des Templates für die Webseite
$webseite = "dhcp_classes.dwt";
include 'dhcp_header.inc.php';
###################################################################################
$mnr = $_GET['mnr'];
#$sbmnr = $_GET['sbmnr'];
# Menuleisten erstellen
createMainMenu($rollen, $mainnr);
createDhcpMenu($rollen, $mnr, $auDN, $sbmnr);
###################################################################################
# DHCP Classes Daten holen
$attributes = array("dn", "cn", "dhcphlpcont", "dhcpstatements", "description", "submatchexp", "dhcpoptvendor-encapsulated-options", "dhcpoptallow", "dhcpoptdefault-lease-time", "dhcpoptdeny", "dhcpoptignore", "dhcpoptmax-lease-time", "dhcpoptgeneric", "hlprbservice", "dhcpoptfilename", "dhcpoptnext-server");
$classes = get_dhcpclasses($auDN, $attributes);
#print_r($classes);
$template->assign(array("CLASSDN" => "", "CLASSCN" => "", "DHCPCONT" => "", "DHCPSRV" => $DHCP_SERVICE, "CLASSDESC" => "", "CLASSSTATEMENTS" => "Keine DHCP CLASS definiert", "OPTIONS" => "", "SUBCLASSES" => "", "CHE" => "", "ACT" => "", "MNR" => $mnr));
$template->define_dynamic("Dhcpclasses", "Webseite");
foreach ($classes as $class) {
    $class_statements = "";
    $class_options = "&nbsp;";
    $checked = "";
    $active = "";
    if ($class['dhcphlpcont']) {
        $checked = " checked";
        $active = "<br><b><code class='red_font_object'>aktiv</code></b>";
    }
    if ($class['dhcpstatements']) {
        if (count($class['dhcpstatements']) > 1) {
            foreach ($class['dhcpstatements'] as $statement) {
            case 'DhcpAdmin':
                $classadmin = 1;
                break;
        }
    }
}
if ($classadmin) {
    $class_form_element = "";
    $classformsubmit = "<input type='Submit' name='apply' value='anwenden' class='tiny_loginform_button'>";
} else {
    # readonly
    $class_form_element = " disabled";
}
# DHCP Classes Daten holen
$attributes = array("dn", "cn", "dhcphlpcont", "dhcpstatements", "description", "submatchexp", "dhcpoptvendor-encapsulated-options", "dhcpoptallow", "dhcpoptdefault-lease-time", "dhcpoptdeny", "dhcpoptignore", "dhcpoptmax-lease-time", "dhcpoptgeneric", "hlprbservice", "dhcpoptfilename", "dhcpoptnext-server");
$classes = get_dhcpclasses($rootAU, $attributes);
#print_r($classes);
$template->assign(array("CLASSBOX" => ""));
// $template->define_dynamic("Dhcpclasses", "Webseite");
if (count($classes) > 0) {
    $class_box = "\n<tr>\n  \t\t<td colspan='2'>\n  \t\t<table cellpadding='7' cellspacing='0' border='1' align='left' width='90%' style='border-width: 3 3 3 3;'>\n\t\t\t\t<form action='dhcpclasses_change.php' method='post'>\n\t\t\t<tr>\n\t\t\t\t<td width='80%' class='tab_dgrey' colspan='3'><b>Global g&uuml;ltige DHCP Classes</b>&nbsp;&nbsp; - &nbsp; Falls <b>aktiv</b> gelten Optionen f&uuml;r alle matchenden Clients</td>\n\t\t\t\t<td width='20%' class='tab_dgrey'>{$classformsubmit}</td>\n\t\t\t</tr>";
    foreach ($classes as $class) {
        $class_statements = "";
        $class_options = "&nbsp;";
        $checked = "";
        $active = "";
        if ($class['dhcphlpcont']) {
            $checked = " checked";
            $active = "<br><b><code class='red_font_object'>aktiv</code></b>";
        }
        if ($class['dhcpstatements']) {