Beispiel #1
0
<?php

include "inc/config.php";
include "inc/auth.php";
include "inc/functions.php";
$title = "NetBoot Server";
include "inc/header.php";
$currentIP = trim(getCurrentIP());
$currentNetmask = trim(getCurrentNetmask());
$currentSubnet = trim(getNetAddress($currentIP, $currentNetmask));
$netbootimgdir = "/srv/NetBoot/NetBootSP0/";
if (isset($_POST['NetBootImage'])) {
    $wasrunning = getNetBootStatus();
    $nbi = $_POST['NetBootImage'];
    if ($nbi != "") {
        $nbconf = file_get_contents("/var/appliance/conf/dhcpd.conf");
        $nbsubnets = "";
        foreach ($conf->getSubnets() as $key => $value) {
            $nbsubnets .= "subnet " . $value['subnet'] . " netmask " . $value['netmask'] . " {\n\tallow unknown-clients;\n}\n\n";
        }
        $nbconf = str_replace("##SUBNETS##", $nbsubnets, $nbconf);
        suExec("touchconf \"/var/appliance/conf/dhcpd.conf.new\"");
        if (file_put_contents("/var/appliance/conf/dhcpd.conf.new", $nbconf) === FALSE) {
            echo "<div class=\"errorMessage\">ERROR: Unable to update dhcpd.conf</div>";
        }
        suExec("disablenetboot");
        suExec("installdhcpdconf");
        if ($wasrunning || isset($_POST['enablenetboot'])) {
            suExec("setnbimages " . $nbi);
        }
        $conf->setSetting("netbootimage", $nbi);
Beispiel #2
0
					<input type="radio" name="nettype" value="static" id="static" <?php 
echo $type == "static" ? " checked=\"checked\"" : "";
?>
 onclick="disableStaticOptions(this.value);" />
					<label for="static">Static</label>
				</div>

				<label class="control-label">IP Address</label>
				<input type="text" name="ip" id="ip"  class="form-control input-sm" value="<?php 
echo getCurrentIP();
?>
" />

				<label class="control-label">Netmask</label>
				<input type="text" name="netmask" id="netmask" class="form-control input-sm" value="<?php 
echo getCurrentNetmask();
?>
" />

			</div>

			<div class="col-xs-6 col-sm-6 col-md-4 col-lg-3">

				<label class="control-label">Gateway</label>
				<input type="text" name="gateway" id="gateway" class="form-control input-sm" value="<?php 
echo getCurrentGateway();
?>
" />


				<label class="control-label">DNS Server 1</label>