Exemple #1
0
session_start();
include_once 'ressources/class.templates.inc';
include_once 'ressources/class.users.menus.inc';
include_once 'ressources/class.dhcpd.inc';
include_once 'ressources/class.system.nics.inc';
include_once 'ressources/class.dhcpd-sub.inc';
if (!GetRights()) {
    $tpl = new templates();
    echo FATAL_ERROR_SHOW_128("{ERROR_NO_PRIVS}");
    die;
}
if (isset($_POST["range1"])) {
    Save();
    exit;
}
dhcp_form();
function dhcp_form()
{
    $ldap = new clladp();
    $domains = $ldap->hash_get_all_domains();
    $dhcp = new dhcpd_sub($_GET["nic"]);
    $page = CurrentPageName();
    $users = new usersMenus();
    $t = time();
    if (count($domains) == 0) {
        $dom = Field_text("ddns_domainname-{$t}", $dhcp->ddns_domainname, "font-size:22px;");
    } else {
        $domains[null] = "{select}";
        $dom = Field_array_Hash($domains, "ddns_domainname-{$t}", $dhcp->ddns_domainname, null, null, null, ";font-size:22px;padding:3px");
    }
    $EnableDHCPUseHostnameOnFixed = Field_checkbox_design("EnableDHCPUseHostnameOnFixed-{$t}", 1, $dhcp->EnableDHCPUseHostnameOnFixed);
Exemple #2
0
function dhcp_switch()
{
    switch ($_GET["dhcp-tab"]) {
        case "status":
            dhcp_index();
            break;
        case "config":
            echo dhcp_form();
            break;
        case "tabs":
            echo dhcp_subtabs();
            break;
        case "hosts":
            echo dhcp_computers_scripts();
            break;
    }
}
function dhcp_index()
{
    $config = Paragraphe("64-settings.png", "{APP_DHCP_MAIN_CONF}", "{APP_DHCP_MAIN_CONF_TEXT}", "javascript:YahooWin3(700,'index.gateway.php?show-script=yes','{APP_DHCP_MAIN_CONF}');");
    $pxe = Paragraphe("pxe-64.png", "{PXE}", "{PXE_DHCP_MINI_TEXT}", "javascript:PxeConfig();");
    $routes = Buildicon64('DEF_ICO_DHCP_ROUTES');
    $events = Buildicon64('DEF_ICO_DHCP_EVENTS');
    $pcs = Buildicon64('DEF_ICO_BROWSE_COMP');
    $enable = Paragraphe("modem-64.png", "{EnableDHCPServer}", "{EnableDHCPServer_text}", "javascript:EnableDHCPServerForm()", "{EnableDHCPServer_text}");
    $html = "<H1>{APP_DHCP}</H1>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top'>{$enable}</td>\n\t\t<td valign='top'>{$config}</td>\n\t\t<td valign='top'>{$events}</td>\n\t</tr>\n\t<tr>\n\t\t\n\t\t<td valign='top'>{$routes}</td>\n\t\t<td valign='top'>{$pxe}</td>\n\t\t<td valign='top'>{$pcs}</td>\n\t\t\n\t</tr>\n\t</table>\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
    exit;
    $html = "<H1>{APP_DHCP}</H1>\n\t\n\t<div id='dhcp_form'>" . dhcp_form() . "</div>\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}