コード例 #1
0
function dhcpv6_apply_changes($dhcpdv6_enable_changed)
{
    $retval = 0;
    $retvaldhcp = 0;
    $retvaldns = 0;
    /* Stop DHCPv6 so we can cleanup leases */
    killbypid("{$g['dhcpd_chroot_path']}{$g['varrun_path']}/dhcpdv6.pid");
    // dhcp_clean_leases();
    /* dnsmasq_configure calls dhcpd_configure */
    /* no need to restart dhcpd twice */
    if (isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcpstatic'])) {
        $retvaldns = services_dnsmasq_configure();
        if ($retvaldns == 0) {
            clear_subsystem_dirty('hosts');
            clear_subsystem_dirty('staticmaps');
        }
    } else {
        if (isset($config['unbound']['enable']) && isset($config['unbound']['regdhcpstatic'])) {
            $retvaldns = services_unbound_configure();
            if ($retvaldns == 0) {
                clear_subsystem_dirty('unbound');
                clear_subsystem_dirty('staticmaps');
            }
        } else {
            $retvaldhcp = services_dhcpd_configure();
            if ($retvaldhcp == 0) {
                clear_subsystem_dirty('staticmaps');
            }
        }
    }
    if ($dhcpdv6_enable_changed) {
        $retvalfc = filter_configure();
    }
    if ($retvaldhcp == 1 || $retvaldns == 1 || $retvalfc == 1) {
        $retval = 1;
    }
    return get_std_save_message($retval);
}
コード例 #2
0
ファイル: services_unbound.php プロジェクト: dirkx/pfsense
    $pconfig['active_interface'] = explode(",", $a_unboundcfg['active_interface']);
}
if (empty($a_unboundcfg['outgoing_interface'])) {
    $pconfig['outgoing_interface'] = array();
} else {
    $pconfig['outgoing_interface'] = explode(",", $a_unboundcfg['outgoing_interface']);
}
if (empty($a_unboundcfg['system_domain_local_zone_type'])) {
    $pconfig['system_domain_local_zone_type'] = "transparent";
} else {
    $pconfig['system_domain_local_zone_type'] = $a_unboundcfg['system_domain_local_zone_type'];
}
if ($_POST) {
    if ($_POST['apply']) {
        $retval = services_unbound_configure();
        $savemsg = get_std_save_message($retval);
        if ($retval == 0) {
            clear_subsystem_dirty('unbound');
        }
        /* Update resolv.conf in case the interface bindings exclude localhost. */
        system_resolvconf_generate();
        /* Start or restart dhcpleases when it's necessary */
        system_dhcpleases_configure();
    } else {
        $pconfig = $_POST;
        unset($input_errors);
        if (isset($pconfig['enable']) && isset($config['dnsmasq']['enable'])) {
            if ($pconfig['port'] == $config['dnsmasq']['port']) {
                $input_errors[] = gettext("The DNS Forwarder is enabled using this port. Choose a non-conflicting port, or disable the DNS Forwarder.");
            }
        }
コード例 #3
0
ファイル: services_dhcp.php プロジェクト: karawan/core
                clear_subsystem_dirty('unbound');
            }
        } else {
            $retvaldhcp = services_dhcpd_configure();
            if ($retvaldhcp == 0) {
                clear_subsystem_dirty('staticmaps');
            }
        }
    }
    if ($dhcpd_enable_changed) {
        $retvalfc = filter_configure();
    }
    if ($retvaldhcp == 1 || $retvaldns == 1 || $retvalfc == 1) {
        $retval = 1;
    }
    $savemsg = get_std_save_message();
}
if ($act == "delpool") {
    if ($a_pools[$_GET['id']]) {
        unset($a_pools[$_GET['id']]);
        write_config();
        header("Location: services_dhcp.php?if={$if}");
        exit;
    }
}
if ($act == "del") {
    if ($a_maps[$_GET['id']]) {
        unset($a_maps[$_GET['id']]);
        write_config();
        if (isset($config['dhcpd'][$if]['enable'])) {
            mark_subsystem_dirty('staticmaps');
コード例 #4
0
        } else {
            unset($config['system']['disablesegmentationoffloading']);
        }
        if ($_POST['disablelargereceiveoffloading'] == "yes") {
            $config['system']['disablelargereceiveoffloading'] = true;
        } else {
            unset($config['system']['disablelargereceiveoffloading']);
        }
        setup_microcode();
        // Write out configuration (config.xml)
        write_config();
        // Set preferred protocol
        prefer_ipv4_or_ipv6();
        $retval = filter_configure();
        if (stristr($retval, "error") != true) {
            $savemsg = get_std_save_message(gettext($retval));
            $class = 'success';
        } else {
            $savemsg = gettext($retval);
            $class = 'warning';
        }
    }
}
$pgtitle = array(gettext("System"), gettext("Advanced"), gettext("Networking"));
include "head.inc";
if ($input_errors) {
    print_input_errors($input_errors);
}
if ($savemsg) {
    print_info_box($savemsg, $class);
}
コード例 #5
0
ファイル: interfaces_vlan.php プロジェクト: rterbush/nas4free
?>
</span></a></li>
			</ul>
		</td>
	</tr>
	<tr>
		<td class="tabcont">
			<form action="interfaces_vlan.php" method="post">
				<?php 
if (!empty($input_errors)) {
    print_input_errors($input_errors);
}
?>
				<?php 
if (file_exists($d_sysrebootreqd_path)) {
    print_info_box(get_std_save_message(0));
}
?>
				<table width="100%" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td width="20%" class="listhdrlr"><?php 
echo gettext("Virtual interface");
?>
</td>
						<td width="20%" class="listhdrr"><?php 
echo gettext("Physical interface");
?>
</td>
						<td width="5%" class="listhdrr"><?php 
echo gettext("VLAN tag");
?>
            if (!isset($_POST['path_check']) && strpos($config['onebuttoninstaller']['storage_path'], "/mnt/") === false) {
                $input_errors[] = gettext("The common directory for all extensions MUST be set to a directory below <b>'/mnt/'</b> to prevent to loose the extensions after a reboot on embedded systems!");
            } else {
                if (!is_dir($config['onebuttoninstaller']['storage_path'])) {
                    mkdir($config['onebuttoninstaller']['storage_path'], 0775, true);
                }
                change_perms($_POST['storage_path']);
                $config['onebuttoninstaller']['path_check'] = isset($_POST['path_check']) ? true : false;
                $config['onebuttoninstaller']['re_install'] = isset($_POST['re_install']) ? true : false;
                $config['onebuttoninstaller']['auto_update'] = isset($_POST['auto_update']) ? true : false;
                $config['onebuttoninstaller']['show_beta'] = isset($_POST['show_beta']) ? true : false;
                $savemsg .= get_std_save_message(write_config()) . " ";
                require_once "{$config['onebuttoninstaller']['rootfolder']}onebuttoninstaller-start.php";
            }
        } else {
            $savemsg .= get_std_save_message(write_config()) . " ";
        }
    }
    // end of empty input_errors
}
$pconfig['enable'] = isset($config['onebuttoninstaller']['enable']) ? true : false;
$pconfig['storage_path'] = !empty($config['onebuttoninstaller']['storage_path']) ? $config['onebuttoninstaller']['storage_path'] : $g['media_path'];
$pconfig['path_check'] = isset($config['onebuttoninstaller']['path_check']) ? true : false;
$pconfig['re_install'] = isset($config['onebuttoninstaller']['re_install']) ? true : false;
$pconfig['auto_update'] = isset($config['onebuttoninstaller']['auto_update']) ? true : false;
$pconfig['show_beta'] = isset($config['onebuttoninstaller']['show_beta']) ? true : false;
$return_val = mwexec("fetch -o {$config['onebuttoninstaller']['rootfolder']}log/version.txt https://raw.github.com/crestAT/nas4free-onebuttoninstaller/master/onebuttoninstaller/version.txt", false);
if ($return_val == 0) {
    $server_version = exec("cat {$config['onebuttoninstaller']['rootfolder']}log/version.txt");
    if ($server_version != $config['onebuttoninstaller']['version']) {
        $savemsg .= sprintf(gettext("New extension version %s available, push '%s' button to install the new version!"), $server_version, gettext("Maintenance"));
コード例 #7
0
    $min = 0;
    $a_timehour[sprintf("%02.2d%02.2d", $hour, $min)] = sprintf("%02.2d:%02.2d", $hour, $min);
}
$a_lifetime = array("0" => gettext("infinity"), "1w" => sprintf(gettext("%d week"), 1), "2w" => sprintf(gettext("%d weeks"), 2), "30d" => sprintf(gettext("%d days"), 30), "60d" => sprintf(gettext("%d days"), 60), "90d" => sprintf(gettext("%d days"), 90), "180d" => sprintf(gettext("%d days"), 180), "1y" => sprintf(gettext("%d year"), 1), "2y" => sprintf(gettext("%d years"), 2));
if ($_POST) {
    $pconfig = $_POST;
    if (isset($_POST['apply']) && $_POST['apply']) {
        $ret = array("output" => array(), "retval" => 0);
        if (!file_exists($d_sysrebootreqd_path)) {
            // Process notifications
            $ret = zfs_updatenotify_process("zfsautosnapshot", "zfsautosnapshot_process_updatenotification");
            config_lock();
            $ret['retval'] |= rc_update_service("autosnapshot");
            config_unlock();
        }
        $savemsg = get_std_save_message($ret['retval']);
        if ($ret['retval'] == 0) {
            updatenotify_delete("zfsautosnapshot");
            header("Location: disks_zfs_snapshot_auto.php");
            exit;
        }
        updatenotify_delete("zfsautosnapshot");
        $errormsg = implode("\n", $ret['output']);
    }
}
if (isset($_GET['act']) && $_GET['act'] === "del") {
    $autosnapshot = array();
    $autosnapshot['uuid'] = $_GET['uuid'];
    updatenotify_set("zfsautosnapshot", UPDATENOTIFY_MODE_DIRTY, serialize($autosnapshot));
    header("Location: disks_zfs_snapshot_auto.php");
    exit;