Commit 2480cd39 authored by Ad Schellevis's avatar Ad Schellevis

(legacy) remove unused, move single used functions out of shared files

parent f1c3b22b
......@@ -51,7 +51,6 @@ $allowedpages = getAllowedPages($_SESSION['Username']);
if (!isAllowedPage($_SERVER['REQUEST_URI'])) {
if (count($allowedpages) > 0) {
$page = str_replace('*', '', $allowedpages[0]);
$_SESSION['Post_Login'] = true;
require_once("functions.inc");
redirectHeader("/{$page}");
......@@ -66,20 +65,7 @@ if (!isAllowedPage($_SERVER['REQUEST_URI'])) {
display_error_form("201", gettext("No page assigned to this user! Click here to logout."));
exit;
}
} else {
$_SESSION['Post_Login'] = true;
}
/*
* redirect browsers post-login to avoid pages
* taking action in reponse to a POST request
*/
if (!$_SESSION['Post_Login']) {
$_SESSION['Post_Login'] = true;
require_once("functions.inc");
redirectHeader($_SERVER['REQUEST_URI']);
exit;
}
}
/*
* Close session data to allow other scripts from same host to come in.
......@@ -144,24 +130,14 @@ function display_login_form()
unset($input_errors);
if (isAjax()) {
if (isset($_POST['login'])) {
if ($_SESSION['Logged_In'] <> "True") {
isset($_SESSION['Login_Error']) ? $login_error = $_SESSION['Login_Error'] : $login_error = gettext("unknown reason");
printf("showajaxmessage('" . gettext("Invalid login (%s).") . "')", $login_error);
}
if (file_exists('/tmp/webconfigurator.lock')) {
// TODO: add the IP from the user who did lock the device
$whom = file_get_contents('/tmp/webconfigurator.lock');
printf("showajaxmessage('" . gettext("This device is currently being maintained by: %s.") . "');", $whom);
}
}
exit;
}
/* Check against locally configured IP addresses, which will catch when someone
port forwards WebGUI access from WAN to an internal IP on the router. */
global $FilterIflist, $nifty_background;
global $FilterIflist;
$local_ip = false;
if (strstr($_SERVER['HTTP_HOST'], ":")) {
$http_host_port = explode(":", $_SERVER['HTTP_HOST']);
......@@ -183,7 +159,7 @@ function display_login_form()
}
unset($FilterIflist);
if ($config['virtualip']) {
if (isset($config['virtualip'])) {
if ($config['virtualip']['vip']) {
foreach ($config['virtualip']['vip'] as $vip) {
if ($vip['subnet'] == $http_host) {
......@@ -236,7 +212,6 @@ function display_login_form()
<div class="container">
<?php
if (is_ipaddr($http_host) && !$local_ip && !isset($config['system']['webgui']['nohttpreferercheck'])) {
$nifty_background = "#999";
print_info_box(gettext("You are accessing this router by an IP address not configured locally, which may be forwarded by NAT or other means. <br /><br />If you did not setup this forwarding, you may be the target of a man-in-the-middle attack."));
}
$loginautocomplete = isset($config['system']['webgui']['loginautocomplete']) ? '' : 'autocomplete="off"';
......
......@@ -187,7 +187,7 @@ include("head.inc"); ?>
<tbody>
<tr>
<td><?=gettext("Hostname or IP");?></td>
<td><?=$mandfldhtml;?><input name="host" type="text" class="form-control" id="host" size="20" value="<?=htmlspecialchars($host);?>" /></td>
<td><input name="host" type="text" class="form-control" id="host" size="20" value="<?=htmlspecialchars($host);?>" /></td>
<?php if ($resolved && $type): ?>
<td>
<?php
......
......@@ -31,6 +31,24 @@
require_once("guiconfig.inc");
require_once("ipsec.inc");
function return_clog($logfile, $tail, $withorig = true, $grepfor = "", $grepinvert = "", $grepreverse = false) {
global $g, $config;
$sor = (isset($config['syslog']['reverse']) || $grepreverse) ? "-r" : "";
$logarr = "";
$grepline = " ";
if(is_array($grepfor))
$grepline .= " | /usr/bin/egrep " . escapeshellarg(implode("|", $grepfor));
if(is_array($grepinvert))
$grepline .= " | /usr/bin/egrep -v " . escapeshellarg(implode("|", $grepinvert));
if($config['system']['disablesyslogclog']) {
exec("cat " . escapeshellarg($logfile) . "{$grepline} | /usr/bin/tail {$sor} -n " . escapeshellarg($tail), $logarr);
} else {
exec("/usr/local/sbin/clog " . escapeshellarg($logfile) . "{$grepline}| grep -v \"CLOG\" | grep -v \"\033\" | /usr/bin/tail {$sor} -n " . escapeshellarg($tail), $logarr);
}
return($logarr);
}
$ipsec_logfile = '/var/log/ipsec.log';
$nentries = $config['syslog']['nentries'];
......
......@@ -92,7 +92,7 @@ include("head.inc"); ?>
<tbody>
<tr>
<td><?=gettext("Host"); ?></td>
<td><?=$mandfldhtml;?><input name="host" type="text" class="form-control" id="host" value="<?=htmlspecialchars($host);?>" /></td>
<td><input name="host" type="text" class="form-control" id="host" value="<?=htmlspecialchars($host);?>" /></td>
</tr>
<tr>
<td><?=gettext("IP Protocol"); ?></td>
......
......@@ -107,7 +107,7 @@ include("head.inc"); ?>
<tbody>
<tr>
<td><?=gettext("Host"); ?></td>
<td><?=$mandfldhtml;?><input name="host" type="text" class="form-control" id="host" value="<?=htmlspecialchars($host);?>" /></td>
<td><input name="host" type="text" class="form-control" id="host" value="<?=htmlspecialchars($host);?>" /></td>
</tr>
<tr>
<td><?= gettext("Port"); ?></td>
......
......@@ -100,7 +100,7 @@ if (!isset($do_traceroute)) {
<tbody>
<tr>
<td><?=gettext("Host"); ?></td>
<td><?=$mandfldhtml;?><input name="host" type="text" class="form-control" id="host" value="<?=htmlspecialchars($host);?>" /></td>
<td><input name="host" type="text" class="form-control" id="host" value="<?=htmlspecialchars($host);?>" /></td>
</tr>
<tr>
<td><?=gettext("IP Protocol"); ?></td>
......
......@@ -98,7 +98,6 @@ if($need_alert_display == true) {
echo "<div class=\"col-xs-12\"><div class=\"alert alert-info\"><p>".$display_text."</p></div></div>";
}
$pgtitle_output = true;
?>
<header class="page-head">
......@@ -174,7 +173,7 @@ $pgtitle_output = true;
<div class="container-fluid">
<form action="<?=$_SERVER['REQUEST_URI'];?>" method="post">
<ul class="list-inline">
<li class="__mb"><h1><?=genhtmltitle($pgtitle);?></h1></li>
<li class="__mb"><h1><?=gentitle($pgtitle);?></h1></li>
<li class="btn-group-container">
......
......@@ -32,6 +32,43 @@ require_once("guiconfig.inc");
require_once("functions.inc");
require_once("filter.inc");
function rule_popup($src,$srcport,$dst,$dstport){
global $config,$g;
$aliases_array = array();
if (isset($config['aliases']['alias'])) {
$descriptions = array ();
foreach ($config['aliases']['alias'] as $alias_id=>$alias_name){
if ($alias_name['name'] == $src) {
//var_dump($config['aliases']['alias'][$alias_id]);
$aliases_array['src']=$config['aliases']['alias'][$alias_id];
$aliases_array['src']['aliasid']=$alias_id;
//$descriptions['src'] = $span_begin;
//$descriptions['src_end'] = $span_end;
}
if ($alias_name['name'] == $srcport) {
$aliases_array['srcport']=$config['aliases']['alias'][$alias_id];
$aliases_array['srcport']['aliasid']=$alias_id;
//$descriptions['srcport'] = $span_begin;
//$descriptions['srcport_end'] = $span_end;
}
if ($alias_name['name'] == $dst ) {
$aliases_array['dst']=$config['aliases']['alias'][$alias_id];
$aliases_array['dst']['aliasid']=$alias_id;
//$descriptions['dst'] = $span_begin;
//$descriptions['dst_end'] = $span_end;
}
if ($alias_name['name'] == $dstport) {
$aliases_array['dstport']=$config['aliases']['alias'][$alias_id];
$aliases_array['dstport']['aliasid']=$alias_id;
//$descriptions['dstport'] = $span_begin;
//$descriptions['dstport_end'] = $span_end;
}
}
return $aliases_array;//$descriptions;
}
}
$pgtitle = array(gettext("Firewall"),gettext("Rules"));
$shortcut_section = "firewall";
......
......@@ -31,6 +31,32 @@
require_once("guiconfig.inc");
require_once("filter.inc");
$firewall_rules_dscp_types = array("af11",
"af12",
"af13",
"af21",
"af22",
"af23",
"af31",
"af32",
"af33",
"af41",
"af42",
"af43",
"VA",
"EF",
"cs1",
"cs2",
"cs3",
"cs4",
"cs5",
"cs6",
"cs7",
"0x01",
"0x02",
"0x04");
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_rules.php');
function is_posnumericint($arg) {
......
......@@ -68,13 +68,6 @@ set_language($g['language']);
require_once("authgui.inc");
/* used by progress bar */
$lastseen = "-1";
$navlevelsep = ": "; /* navigation level separator string */
$mandfldhtml = ""; /* display this before mandatory input fields */
$mandfldhtmlspc = ""; /* same as above, but with spacing */
/* Reserved table names to avoid colision */
$reserved_table_names = array(
"bogons",
......@@ -88,71 +81,6 @@ $reserved_table_names = array(
"webConfiguratorlockout"
);
$firewall_rules_dscp_types = array("af11",
"af12",
"af13",
"af21",
"af22",
"af23",
"af31",
"af32",
"af33",
"af41",
"af42",
"af43",
"VA",
"EF",
"cs1",
"cs2",
"cs3",
"cs4",
"cs5",
"cs6",
"cs7",
"0x01",
"0x02",
"0x04");
$auth_server_types = array(
'ldap' => "LDAP",
'radius' => "Radius");
$ldap_urltypes = array(
'TCP - Standard' => 389,
'SSL - Encrypted' => 636);
$ldap_scopes = array(
'one' => "One Level",
'subtree' => "Entire Subtree");
$ldap_protvers = array(
2,
3);
$ldap_templates = array(
'open' => array(
'desc' => "OpenLDAP",
'attr_user' => "cn",
'attr_group' => "cn",
'attr_member' => "member"),
'msad' => array(
'desc' => "Microsoft AD",
'attr_user' => "samAccountName",
'attr_group' => "cn",
'attr_member' => "memberOf"),
'edir' => array(
'desc' => "Novell eDirectory",
'attr_user' => "cn",
'attr_group' => "cn",
'attr_member' => "uniqueMember"));
$radius_srvcs = array(
'both' => "Authentication and Accounting",
'auth' => "Authentication",
'acct' => "Accounting");
$netbios_nodetypes = array(
'0' => "none",
......@@ -211,17 +139,6 @@ $wkports = array(
/* TCP flags */
$tcpflags = array("fin", "syn", "rst", "psh", "ack", "urg", "ece", "cwr");
$specialnets = array("(self)" => "This Firewall", "pptp" => "PPTP clients", "pppoe" => "PPPoE clients", "l2tp" => "L2TP clients");
$spiflist = get_configured_interface_with_descr(false, true);
foreach ($spiflist as $ifgui => $ifdesc) {
$specialnets[$ifgui] = $ifdesc . " net";
$specialnets[$ifgui . 'ip'] = $ifdesc . " address";
}
$medias = array("auto" => "autoselect", "100full" => "100BASE-TX full-duplex",
"100half" => "100BASE-TX half-duplex", "10full" => "10BASE-T full-duplex",
"10half" => "10BASE-T half-duplex");
$wlan_modes = array("bss" => "Infrastructure (BSS)", "adhoc" => "Ad-hoc (IBSS)",
"hostap" => "Access Point");
......@@ -243,8 +160,6 @@ function do_input_validation($postdata, $reqdfields, $reqdfieldsn, &$input_error
}
function print_input_errors($input_errors) {
global $g;
echo '<div class="col-xs-12"><div class="alert alert-danger alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
';
......@@ -257,16 +172,10 @@ function print_input_errors($input_errors) {
}
function print_info_box_np($msg, $name="apply",$value="", $showapply=false) {
global $g, $nifty_redbox, $nifty_blackbox, $nifty_background;
if(empty($value)) {
$value = gettext("Apply changes");
}
// Set the Nifty background color if one is not set already (defaults to white)
if($nifty_background == "")
$nifty_background = "#FFF";
if(stristr($msg, gettext("apply")) != false || stristr($msg, gettext("save")) != false || stristr($msg, gettext("create")) != false || $showapply) {
$savebutton = "<form action=\"".$_SERVER['REQUEST_URI']."\" method=\"post\">";
$savebutton .= "<input name=\"{$name}\" type=\"submit\" class=\"btn btn-default\" id=\"${name}\" value=\"{$value}\" />";
......@@ -276,20 +185,6 @@ function print_info_box_np($msg, $name="apply",$value="", $showapply=false) {
} else {
$savebutton = '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>';
}
$nifty_redbox = "#990000";
$nifty_blackbox = "#000000";
$themename = $g['theme'];
if(file_exists("/usr/local/www/themes/{$themename}/tabcontrols.php")) {
$toeval = file_get_contents("/usr/local/www/themes/{$themename}/tabcontrols.php");
eval($toeval);
}
if(file_exists("/usr/local/www/themes/{$themename}/infobox.php")) {
$toeval = file_get_contents("/usr/local/www/themes/{$themename}/infobox.php");
eval($toeval);
}
echo <<<EOFnp
<div class="col-xs-12">
......@@ -303,8 +198,6 @@ EOFnp;
}
function print_info_box_np_undo($msg, $name="apply",$value="Apply changes", $undo) {
global $g;
if(stristr($msg, "apply") != false || stristr($msg, "save") != false || stristr($msg, "create") != false) {
$savebutton .= "<input class=\"btn btn-default\" type=\"button\" value=\"". gettext("Undo") . "\" onclick=\"document.location='{$undo}'\" />";
......@@ -315,20 +208,6 @@ function print_info_box_np_undo($msg, $name="apply",$value="Apply changes", $und
} else {
$savebutton = "<input class=\"btn btn-default\" value=\"" . gettext("Close") . "\" type=\"button\" onclick=\"$('#redboxtable').hide();\" />";
}
$nifty_redbox = "#990000";
$nifty_blackbox = "#000000";
$themename = $g['theme'];
if(file_exists("/usr/local/www/themes/{$themename}/tabcontrols.php")) {
$toeval = file_get_contents("/usr/local/www/themes/{$themename}/tabcontrols.php");
eval($toeval);
}
if(file_exists("/usr/local/www/themes/{$themename}/infobox.php")) {
$toeval = file_get_contents("/usr/local/www/themes/{$themename}/infobox.php");
eval($toeval);
}
$url = $_SERVER['REQUEST_URI'];
......@@ -366,11 +245,20 @@ function get_std_save_message($ok) {
}
function pprint_address($adr) {
global $specialnets;
if (!isset($specialnets)) {
global $specialnets;
$specialnets = array("(self)" => "This Firewall", "pptp" => "PPTP clients", "pppoe" => "PPPoE clients", "l2tp" => "L2TP clients");
$spiflist = get_configured_interface_with_descr(false, true);
foreach ($spiflist as $ifgui => $ifdesc) {
$specialnets[$ifgui] = $ifdesc . " net";
$specialnets[$ifgui . 'ip'] = $ifdesc . " address";
}
}
if (isset($adr['any'])) {
$padr = "*";
} else if ($adr['network']) {
} else if (isset($adr['network'])) {
$padr = $specialnets[$adr['network']];
} else {
$padr = $adr['address'];
......@@ -446,18 +334,13 @@ function firewall_check_for_advanced_options(&$item) {
}
function gentitle($title) {
global $navlevelsep;
$navlevelsep = ": "; /* navigation level separator string */
if(!is_array($title))
return $title;
else
return join($navlevelsep, $title);
}
function genhtmltitle($title) {
global $config;
return gentitle($title);
}
/* update the changedesc and changecount(er) variables */
function update_changedesc($update) {
global $changedesc;
......@@ -538,22 +421,6 @@ function dump_clog($logfile, $tail, $withorig = true, $grepfor = "", $grepinvert
}
}
function return_clog($logfile, $tail, $withorig = true, $grepfor = "", $grepinvert = "", $grepreverse = false) {
global $g, $config;
$sor = (isset($config['syslog']['reverse']) || $grepreverse) ? "-r" : "";
$logarr = "";
$grepline = " ";
if(is_array($grepfor))
$grepline .= " | /usr/bin/egrep " . escapeshellarg(implode("|", $grepfor));
if(is_array($grepinvert))
$grepline .= " | /usr/bin/egrep -v " . escapeshellarg(implode("|", $grepinvert));
if($config['system']['disablesyslogclog']) {
exec("cat " . escapeshellarg($logfile) . "{$grepline} | /usr/bin/tail {$sor} -n " . escapeshellarg($tail), $logarr);
} else {
exec("/usr/local/sbin/clog " . escapeshellarg($logfile) . "{$grepline}| grep -v \"CLOG\" | grep -v \"\033\" | /usr/bin/tail {$sor} -n " . escapeshellarg($tail), $logarr);
}
return($logarr);
}
/* Check if variable has changed, update and log if it has
* returns true if var changed
......@@ -660,169 +527,7 @@ function is_specialnet($net) {
return false;
}
//function to create widget tabs when called
function display_widget_tabs(& $tab_array) {
echo "<div id=\"tabs\">";
$tabscounter = 0;
foreach ($tab_array as $ta) {
$dashpos = strpos($ta[2],'-');
$tabname = $ta[2] . "-tab";
$tabclass = substr($ta[2],0,$dashpos);
$tabclass = $tabclass . "-class";
if ($ta[1] == true) {
$tabActive = "table-cell";
$tabNonActive = "none";
}
else {
$tabActive = "none";
$tabNonActive = "table-cell";
}
echo "<div id=\"{$ta[2]}-active\" class=\"{$tabclass}-tabactive\" style=\"display:{$tabActive}; background-color:#EEEEEE; color:black;\">";
echo "<b>&nbsp;&nbsp;&nbsp;{$ta[0]}";
echo "&nbsp;&nbsp;&nbsp;</b>";
echo "</div>";
echo "<div id=\"{$ta[2]}-deactive\" class=\"{$tabclass}-tabdeactive\" style=\"display:{$tabNonActive}; background-color:#777777; color:white; cursor: pointer;\" onclick=\"return changeTabDIV('{$ta[2]}')\">";
echo "<b>&nbsp;&nbsp;&nbsp;{$ta[0]}";
echo "&nbsp;&nbsp;&nbsp;</b>";
echo "</div>";
}
}
// Return inline javascript file or CSS to minimizie
// request count going back to server.
function outputJavaScriptFileInline($javascript) {
if(file_exists($javascript)) {
echo "\n<script type=\"text/javascript\">\n";
include($javascript);
echo "\n</script>\n";
} else {
echo "\n\n<!-- Could not location file: {$javascript} -->\n\n";
}
}
function outputCSSPrintFileInline($css) {
if(file_exists($css)) {
echo "\n<style media=\"print\" type=\"text/css\">\n";
include($css);
echo "\n</style>\n";
} else {
echo "\n\n<!-- Could not location file: {$css} -->\n\n";
}
}
function outputCSSFileInline($css) {
if(file_exists($css)) {
echo "\n<style type=\"text/css\">\n";
include($css);
echo "\n</style>\n";
} else {
echo "\n\n<!-- Could not location file: {$css} -->\n\n";
}
}
$rfc2616 = array(
100 => "100 Continue",
101 => "101 Switching Protocols",
200 => "200 OK",
201 => "201 Created",
202 => "202 Accepted",
203 => "203 Non-Authoritative Information",
204 => "204 No Content",
205 => "205 Reset Content",
206 => "206 Partial Content",
300 => "300 Multiple Choices",
301 => "301 Moved Permanently",
302 => "302 Found",
303 => "303 See Other",
304 => "304 Not Modified",
305 => "305 Use Proxy",
306 => "306 (Unused)",
307 => "307 Temporary Redirect",
400 => "400 Bad Request",
401 => "401 Unauthorized",
402 => "402 Payment Required",
403 => "403 Forbidden",
404 => "404 Not Found",
405 => "405 Method Not Allowed",
406 => "406 Not Acceptable",
407 => "407 Proxy Authentication Required",
408 => "408 Request Timeout",
409 => "409 Conflict",
410 => "410 Gone",
411 => "411 Length Required",
412 => "412 Precondition Failed",
413 => "413 Request Entity Too Large",
414 => "414 Request-URI Too Long",
415 => "415 Unsupported Media Type",
416 => "416 Requested Range Not Satisfiable",
417 => "417 Expectation Failed",
500 => "500 Internal Server Error",
501 => "501 Not Implemented",
502 => "502 Bad Gateway",
503 => "503 Service Unavailable",
504 => "504 Gateway Timeout",
505 => "505 HTTP Version Not Supported"
);
function is_rfc2616_code($code) {
global $rfc2616;
if (isset($rfc2616[$code]))
return true;
else
return false;
}
function print_rfc2616_select($tag, $current){
global $rfc2616;
/* Default to 200 OK if not set */
if ($current == "")
$current = 200;
echo "<select id=\"{$tag}\" name=\"{$tag}\">\n";
foreach($rfc2616 as $code => $message) {
if ($code == $current) {
$sel = " selected=\"selected\"";
} else {
$sel = "";
}
echo "<option value=\"{$code}\"{$sel}>{$message}</option>\n";
}
echo "</select>\n";
}
// Useful debugging function, much cleaner than print_r
function echo_array($array,$return_me=false){
if(is_array($array) == false){
$return = "The provided variable is not an array.";
}else{
foreach($array as $name=>$value){
if(is_array($value)){
$return .= "";
$return .= "['<b>$name</b>'] {<div style=\"margin-left:10px;\">\n";
$return .= echo_array($value,true);
$return .= "</div>}";
$return .= "\n\n";
}else{
if(is_string($value)){
$value = "\"$value\"";
}
$return .= "['<b>$name</b>'] = $value\n\n";
}
}
}
if($return_me == true){
return $return;
}else{
echo "<pre>".$return."</pre>";
}
}
/****f* guiconfig/display_top_tabs
* NAME
......@@ -835,47 +540,18 @@ function echo_array($array,$return_me=false){
function display_top_tabs(& $tab_array, $no_drop_down = false) {
global $config;
global $g;
global $tab_array_indent;
global $tab_array_space;
global $tab_array_char_limit;
$tab_array_char_limit = 92;
/* does the user have access to this tab?
* master user has access to everything.
* if the user does not have access, simply
* unset the tab item.
*/
/* empty string code */
if ($tab_array_indent == '') {
$tab_array_indent = 0;
}
if ($tab_array_space == '') {
$tab_array_space = 1;
}
if ($tab_array_char_limit == '') {
$tab_array_char_limit = 92;
}
foreach ($tab_array as $tab_id => $ta){
if(!isAllowedPage($ta[2]))
unset ($tab_array[$tab_id]);
}
$tab_active_bg = "#EEEEEE";
$tab_inactive_bg = "#777777";
$nifty_tabs_corners = "#FFF";
$font_color = "white";
/* if tabcontrols.php exist for a theme, allow it to be overriden */
$themename = $config['theme'];
$filename = "/usr/local/www/themes/{$themename}/tabcontrols.php";
if(file_exists($filename)) {
$eval_code = file_get_contents($filename);
eval($eval_code);
}
$tabcharcount = 0;
foreach ($tab_array as $ta)
$tabcharcount = $tabcharcount + strlen($ta[0]);
......@@ -922,113 +598,7 @@ function display_top_tabs(& $tab_array, $no_drop_down = false) {
}
function alias_info_popup($alias_id){
global $config;
$maxlength = 60;
$close_title="title='".gettext('move mouse out this alias to hide')."'";
if (is_array($config['aliases']['alias'][$alias_id])){
$alias_name=$config['aliases']['alias'][$alias_id];
$alias_objects_with_details = "<table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\" summary=\"alias info popup\">";
if ($alias_name['url']) {
// TODO: Change it when pf supports tables with ports
if ($alias_name['type'] == "urltable") {
exec("/sbin/pfctl -t {$alias_name['name']} -T show | wc -l", $total_entries);
$counter=preg_replace("/\D/","",$total_entries[0]);
exec("/sbin/pfctl -t {$alias_name['name']} -T show | head -10002", $alias_addresses);
} else {
$urlfn = alias_expand_urltable($alias_name['name']);
$alias_addresses = explode("\n", file_get_contents($urlfn));
$counter = count($alias_addresses);
}
$alias_objects_with_details .= "<tr><td colspan=\"3\" $close_title class=\"vncell\">{$alias_name['url']}</td></tr>";
$x=0;
foreach ($alias_addresses as $alias_ports_address ) {
switch ($x) {
case 0:
$x++;
$alias_objects_with_details .= "<tr><td $close_title class=\"vncell\" width=\"33%\" style=\"background: #FFFFFF;color: #000000;\">{$alias_ports_address}</td>";
break;
case 1:
$x++;
$alias_objects_with_details .= "<td $close_title class=\"vncell\" width=\"33%\" style=\"background: #FFFFFF;color: #000000;\">{$alias_ports_address}</td>";
break;
default:
$x=0;
$alias_objects_with_details .= "<td $close_title class=\"vncell\" width=\"33%\" style=\"background: #FFFFFF;color: #000000;\">{$alias_ports_address}</td><tr>";
break;
}
}
for ($y = $x; $y <= $x; $y++) {
$alias_objects_with_details .= "<td $close_title class=\"vncell\" width=\"33%\">&nbsp;</td>";
}
if ($x > 0) {
$alias_objects_with_details .= "</tr>";
}
if ($counter > 10002) {
$alias_objects_with_details .= "<tr><td colspan=\"3\"> ". gettext("listing only first 10k items") . "</td><tr>";
}
}
else{
$alias_addresses = explode (" ", $alias_name['address']);
$alias_details = explode ("||", $alias_name['detail']);
$counter = 0;
foreach ($alias_addresses as $alias_ports_address) {
$alias_objects_with_details .= "<tr><td $close_title width=\"5%\" class=\"vncell\" style=\"background: #FFFFFF;color: #000000;\">{$alias_addresses[$counter]}</td>";
$alias_detail_default = strpos ($alias_details[$counter],"Entry added");
if ($alias_details[$counter] != "" && $alias_detail_default === False)
$alias_objects_with_details .="<td $close_title width=\"95%\" class=\"vncell\" style=\"background: #FFFFFF;color: #000000;\">{$alias_details[$counter]}</td>";
else
$alias_objects_with_details .="<td $close_title width=\"95%\" class=\"vncell\" style=\"background: #FFFFFF;color: #000000;\">&nbsp;</td>";
$alias_objects_with_details .= "</tr>";
$counter++;
}
}
$alias_objects_with_details .= "</table>";
}
$alias_descr_substr = $alias_name['descr'];
if ($strlength >= $maxlength)
$alias_descr_substr = substr($alias_descr_substr, 0, $maxlength) . "...";
$item_text = ($counter > 1 ? "items" : "item");
$alias_caption = "{$alias_descr_substr} - {$counter} {$item_text}<a href=\"/firewall_aliases_edit.php?id={$alias_id}\" title=\"".gettext('edit this alias')."\">&nbsp;&nbsp;edit </a>";
$strlength = strlen ($alias_caption);
print "<h1>{$alias_caption}</h1>" . $alias_objects_with_details;
}
function rule_popup($src,$srcport,$dst,$dstport){
global $config,$g;
$aliases_array = array();
if (isset($config['aliases']['alias'])) {
$descriptions = array ();
foreach ($config['aliases']['alias'] as $alias_id=>$alias_name){
if ($alias_name['name'] == $src) {
//var_dump($config['aliases']['alias'][$alias_id]);
$aliases_array['src']=$config['aliases']['alias'][$alias_id];
$aliases_array['src']['aliasid']=$alias_id;
//$descriptions['src'] = $span_begin;
//$descriptions['src_end'] = $span_end;
}
if ($alias_name['name'] == $srcport) {
$aliases_array['srcport']=$config['aliases']['alias'][$alias_id];
$aliases_array['srcport']['aliasid']=$alias_id;
//$descriptions['srcport'] = $span_begin;
//$descriptions['srcport_end'] = $span_end;
}
if ($alias_name['name'] == $dst ) {
$aliases_array['dst']=$config['aliases']['alias'][$alias_id];
$aliases_array['dst']['aliasid']=$alias_id;
//$descriptions['dst'] = $span_begin;
//$descriptions['dst_end'] = $span_end;
}
if ($alias_name['name'] == $dstport) {
$aliases_array['dstport']=$config['aliases']['alias'][$alias_id];
$aliases_array['dstport']['aliasid']=$alias_id;
//$descriptions['dstport'] = $span_begin;
//$descriptions['dstport_end'] = $span_end;
}
}
return $aliases_array;//$descriptions;
}
}
$timezone = $config['system']['timezone'];
if (!$timezone) {
......
......@@ -28,6 +28,78 @@
require_once("guiconfig.inc");
$rfc2616 = array(
100 => "100 Continue",
101 => "101 Switching Protocols",
200 => "200 OK",
201 => "201 Created",
202 => "202 Accepted",
203 => "203 Non-Authoritative Information",
204 => "204 No Content",
205 => "205 Reset Content",
206 => "206 Partial Content",
300 => "300 Multiple Choices",
301 => "301 Moved Permanently",
302 => "302 Found",
303 => "303 See Other",
304 => "304 Not Modified",
305 => "305 Use Proxy",
306 => "306 (Unused)",
307 => "307 Temporary Redirect",
400 => "400 Bad Request",
401 => "401 Unauthorized",
402 => "402 Payment Required",
403 => "403 Forbidden",
404 => "404 Not Found",
405 => "405 Method Not Allowed",
406 => "406 Not Acceptable",
407 => "407 Proxy Authentication Required",
408 => "408 Request Timeout",
409 => "409 Conflict",
410 => "410 Gone",
411 => "411 Length Required",
412 => "412 Precondition Failed",
413 => "413 Request Entity Too Large",
414 => "414 Request-URI Too Long",
415 => "415 Unsupported Media Type",
416 => "416 Requested Range Not Satisfiable",
417 => "417 Expectation Failed",
500 => "500 Internal Server Error",
501 => "501 Not Implemented",
502 => "502 Bad Gateway",
503 => "503 Service Unavailable",
504 => "504 Gateway Timeout",
505 => "505 HTTP Version Not Supported"
);
function is_rfc2616_code($code) {
global $rfc2616;
if (isset($rfc2616[$code]))
return true;
else
return false;
}
function print_rfc2616_select($tag, $current){
global $rfc2616;
/* Default to 200 OK if not set */
if ($current == "")
$current = 200;
echo "<select id=\"{$tag}\" name=\"{$tag}\">\n";
foreach($rfc2616 as $code => $message) {
if ($code == $current) {
$sel = " selected=\"selected\"";
} else {
$sel = "";
}
echo "<option value=\"{$code}\"{$sel}>{$message}</option>\n";
}
echo "</select>\n";
}
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/load_balancer_monitor.php');
if (!is_array($config['load_balancer']['monitor_type'])) {
......
......@@ -963,7 +963,7 @@ function enable_change(enable_change) {
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Portal page contents"); ?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;?><input type="file" name="htmlfile" class="formfld file btn btn-default" id="htmlfile" /><br />
<input type="file" name="htmlfile" class="formfld file btn btn-default" id="htmlfile" /><br />
<?php
list($host) = explode(":", $_SERVER['HTTP_HOST']);
$zoneid = $pconfig['zoneid'] ? ( $pconfig['zoneid'] + 8000 ) : 8000;
......
......@@ -191,8 +191,7 @@ include("head.inc");
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("IP address"); ?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;
?><input name="ip" type="text" class="formfld unknown" id="ip" size="17" value="<?=htmlspecialchars($pconfig['ip']);?>" />
<input name="ip" type="text" class="formfld unknown" id="ip" size="17" value="<?=htmlspecialchars($pconfig['ip']);?>" />
/<select name='sn' class="formselect" id='sn'>
<?php for ($i = 32; $i >= 1; $i--) :
?>
......
......@@ -218,8 +218,7 @@ include("head.inc");
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("MAC address"); ?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;
?><input name="mac" type="text" class="formfld unknown" id="mac" size="17" value="<?=htmlspecialchars($pconfig['mac']);?>" />
<input name="mac" type="text" class="formfld unknown" id="mac" size="17" value="<?=htmlspecialchars($pconfig['mac']);?>" />
<?php
$ip = getenv('REMOTE_ADDR');
$mac = `/usr/sbin/arp -an | grep {$ip} | cut -d" " -f4`;
......
......@@ -190,8 +190,7 @@ include("head.inc");
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Roll"); ?>#</td>
<td width="78%" class="vtable">
<?=$mandfldhtml;
?><input name="number" type="text" class="formfld" id="number" size="10" value="<?=htmlspecialchars($pconfig['number']);?>" />
<input name="number" type="text" class="formfld" id="number" size="10" value="<?=htmlspecialchars($pconfig['number']);?>" />
<br />
<span class="vexpl"><?=gettext("Enter the Roll");
?># (0..<?=htmlspecialchars($maxnumber);
......@@ -201,8 +200,7 @@ include("head.inc");
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Minutes per Ticket"); ?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;
?><input name="minutes" type="text" class="formfld" id="minutes" size="10" value="<?=htmlspecialchars($pconfig['minutes']);?>" />
<input name="minutes" type="text" class="formfld" id="minutes" size="10" value="<?=htmlspecialchars($pconfig['minutes']);?>" />
<br />
<span class="vexpl"><?=gettext("Defines the time in minutes that a user is allowed access. The clock starts ticking the first time a voucher is used for authentication"); ?>.</span>
</td>
......@@ -210,8 +208,7 @@ include("head.inc");
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Count"); ?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;
?><input name="count" type="text" class="formfld" id="count" size="10" value="<?=htmlspecialchars($pconfig['count']);?>" />
<input name="count" type="text" class="formfld" id="count" size="10" value="<?=htmlspecialchars($pconfig['count']);?>" />
<br />
<span class="vexpl"><?=gettext("Enter the number of vouchers");
?> (1..<?=htmlspecialchars($maxcount);
......@@ -221,8 +218,7 @@ include("head.inc");
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Comment"); ?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;
?><input name="descr" type="text" class="formfld" id="descr" size="60" value="<?=htmlspecialchars($pconfig['descr']);?>" />
<input name="descr" type="text" class="formfld" id="descr" size="60" value="<?=htmlspecialchars($pconfig['descr']);?>" />
<br />
<span class="vexpl"><?=gettext("Can be used to further identify this roll. Ignored by the system"); ?>.</span>
</td>
......
......@@ -135,21 +135,21 @@ include("head.inc");
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Domain");?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;?><input name="domain" type="text" class="formfld unknown" id="domain" size="40" value="<?=htmlspecialchars($pconfig['domain']);?>" />
<input name="domain" type="text" class="formfld unknown" id="domain" size="40" value="<?=htmlspecialchars($pconfig['domain']);?>" />
<br /> <span class="vexpl"><?=gettext("Domain to override (NOTE: this does not have to be a valid TLD!)"); ?><br />
<?=gettext("e.g."); ?> <em><?=gettext("test"); ?></em> <?=gettext("or"); ?> <em>mycompany.localdomain</em> <?=gettext("or"); ?> <em>1.168.192.in-addr.arpa</em> </span></td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("IP address");?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;?><input name="ip" type="text" class="formfld unknown" id="ip" size="40" value="<?=htmlspecialchars($pconfig['ip']);?>" />
<input name="ip" type="text" class="formfld unknown" id="ip" size="40" value="<?=htmlspecialchars($pconfig['ip']);?>" />
<br /> <span class="vexpl"><?=gettext("IP address of the authoritative DNS server for this domain"); ?><br />
<?=gettext("e.g."); ?> <em>192.168.100.100</em><br /><?=gettext("Or enter # for an exclusion to pass through this host/subdomain to standard nameservers instead of a previous override."); ?><br /><?=gettext("Or enter ! for lookups for this host/subdomain to NOT be forwarded anywhere."); ?></span></td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Source IP");?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;?><input name="dnssrcip" type="text" class="formfld unknown" id="dnssrcip" size="40" value="<?=htmlspecialchars($pconfig['dnssrcip']);?>" />
<input name="dnssrcip" type="text" class="formfld unknown" id="dnssrcip" size="40" value="<?=htmlspecialchars($pconfig['dnssrcip']);?>" />
<br /> <span class="vexpl"><?=gettext("Source IP address for queries to the DNS server for the override domain."); ?><br />
<?=gettext("Leave blank unless your DNS server is accessed through a VPN tunnel."); ?></span></td>
</tr>
......
......@@ -129,7 +129,7 @@ include("head.inc");
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Domain");?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;?><input name="domain" type="text" class="formfld unknown" id="domain" size="40" value="<?=htmlspecialchars($pconfig['domain']);?>" /><br />
<input name="domain" type="text" class="formfld unknown" id="domain" size="40" value="<?=htmlspecialchars($pconfig['domain']);?>" /><br />
<span class="vexpl">
<?=gettext("Domain to override (NOTE: this does not have to be a valid TLD!)"); ?><br />
<?=gettext("e.g."); ?> <em><?=gettext("test"); ?></em> <?=gettext("or"); ?> <em>mycompany.localdomain</em> <?=gettext("or"); ?> <em>1.168.192.in-addr.arpa</em>
......@@ -139,7 +139,7 @@ include("head.inc");
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("IP address");?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;?><input name="ip" type="text" class="formfld unknown" id="ip" size="40" value="<?=htmlspecialchars($pconfig['ip']);?>" /><br />
<input name="ip" type="text" class="formfld unknown" id="ip" size="40" value="<?=htmlspecialchars($pconfig['ip']);?>" /><br />
<span class="vexpl">
<?=gettext("IP address of the authoritative DNS server for this domain"); ?><br />
<?=gettext("e.g."); ?> <em>192.168.100.100</em><br />
......
......@@ -31,6 +31,49 @@
require_once("guiconfig.inc");
require_once("auth.inc");
$ldap_urltypes = array(
'TCP - Standard' => 389,
'SSL - Encrypted' => 636);
$auth_server_types = array(
'ldap' => "LDAP",
'radius' => "Radius");
$ldap_scopes = array(
'one' => "One Level",
'subtree' => "Entire Subtree");
$ldap_protvers = array(
2,
3);
$ldap_templates = array(
'open' => array(
'desc' => "OpenLDAP",
'attr_user' => "cn",
'attr_group' => "cn",
'attr_member' => "member"),
'msad' => array(
'desc' => "Microsoft AD",
'attr_user' => "samAccountName",
'attr_group' => "cn",
'attr_member' => "memberOf"),
'edir' => array(
'desc' => "Novell eDirectory",
'attr_user' => "cn",
'attr_group' => "cn",
'attr_member' => "uniqueMember"));
$radius_srvcs = array(
'both' => "Authentication and Accounting",
'auth' => "Authentication",
'acct' => "Accounting");
$pgtitle = array(gettext("System"), gettext("Authentication Servers"));
$shortcut_section = "authentication";
......
......@@ -142,8 +142,7 @@ include("head.inc");
<tr>
<td valign="top" class="vncellreq"><?=gettext("Identifier"); ?></td>
<td class="vtable">
<?=$mandfldhtml;
?><input name="ident" type="text" class="formfld unknown" id="ident" size="30" value="<?=htmlspecialchars($pconfig['ident']);?>" />
<input name="ident" type="text" class="formfld unknown" id="ident" size="30" value="<?=htmlspecialchars($pconfig['ident']);?>" />
<br />
<?=gettext("This can be either an IP address, fully qualified domain name or an e-mail address"); ?>.
</td>
......@@ -151,8 +150,7 @@ include("head.inc");
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Pre-Shared Key"); ?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;
?><input name="psk" type="text" class="formfld unknown" id="psk" size="40" value="<?=htmlspecialchars($pconfig['psk']);?>" />
<input name="psk" type="text" class="formfld unknown" id="psk" size="40" value="<?=htmlspecialchars($pconfig['psk']);?>" />
</td>
</tr>
<tr>
......
......@@ -701,8 +701,7 @@ function dpdchkbox_change() {
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Remote gateway"); ?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;
?><input name="remotegw" type="text" class="formfld unknown" id="remotegw" size="28" value="<?=htmlspecialchars($pconfig['remotegw']);?>" />
<input name="remotegw" type="text" class="formfld unknown" id="remotegw" size="28" value="<?=htmlspecialchars($pconfig['remotegw']);?>" />
<br />
<?=gettext("Enter the public IP address or host name of the remote gateway"); ?>
</td>
......@@ -826,7 +825,7 @@ endforeach; ?>
<tr id="opt_psk">
<td width="22%" valign="top" class="vncellreq"><?=gettext("Pre-Shared Key"); ?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;?>
<input name="pskey" type="text" class="formfld unknown" id="pskey" size="40" value="<?=htmlspecialchars($pconfig['pskey']);?>" />
<span class="vexpl">
<br />
......
......@@ -600,7 +600,7 @@ if (isset($input_errors) && count($input_errors) > 0) {
</tr>
<tr>
<td><?=gettext("Address:");?>&nbsp;&nbsp;</td>
<td><?=$mandfldhtmlspc;?></td>
<td></td>
<td>
<input name="localid_address" type="text" class="formfld unknown ipv4v6" id="localid_address" size="28" value="<?=htmlspecialchars($pconfig['localid_address']);?>" />
/
......@@ -653,7 +653,7 @@ endfor; ?>
</tr>
<tr>
<td><?=gettext("Address:");?>&nbsp;&nbsp;</td>
<td><?=$mandfldhtmlspc;?></td>
<td></td>
<td>
<input name="natlocalid_address" type="text" class="formfld unknown ipv4v6" id="natlocalid_address" size="28" value="<?=htmlspecialchars($pconfig['natlocalid_address']);?>" />
/
......@@ -699,7 +699,7 @@ endfor; ?>
</tr>
<tr>
<td><?=gettext("Address"); ?>:&nbsp;&nbsp;</td>
<td><?=$mandfldhtmlspc;?></td>
<td></td>
<td>
<input name="remoteid_address" type="text" class="formfld unknown ipv4v6" id="remoteid_address" size="28" value="<?=htmlspecialchars($pconfig['remoteid_address']);?>" />
/
......
......@@ -347,8 +347,7 @@ function enable_change(enable_over) {
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Server Address");?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;
?><input name="localip" type="text" class="form-control unknown" id="localip" size="20" value="<?=htmlspecialchars($pconfig['localip']);?>" />
<input name="localip" type="text" class="form-control unknown" id="localip" size="20" value="<?=htmlspecialchars($pconfig['localip']);?>" />
<p class="text-muted"><em><small>
<?=gettext("Enter the IP address the L2TP server should give to clients for use as their \"gateway\""); ?>.
<br />
......@@ -360,8 +359,7 @@ function enable_change(enable_over) {
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Remote Address Range");?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;
?><input name="remoteip" type="text" class="form-control unknown" id="remoteip" size="20" value="<?=htmlspecialchars($pconfig['remoteip']);?>" />
<input name="remoteip" type="text" class="form-control unknown" id="remoteip" size="20" value="<?=htmlspecialchars($pconfig['remoteip']);?>" />
<p class="text-muted"><em><small><?=gettext("Specify the starting address for the client IP address subnet.");?></small></em></p>
</td>
</tr>
......@@ -414,7 +412,7 @@ function enable_change(enable_over) {
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Authentication Type");?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;?><select name="paporchap" id="paporchap">
<select name="paporchap" id="paporchap">
<option value='chap'<?php if ($pconfig['paporchap'] == "chap") {
echo " selected=\"selected\"";
......@@ -431,8 +429,7 @@ function enable_change(enable_over) {
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("L2TP DNS Servers"); ?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;
?><input name="l2tp_dns1" type="text" class="form-control unknown" id="l2tp_dns1" size="20" value="<?=htmlspecialchars($pconfig['l2tp_dns1']);?>" />
<input name="l2tp_dns1" type="text" class="form-control unknown" id="l2tp_dns1" size="20" value="<?=htmlspecialchars($pconfig['l2tp_dns1']);?>" />
<br />
<input name="l2tp_dns2" type="text" class="form-control unknown" id="l2tp_dns2" size="20" value="<?=htmlspecialchars($pconfig['l2tp_dns2']);?>" />
<br />
......
......@@ -177,15 +177,14 @@ include("head.inc");
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Username");?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;
?><input name="usernamefld" type="text" class="form-control user" id="usernamefld" size="20" value="<?=htmlspecialchars($pconfig['usernamefld']);?>" />
<input name="usernamefld" type="text" class="form-control user" id="usernamefld" size="20" value="<?=htmlspecialchars($pconfig['usernamefld']);?>" />
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Password");?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;?><input name="passwordfld" type="password" class="form-control pwd" id="passwordfld" size="20" />
<br /><?=$mandfldhtml;?><input name="password2" type="password" class="form-control pwd" id="password2" size="20" />
<input name="passwordfld" type="password" class="form-control pwd" id="passwordfld" size="20" />
<br /><input name="password2" type="password" class="form-control pwd" id="password2" size="20" />
&nbsp;(<?=gettext("confirmation");?>)<?php if (isset($id) && $a_secret[$id]) :
?><br />
<p class="text-muted"><em><small><?=gettext("If you want to change the users password, enter it here twice.");?></small></em></p>
......
......@@ -472,8 +472,7 @@ function enable_change(enable_over) {
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Server address"); ?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;
?><input name="localip" type="text" class="formfld unknown" id="localip" size="20" value="<?=htmlspecialchars($pconfig['localip']);?>" />
<input name="localip" type="text" class="formfld unknown" id="localip" size="20" value="<?=htmlspecialchars($pconfig['localip']);?>" />
<br />
<?=gettext("Enter the IP address the PPPoE server should give to clients for use as their \"gateway\""); ?>.
<br />
......@@ -485,8 +484,7 @@ function enable_change(enable_over) {
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Remote address range"); ?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;
?><input name="remoteip" type="text" class="formfld unknown" id="remoteip" size="20" value="<?=htmlspecialchars($pconfig['remoteip']);?>" />
<input name="remoteip" type="text" class="formfld unknown" id="remoteip" size="20" value="<?=htmlspecialchars($pconfig['remoteip']);?>" />
<br />
<?=gettext("Specify the starting address for the client IP address subnet"); ?>.<br />
</td>
......@@ -494,16 +492,14 @@ function enable_change(enable_over) {
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;
?><input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>" />
<input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>" />
<br />
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("DNS servers"); ?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;
?><input name="pppoe_dns1" type="text" class="formfld unknown" id="pppoe_dns1" size="20" value="<?=htmlspecialchars($pconfig['pppoe_dns1']);?>" />
<input name="pppoe_dns1" type="text" class="formfld unknown" id="pppoe_dns1" size="20" value="<?=htmlspecialchars($pconfig['pppoe_dns1']);?>" />
<br />
<input name="pppoe_dns2" type="text" class="formfld unknown" id="pppoe_dns2" size="20" value="<?=htmlspecialchars($pconfig['pppoe_dns2']);?>" />
<br />
......@@ -536,16 +532,14 @@ function enable_change(enable_over) {
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("NAS IP Address"); ?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;
?><input name="radius_nasip" type="text" class="formfld unknown" id="radius_nasip" size="20" value="<?=htmlspecialchars($pconfig['radius_nasip']);?>" />
<input name="radius_nasip" type="text" class="formfld unknown" id="radius_nasip" size="20" value="<?=htmlspecialchars($pconfig['radius_nasip']);?>" />
<br /><?=gettext("RADIUS server NAS IP Address"); ?><br />
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("RADIUS Accounting Update"); ?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;
?><input name="radius_acct_update" type="text" class="formfld unknown" id="radius_acct_update" size="20" value="<?=htmlspecialchars($pconfig['radius_acct_update']);?>" />
<input name="radius_acct_update" type="text" class="formfld unknown" id="radius_acct_update" size="20" value="<?=htmlspecialchars($pconfig['radius_acct_update']);?>" />
<br /><?=gettext("RADIUS accounting update period in seconds"); ?>
</td>
</tr>
......
......@@ -346,8 +346,7 @@ function enable_change(enable_over) {
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("PPTP redirection");?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;
?><input name="redir" type="text" class="form-control unknown" id="redir" size="20" value="<?=htmlspecialchars($pconfig['redir']);?>" />
<input name="redir" type="text" class="form-control unknown" id="redir" size="20" value="<?=htmlspecialchars($pconfig['redir']);?>" />
<br />
<?=gettext("Enter the IP address of a host which will accept incoming " .
"PPTP connections"); ?>.</td>
......@@ -382,8 +381,7 @@ function enable_change(enable_over) {
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Server address"); ?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;
?><input name="localip" type="text" class="form-control unknown" id="localip" size="20" value="<?=htmlspecialchars($pconfig['localip']);?>" />
<input name="localip" type="text" class="form-control unknown" id="localip" size="20" value="<?=htmlspecialchars($pconfig['localip']);?>" />
<br />
<?=gettext("Enter the IP address the PPTP server should give to clients for use as their \"gateway\""); ?>.
<br />
......@@ -396,8 +394,7 @@ function enable_change(enable_over) {
<td width="22%" valign="top" class="vncellreq"><?=gettext("Remote address " .
"range"); ?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;
?><input name="remoteip" type="text" class="form-control unknown" id="remoteip" size="20" value="<?=htmlspecialchars($pconfig['remoteip']);?>" />
<input name="remoteip" type="text" class="form-control unknown" id="remoteip" size="20" value="<?=htmlspecialchars($pconfig['remoteip']);?>" />
<br />
<?=gettext("Specify the starting address for the client IP subnet"); ?>.<br />
</td>
......@@ -405,8 +402,7 @@ function enable_change(enable_over) {
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("PPTP DNS Servers"); ?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;
?><input name="pptp_dns1" type="text" class="form-control unknown" id="pptp_dns1" size="20" value="<?=htmlspecialchars($pconfig['pptp_dns1']);?>" />
<input name="pptp_dns1" type="text" class="form-control unknown" id="pptp_dns1" size="20" value="<?=htmlspecialchars($pconfig['pptp_dns1']);?>" />
<br />
<input name="pptp_dns2" type="text" class="form-control unknown" id="pptp_dns2" size="20" value="<?=htmlspecialchars($pconfig['pptp_dns2']);?>" />
<br />
......
......@@ -170,15 +170,14 @@ include("head.inc");
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Username");?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;
?><input name="username" type="text" class="form-control user" id="username" size="20" value="<?=htmlspecialchars($pconfig['username']);?>" />
<input name="username" type="text" class="form-control user" id="username" size="20" value="<?=htmlspecialchars($pconfig['username']);?>" />
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Password");?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;?><input name="password" type="password" class="form-control pwd" id="password" size="20" />
<br /><?=$mandfldhtml;?><input name="password2" type="password" class="form-control pwd" id="password2" size="20" />
<input name="password" type="password" class="form-control pwd" id="password" size="20" />
<br /><input name="password2" type="password" class="form-control pwd" id="password2" size="20" />
&nbsp;(<?=gettext("confirmation");?>)<?php if (isset($id) && $a_secret[$id]) :
?><br />
<span class="vexpl"><?=gettext("If you want to change the users' password, ".
......
......@@ -34,6 +34,38 @@ require_once("guiconfig.inc");
require_once("functions.inc");
require_once("ipsec.inc");
//function to create widget tabs when called
function display_widget_tabs(& $tab_array) {
echo "<div id=\"tabs\">";
$tabscounter = 0;
foreach ($tab_array as $ta) {
$dashpos = strpos($ta[2],'-');
$tabname = $ta[2] . "-tab";
$tabclass = substr($ta[2],0,$dashpos);
$tabclass = $tabclass . "-class";
if ($ta[1] == true) {
$tabActive = "table-cell";
$tabNonActive = "none";
}
else {
$tabActive = "none";
$tabNonActive = "table-cell";
}
echo "<div id=\"{$ta[2]}-active\" class=\"{$tabclass}-tabactive\" style=\"display:{$tabActive}; background-color:#EEEEEE; color:black;\">";
echo "<b>&nbsp;&nbsp;&nbsp;{$ta[0]}";
echo "&nbsp;&nbsp;&nbsp;</b>";
echo "</div>";
echo "<div id=\"{$ta[2]}-deactive\" class=\"{$tabclass}-tabdeactive\" style=\"display:{$tabNonActive}; background-color:#777777; color:white; cursor: pointer;\" onclick=\"return changeTabDIV('{$ta[2]}')\">";
echo "<b>&nbsp;&nbsp;&nbsp;{$ta[0]}";
echo "&nbsp;&nbsp;&nbsp;</b>";
echo "</div>";
}
}
if (isset($config['ipsec']['phase1'])) {
echo "<div>&nbsp;</div>\n";
$tab_array = array();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment