if (!empty($input_errors)) {
    print_input_errors($input_errors);
}
?>
        <table width="100%" border="0" cellpadding="6" cellspacing="0">
        	<?php 
html_titleline_checkbox("enable", gettext("Firewall rule"), !empty($pconfig['enable']) ? true : false, gettext("Enable"));
?>
        	<?php 
html_inputbox("ruleno", gettext("Rule number"), $pconfig['ruleno'], gettext("The rule number determines the order of the rule."), true, 10);
?>
					<?php 
html_combobox("action", gettext("Action"), $pconfig['action'], array("allow" => gettext("Allow"), "deny" => gettext("Deny"), "unreach host" => gettext("Reject")), gettext("The action which will be executed when the packet match the criteria specified below."), true);
?>
					<?php 
$a_interface = array("" => gettext("All"), get_ifname($config['interfaces']['lan']['if']) => "LAN");
for ($i = 1; isset($config['interfaces']['opt' . $i]); ++$i) {
    $a_interface[$config['interfaces']['opt' . $i]['if']] = $config['interfaces']['opt' . $i]['descr'];
}
?>
					<?php 
html_combobox("if", gettext("Interface"), $pconfig['if'], $a_interface, gettext("Choose on which interface packets must come in to match this rule."), true);
?>
					<?php 
html_combobox("protocol", gettext("Protocol"), $pconfig['protocol'], array("udp" => "UDP", "tcp" => "TCP", "icmp" => "ICMP", "all" => gettext("All")), gettext("Choose which IP protocol this rule should match."), true);
?>
					<?php 
html_inputbox("src", gettext("Source"), $pconfig['src'], gettext("To match any IP address leave this field empty."), false, 40);
?>
					<?php 
html_inputbox("srcport", gettext("Source port"), $pconfig['srcport'], "", false, 5);
示例#2
0
    $dhcpmac = array();
    $dhcpip = array();
    foreach ($leases as $value) {
        $dhcpmac[$value['mac']] = $value['hostname'];
        $dhcpip[$value['ip']] = $value['hostname'];
    }
    unset($data);
}
exec("/usr/sbin/arp -an", $rawdata);
$i = 0;
$ifdescrs = array('lan' => 'LAN');
for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
    $ifdescrs['opt' . $j] = $config['interfaces']['opt' . $j]['descr'];
}
foreach ($ifdescrs as $key => $interface) {
    $hwif[get_ifname($config['interfaces'][$key]['if'])] = $interface;
}
$data = array();
foreach ($rawdata as $line) {
    $elements = explode(' ', $line);
    if ($elements[3] != "(incomplete)") {
        $arpent = array();
        $arpent['ip'] = trim(str_replace(array('(', ')'), '', $elements[1]));
        $arpent['mac'] = trim($elements[3]);
        $arpent['interface'] = trim($elements[5]);
        $data[] = $arpent;
    }
}
function get_HostName($mac, $ip)
{
    global $dhcpmac, $dhcpip, $resolve;
示例#3
0
require "auth.inc";
require "guiconfig.inc";
unset($index);
if (isset($_GET['index']) && $_GET['index']) {
    $index = $_GET['index'];
} else {
    if (isset($_POST['index']) && $_POST['index']) {
        $index = $_POST['index'];
    }
}
if (!$index) {
    exit;
}
$optcfg =& $config['interfaces']['opt' . $index];
// Get interface informations.
$ifinfo = get_interface_info(get_ifname($optcfg['if']));
if ($config['interfaces']['opt' . $index]['ipaddr'] == "dhcp") {
    $pconfig['type'] = "DHCP";
    $pconfig['ipaddr'] = get_ipaddr($optcfg['if']);
    $pconfig['subnet'] = get_subnet_bits($optcfg['if']);
} else {
    $pconfig['type'] = "Static";
    $pconfig['ipaddr'] = $optcfg['ipaddr'];
    $pconfig['subnet'] = $optcfg['subnet'];
}
$pconfig['ipv6_enable'] = isset($optcfg['ipv6_enable']);
if ($config['interfaces']['opt' . $index]['ipv6addr'] == "auto") {
    $pconfig['ipv6type'] = "Auto";
    $pconfig['ipv6addr'] = get_ipv6addr($optcfg['if']);
} else {
    $pconfig['ipv6type'] = "Static";
示例#4
0
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
	POSSIBILITY OF SUCH DAMAGE.
*/
require "auth.inc";
require "guiconfig.inc";
$pgtitle = array(gettext("Status"), gettext("Graph"), gettext("Traffic graph"));
$curif = "lan";
if ($_GET['if']) {
    $curif = $_GET['if'];
}
$ifnum = get_ifname($config['interfaces'][$curif]['if']);
include "fbegin.inc";
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
		<td class="tabnavtbl">
  		<ul id="tabnav">
				<li class="tabact"><a href="status_graph.php" title="<?php 
echo gettext("Reload page");
?>
"><span><?php 
echo gettext("Traffic graph");
?>
</span></a></li>
				<li class="tabinact"><a href="status_graph_cpu.php"><span><?php 
echo gettext("CPU load");
html_checkbox("alwaysscan", gettext("Always scan"), $pconfig['alwaysscan'] ? true : false, "", gettext("Whether scans should be skipped if there are no users connected. This allows the drive to spin down when no users are connected."), false);
?>
					<?php 
html_combobox("scantype", gettext("Scan type"), $pconfig['scantype'], array("0" => gettext("Normal"), "1" => gettext("Aggressive"), "2" => gettext("Painfully aggressive")), "", false);
?>
					<?php 
html_separator();
?>
					<?php 
html_titleline(gettext("Administrative WebGUI"));
?>
					<?php 
html_passwordbox("admin_pw", gettext("Password"), $pconfig['admin_pw'], sprintf("%s %s", gettext("Password for the administrative pages."), gettext("Default user name is 'admin'.")), true, 20);
?>
					<?php 
$if = get_ifname($config['interfaces']['lan']['if']);
$ipaddr = get_ipaddr($if);
$url = htmlspecialchars("http://{$ipaddr}:{$pconfig['port']}");
$text = "<a href='{$url}' target='_blank'>{$url}</a>";
?>
					<?php 
html_text("url", gettext("URL"), $text);
?>
				</table>
				<div id="submit">
					<input name="Submit" type="submit" class="formbtn" value="<?php 
echo gettext("Save and Restart");
?>
" onclick="onsubmit_content(); enable_change(true)" />
				</div>
				<div id="remarks">
示例#6
0
html_inputbox("deviceip", gettext("Device IP"), $pconfig['deviceip'], gettext("The device's IP address."), true, 20);
?>
					<?php 
html_checkbox("transcoding", gettext("Transcoding"), !empty($pconfig['transcoding']) ? true : false, gettext("Enable transcoding."), "", false, "transcoding_change()");
?>
					<?php 
html_filechooser("tempdir", gettext("Temporary directory"), $pconfig['tempdir'], gettext("Temporary directory to store transcoded files."), $g['media_path'], true, 67);
?>
					<?php 
html_separator();
?>
					<?php 
html_titleline(gettext("Administrative WebGUI"));
?>
					<?php 
$if = get_ifname($pconfig['if']);
$ipaddr = get_ipaddr($if);
$url = htmlspecialchars("http://{$ipaddr}:{$pconfig['port']}");
$text = "<a href='{$url}' target='_blank'>{$url}</a>";
?>
					<?php 
html_text("url", gettext("URL"), $text);
?>
				</table>
				<div id="submit">
					<input name="Submit" type="submit" class="formbtn" value="<?php 
echo gettext("Save and Restart");
?>
" onclick="onsubmit_content(); enable_change(true)" />
				</div>
			</td>