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']); ...@@ -51,7 +51,6 @@ $allowedpages = getAllowedPages($_SESSION['Username']);
if (!isAllowedPage($_SERVER['REQUEST_URI'])) { if (!isAllowedPage($_SERVER['REQUEST_URI'])) {
if (count($allowedpages) > 0) { if (count($allowedpages) > 0) {
$page = str_replace('*', '', $allowedpages[0]); $page = str_replace('*', '', $allowedpages[0]);
$_SESSION['Post_Login'] = true;
require_once("functions.inc"); require_once("functions.inc");
redirectHeader("/{$page}"); redirectHeader("/{$page}");
...@@ -66,20 +65,7 @@ if (!isAllowedPage($_SERVER['REQUEST_URI'])) { ...@@ -66,20 +65,7 @@ if (!isAllowedPage($_SERVER['REQUEST_URI'])) {
display_error_form("201", gettext("No page assigned to this user! Click here to logout.")); display_error_form("201", gettext("No page assigned to this user! Click here to logout."));
exit; 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. * Close session data to allow other scripts from same host to come in.
...@@ -144,24 +130,14 @@ function display_login_form() ...@@ -144,24 +130,14 @@ function display_login_form()
unset($input_errors); unset($input_errors);
if (isAjax()) { 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; exit;
} }
/* Check against locally configured IP addresses, which will catch when someone /* Check against locally configured IP addresses, which will catch when someone
port forwards WebGUI access from WAN to an internal IP on the router. */ port forwards WebGUI access from WAN to an internal IP on the router. */
global $FilterIflist, $nifty_background; global $FilterIflist;
$local_ip = false; $local_ip = false;
if (strstr($_SERVER['HTTP_HOST'], ":")) { if (strstr($_SERVER['HTTP_HOST'], ":")) {
$http_host_port = explode(":", $_SERVER['HTTP_HOST']); $http_host_port = explode(":", $_SERVER['HTTP_HOST']);
...@@ -183,7 +159,7 @@ function display_login_form() ...@@ -183,7 +159,7 @@ function display_login_form()
} }
unset($FilterIflist); unset($FilterIflist);
if ($config['virtualip']) { if (isset($config['virtualip'])) {
if ($config['virtualip']['vip']) { if ($config['virtualip']['vip']) {
foreach ($config['virtualip']['vip'] as $vip) { foreach ($config['virtualip']['vip'] as $vip) {
if ($vip['subnet'] == $http_host) { if ($vip['subnet'] == $http_host) {
...@@ -236,7 +212,6 @@ function display_login_form() ...@@ -236,7 +212,6 @@ function display_login_form()
<div class="container"> <div class="container">
<?php <?php
if (is_ipaddr($http_host) && !$local_ip && !isset($config['system']['webgui']['nohttpreferercheck'])) { 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.")); 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"'; $loginautocomplete = isset($config['system']['webgui']['loginautocomplete']) ? '' : 'autocomplete="off"';
......
...@@ -187,7 +187,7 @@ include("head.inc"); ?> ...@@ -187,7 +187,7 @@ include("head.inc"); ?>
<tbody> <tbody>
<tr> <tr>
<td><?=gettext("Hostname or IP");?></td> <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): ?> <?php if ($resolved && $type): ?>
<td> <td>
<?php <?php
......
...@@ -31,6 +31,24 @@ ...@@ -31,6 +31,24 @@
require_once("guiconfig.inc"); require_once("guiconfig.inc");
require_once("ipsec.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'; $ipsec_logfile = '/var/log/ipsec.log';
$nentries = $config['syslog']['nentries']; $nentries = $config['syslog']['nentries'];
......
...@@ -92,7 +92,7 @@ include("head.inc"); ?> ...@@ -92,7 +92,7 @@ include("head.inc"); ?>
<tbody> <tbody>
<tr> <tr>
<td><?=gettext("Host"); ?></td> <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>
<tr> <tr>
<td><?=gettext("IP Protocol"); ?></td> <td><?=gettext("IP Protocol"); ?></td>
......
...@@ -107,7 +107,7 @@ include("head.inc"); ?> ...@@ -107,7 +107,7 @@ include("head.inc"); ?>
<tbody> <tbody>
<tr> <tr>
<td><?=gettext("Host"); ?></td> <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>
<tr> <tr>
<td><?= gettext("Port"); ?></td> <td><?= gettext("Port"); ?></td>
......
...@@ -100,7 +100,7 @@ if (!isset($do_traceroute)) { ...@@ -100,7 +100,7 @@ if (!isset($do_traceroute)) {
<tbody> <tbody>
<tr> <tr>
<td><?=gettext("Host"); ?></td> <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>
<tr> <tr>
<td><?=gettext("IP Protocol"); ?></td> <td><?=gettext("IP Protocol"); ?></td>
......
...@@ -98,7 +98,6 @@ if($need_alert_display == true) { ...@@ -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>"; echo "<div class=\"col-xs-12\"><div class=\"alert alert-info\"><p>".$display_text."</p></div></div>";
} }
$pgtitle_output = true;
?> ?>
<header class="page-head"> <header class="page-head">
...@@ -174,7 +173,7 @@ $pgtitle_output = true; ...@@ -174,7 +173,7 @@ $pgtitle_output = true;
<div class="container-fluid"> <div class="container-fluid">
<form action="<?=$_SERVER['REQUEST_URI'];?>" method="post"> <form action="<?=$_SERVER['REQUEST_URI'];?>" method="post">
<ul class="list-inline"> <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"> <li class="btn-group-container">
......
...@@ -32,6 +32,43 @@ require_once("guiconfig.inc"); ...@@ -32,6 +32,43 @@ require_once("guiconfig.inc");
require_once("functions.inc"); require_once("functions.inc");
require_once("filter.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")); $pgtitle = array(gettext("Firewall"),gettext("Rules"));
$shortcut_section = "firewall"; $shortcut_section = "firewall";
......
...@@ -31,6 +31,32 @@ ...@@ -31,6 +31,32 @@
require_once("guiconfig.inc"); require_once("guiconfig.inc");
require_once("filter.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'); $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_rules.php');
function is_posnumericint($arg) { function is_posnumericint($arg) {
......
This diff is collapsed.
...@@ -28,6 +28,78 @@ ...@@ -28,6 +28,78 @@
require_once("guiconfig.inc"); 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'); $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/load_balancer_monitor.php');
if (!is_array($config['load_balancer']['monitor_type'])) { if (!is_array($config['load_balancer']['monitor_type'])) {
......
...@@ -963,7 +963,7 @@ function enable_change(enable_change) { ...@@ -963,7 +963,7 @@ function enable_change(enable_change) {
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Portal page contents"); ?></td> <td width="22%" valign="top" class="vncell"><?=gettext("Portal page contents"); ?></td>
<td width="78%" class="vtable"> <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 <?php
list($host) = explode(":", $_SERVER['HTTP_HOST']); list($host) = explode(":", $_SERVER['HTTP_HOST']);
$zoneid = $pconfig['zoneid'] ? ( $pconfig['zoneid'] + 8000 ) : 8000; $zoneid = $pconfig['zoneid'] ? ( $pconfig['zoneid'] + 8000 ) : 8000;
......
...@@ -191,8 +191,7 @@ include("head.inc"); ...@@ -191,8 +191,7 @@ include("head.inc");
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("IP address"); ?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("IP address"); ?></td>
<td width="78%" class="vtable"> <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'> /<select name='sn' class="formselect" id='sn'>
<?php for ($i = 32; $i >= 1; $i--) : <?php for ($i = 32; $i >= 1; $i--) :
?> ?>
......
...@@ -218,8 +218,7 @@ include("head.inc"); ...@@ -218,8 +218,7 @@ include("head.inc");
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("MAC address"); ?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("MAC address"); ?></td>
<td width="78%" class="vtable"> <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 <?php
$ip = getenv('REMOTE_ADDR'); $ip = getenv('REMOTE_ADDR');
$mac = `/usr/sbin/arp -an | grep {$ip} | cut -d" " -f4`; $mac = `/usr/sbin/arp -an | grep {$ip} | cut -d" " -f4`;
......
...@@ -190,8 +190,7 @@ include("head.inc"); ...@@ -190,8 +190,7 @@ include("head.inc");
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Roll"); ?>#</td> <td width="22%" valign="top" class="vncellreq"><?=gettext("Roll"); ?>#</td>
<td width="78%" class="vtable"> <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 /> <br />
<span class="vexpl"><?=gettext("Enter the Roll"); <span class="vexpl"><?=gettext("Enter the Roll");
?># (0..<?=htmlspecialchars($maxnumber); ?># (0..<?=htmlspecialchars($maxnumber);
...@@ -201,8 +200,7 @@ include("head.inc"); ...@@ -201,8 +200,7 @@ include("head.inc");
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Minutes per Ticket"); ?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("Minutes per Ticket"); ?></td>
<td width="78%" class="vtable"> <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 /> <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> <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> </td>
...@@ -210,8 +208,7 @@ include("head.inc"); ...@@ -210,8 +208,7 @@ include("head.inc");
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Count"); ?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("Count"); ?></td>
<td width="78%" class="vtable"> <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 /> <br />
<span class="vexpl"><?=gettext("Enter the number of vouchers"); <span class="vexpl"><?=gettext("Enter the number of vouchers");
?> (1..<?=htmlspecialchars($maxcount); ?> (1..<?=htmlspecialchars($maxcount);
...@@ -221,8 +218,7 @@ include("head.inc"); ...@@ -221,8 +218,7 @@ include("head.inc");
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Comment"); ?></td> <td width="22%" valign="top" class="vncell"><?=gettext("Comment"); ?></td>
<td width="78%" class="vtable"> <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 /> <br />
<span class="vexpl"><?=gettext("Can be used to further identify this roll. Ignored by the system"); ?>.</span> <span class="vexpl"><?=gettext("Can be used to further identify this roll. Ignored by the system"); ?>.</span>
</td> </td>
......
...@@ -135,21 +135,21 @@ include("head.inc"); ...@@ -135,21 +135,21 @@ include("head.inc");
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Domain");?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("Domain");?></td>
<td width="78%" class="vtable"> <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 /> <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> <?=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>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("IP address");?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("IP address");?></td>
<td width="78%" class="vtable"> <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 /> <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> <?=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>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Source IP");?></td> <td width="22%" valign="top" class="vncell"><?=gettext("Source IP");?></td>
<td width="78%" class="vtable"> <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 /> <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> <?=gettext("Leave blank unless your DNS server is accessed through a VPN tunnel."); ?></span></td>
</tr> </tr>
......
...@@ -129,7 +129,7 @@ include("head.inc"); ...@@ -129,7 +129,7 @@ include("head.inc");
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Domain");?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("Domain");?></td>
<td width="78%" class="vtable"> <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"> <span class="vexpl">
<?=gettext("Domain to override (NOTE: this does not have to be a valid TLD!)"); ?><br /> <?=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> <?=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"); ...@@ -139,7 +139,7 @@ include("head.inc");
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("IP address");?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("IP address");?></td>
<td width="78%" class="vtable"> <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"> <span class="vexpl">
<?=gettext("IP address of the authoritative DNS server for this domain"); ?><br /> <?=gettext("IP address of the authoritative DNS server for this domain"); ?><br />
<?=gettext("e.g."); ?> <em>192.168.100.100</em><br /> <?=gettext("e.g."); ?> <em>192.168.100.100</em><br />
......
...@@ -31,6 +31,49 @@ ...@@ -31,6 +31,49 @@
require_once("guiconfig.inc"); require_once("guiconfig.inc");
require_once("auth.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")); $pgtitle = array(gettext("System"), gettext("Authentication Servers"));
$shortcut_section = "authentication"; $shortcut_section = "authentication";
......
...@@ -142,8 +142,7 @@ include("head.inc"); ...@@ -142,8 +142,7 @@ include("head.inc");
<tr> <tr>
<td valign="top" class="vncellreq"><?=gettext("Identifier"); ?></td> <td valign="top" class="vncellreq"><?=gettext("Identifier"); ?></td>
<td class="vtable"> <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 /> <br />
<?=gettext("This can be either an IP address, fully qualified domain name or an e-mail address"); ?>. <?=gettext("This can be either an IP address, fully qualified domain name or an e-mail address"); ?>.
</td> </td>
...@@ -151,8 +150,7 @@ include("head.inc"); ...@@ -151,8 +150,7 @@ include("head.inc");
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Pre-Shared Key"); ?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("Pre-Shared Key"); ?></td>
<td width="78%" class="vtable"> <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> </td>
</tr> </tr>
<tr> <tr>
......
...@@ -701,8 +701,7 @@ function dpdchkbox_change() { ...@@ -701,8 +701,7 @@ function dpdchkbox_change() {
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Remote gateway"); ?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("Remote gateway"); ?></td>
<td width="78%" class="vtable"> <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 /> <br />
<?=gettext("Enter the public IP address or host name of the remote gateway"); ?> <?=gettext("Enter the public IP address or host name of the remote gateway"); ?>
</td> </td>
...@@ -826,7 +825,7 @@ endforeach; ?> ...@@ -826,7 +825,7 @@ endforeach; ?>
<tr id="opt_psk"> <tr id="opt_psk">
<td width="22%" valign="top" class="vncellreq"><?=gettext("Pre-Shared Key"); ?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("Pre-Shared Key"); ?></td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<?=$mandfldhtml;?>
<input name="pskey" type="text" class="formfld unknown" id="pskey" size="40" value="<?=htmlspecialchars($pconfig['pskey']);?>" /> <input name="pskey" type="text" class="formfld unknown" id="pskey" size="40" value="<?=htmlspecialchars($pconfig['pskey']);?>" />
<span class="vexpl"> <span class="vexpl">
<br /> <br />
......
...@@ -600,7 +600,7 @@ if (isset($input_errors) && count($input_errors) > 0) { ...@@ -600,7 +600,7 @@ if (isset($input_errors) && count($input_errors) > 0) {
</tr> </tr>
<tr> <tr>
<td><?=gettext("Address:");?>&nbsp;&nbsp;</td> <td><?=gettext("Address:");?>&nbsp;&nbsp;</td>
<td><?=$mandfldhtmlspc;?></td> <td></td>
<td> <td>
<input name="localid_address" type="text" class="formfld unknown ipv4v6" id="localid_address" size="28" value="<?=htmlspecialchars($pconfig['localid_address']);?>" /> <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; ?> ...@@ -653,7 +653,7 @@ endfor; ?>
</tr> </tr>
<tr> <tr>
<td><?=gettext("Address:");?>&nbsp;&nbsp;</td> <td><?=gettext("Address:");?>&nbsp;&nbsp;</td>
<td><?=$mandfldhtmlspc;?></td> <td></td>
<td> <td>
<input name="natlocalid_address" type="text" class="formfld unknown ipv4v6" id="natlocalid_address" size="28" value="<?=htmlspecialchars($pconfig['natlocalid_address']);?>" /> <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; ?> ...@@ -699,7 +699,7 @@ endfor; ?>
</tr> </tr>
<tr> <tr>
<td><?=gettext("Address"); ?>:&nbsp;&nbsp;</td> <td><?=gettext("Address"); ?>:&nbsp;&nbsp;</td>
<td><?=$mandfldhtmlspc;?></td> <td></td>
<td> <td>
<input name="remoteid_address" type="text" class="formfld unknown ipv4v6" id="remoteid_address" size="28" value="<?=htmlspecialchars($pconfig['remoteid_address']);?>" /> <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) { ...@@ -347,8 +347,7 @@ function enable_change(enable_over) {
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Server Address");?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("Server Address");?></td>
<td width="78%" class="vtable"> <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> <p class="text-muted"><em><small>
<?=gettext("Enter the IP address the L2TP server should give to clients for use as their \"gateway\""); ?>. <?=gettext("Enter the IP address the L2TP server should give to clients for use as their \"gateway\""); ?>.
<br /> <br />
...@@ -360,8 +359,7 @@ function enable_change(enable_over) { ...@@ -360,8 +359,7 @@ function enable_change(enable_over) {
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Remote Address Range");?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("Remote Address Range");?></td>
<td width="78%" class="vtable"> <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> <p class="text-muted"><em><small><?=gettext("Specify the starting address for the client IP address subnet.");?></small></em></p>
</td> </td>
</tr> </tr>
...@@ -414,7 +412,7 @@ function enable_change(enable_over) { ...@@ -414,7 +412,7 @@ function enable_change(enable_over) {
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Authentication Type");?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("Authentication Type");?></td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<?=$mandfldhtml;?><select name="paporchap" id="paporchap"> <select name="paporchap" id="paporchap">
<option value='chap'<?php if ($pconfig['paporchap'] == "chap") { <option value='chap'<?php if ($pconfig['paporchap'] == "chap") {
echo " selected=\"selected\""; echo " selected=\"selected\"";
...@@ -431,8 +429,7 @@ function enable_change(enable_over) { ...@@ -431,8 +429,7 @@ function enable_change(enable_over) {
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("L2TP DNS Servers"); ?></td> <td width="22%" valign="top" class="vncell"><?=gettext("L2TP DNS Servers"); ?></td>
<td width="78%" class="vtable"> <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 /> <br />
<input name="l2tp_dns2" type="text" class="form-control unknown" id="l2tp_dns2" size="20" value="<?=htmlspecialchars($pconfig['l2tp_dns2']);?>" /> <input name="l2tp_dns2" type="text" class="form-control unknown" id="l2tp_dns2" size="20" value="<?=htmlspecialchars($pconfig['l2tp_dns2']);?>" />
<br /> <br />
......
...@@ -177,15 +177,14 @@ include("head.inc"); ...@@ -177,15 +177,14 @@ include("head.inc");
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Username");?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("Username");?></td>
<td width="78%" class="vtable"> <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> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Password");?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("Password");?></td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<?=$mandfldhtml;?><input name="passwordfld" type="password" class="form-control pwd" id="passwordfld" size="20" /> <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" /> <br /><input name="password2" type="password" class="form-control pwd" id="password2" size="20" />
&nbsp;(<?=gettext("confirmation");?>)<?php if (isset($id) && $a_secret[$id]) : &nbsp;(<?=gettext("confirmation");?>)<?php if (isset($id) && $a_secret[$id]) :
?><br /> ?><br />
<p class="text-muted"><em><small><?=gettext("If you want to change the users password, enter it here twice.");?></small></em></p> <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) { ...@@ -472,8 +472,7 @@ function enable_change(enable_over) {
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Server address"); ?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("Server address"); ?></td>
<td width="78%" class="vtable"> <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 /> <br />
<?=gettext("Enter the IP address the PPPoE server should give to clients for use as their \"gateway\""); ?>. <?=gettext("Enter the IP address the PPPoE server should give to clients for use as their \"gateway\""); ?>.
<br /> <br />
...@@ -485,8 +484,7 @@ function enable_change(enable_over) { ...@@ -485,8 +484,7 @@ function enable_change(enable_over) {
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Remote address range"); ?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("Remote address range"); ?></td>
<td width="78%" class="vtable"> <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 /> <br />
<?=gettext("Specify the starting address for the client IP address subnet"); ?>.<br /> <?=gettext("Specify the starting address for the client IP address subnet"); ?>.<br />
</td> </td>
...@@ -494,16 +492,14 @@ function enable_change(enable_over) { ...@@ -494,16 +492,14 @@ function enable_change(enable_over) {
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td> <td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td>
<td width="78%" class="vtable"> <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 /> <br />
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("DNS servers"); ?></td> <td width="22%" valign="top" class="vncell"><?=gettext("DNS servers"); ?></td>
<td width="78%" class="vtable"> <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 /> <br />
<input name="pppoe_dns2" type="text" class="formfld unknown" id="pppoe_dns2" size="20" value="<?=htmlspecialchars($pconfig['pppoe_dns2']);?>" /> <input name="pppoe_dns2" type="text" class="formfld unknown" id="pppoe_dns2" size="20" value="<?=htmlspecialchars($pconfig['pppoe_dns2']);?>" />
<br /> <br />
...@@ -536,16 +532,14 @@ function enable_change(enable_over) { ...@@ -536,16 +532,14 @@ function enable_change(enable_over) {
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("NAS IP Address"); ?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("NAS IP Address"); ?></td>
<td width="78%" class="vtable"> <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 /> <br /><?=gettext("RADIUS server NAS IP Address"); ?><br />
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("RADIUS Accounting Update"); ?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("RADIUS Accounting Update"); ?></td>
<td width="78%" class="vtable"> <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"); ?> <br /><?=gettext("RADIUS accounting update period in seconds"); ?>
</td> </td>
</tr> </tr>
......
...@@ -346,8 +346,7 @@ function enable_change(enable_over) { ...@@ -346,8 +346,7 @@ function enable_change(enable_over) {
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("PPTP redirection");?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("PPTP redirection");?></td>
<td width="78%" class="vtable"> <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 /> <br />
<?=gettext("Enter the IP address of a host which will accept incoming " . <?=gettext("Enter the IP address of a host which will accept incoming " .
"PPTP connections"); ?>.</td> "PPTP connections"); ?>.</td>
...@@ -382,8 +381,7 @@ function enable_change(enable_over) { ...@@ -382,8 +381,7 @@ function enable_change(enable_over) {
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Server address"); ?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("Server address"); ?></td>
<td width="78%" class="vtable"> <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 /> <br />
<?=gettext("Enter the IP address the PPTP server should give to clients for use as their \"gateway\""); ?>. <?=gettext("Enter the IP address the PPTP server should give to clients for use as their \"gateway\""); ?>.
<br /> <br />
...@@ -396,8 +394,7 @@ function enable_change(enable_over) { ...@@ -396,8 +394,7 @@ function enable_change(enable_over) {
<td width="22%" valign="top" class="vncellreq"><?=gettext("Remote address " . <td width="22%" valign="top" class="vncellreq"><?=gettext("Remote address " .
"range"); ?></td> "range"); ?></td>
<td width="78%" class="vtable"> <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 /> <br />
<?=gettext("Specify the starting address for the client IP subnet"); ?>.<br /> <?=gettext("Specify the starting address for the client IP subnet"); ?>.<br />
</td> </td>
...@@ -405,8 +402,7 @@ function enable_change(enable_over) { ...@@ -405,8 +402,7 @@ function enable_change(enable_over) {
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("PPTP DNS Servers"); ?></td> <td width="22%" valign="top" class="vncell"><?=gettext("PPTP DNS Servers"); ?></td>
<td width="78%" class="vtable"> <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 /> <br />
<input name="pptp_dns2" type="text" class="form-control unknown" id="pptp_dns2" size="20" value="<?=htmlspecialchars($pconfig['pptp_dns2']);?>" /> <input name="pptp_dns2" type="text" class="form-control unknown" id="pptp_dns2" size="20" value="<?=htmlspecialchars($pconfig['pptp_dns2']);?>" />
<br /> <br />
......
...@@ -170,15 +170,14 @@ include("head.inc"); ...@@ -170,15 +170,14 @@ include("head.inc");
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Username");?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("Username");?></td>
<td width="78%" class="vtable"> <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> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Password");?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("Password");?></td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<?=$mandfldhtml;?><input name="password" type="password" class="form-control pwd" id="password" size="20" /> <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" /> <br /><input name="password2" type="password" class="form-control pwd" id="password2" size="20" />
&nbsp;(<?=gettext("confirmation");?>)<?php if (isset($id) && $a_secret[$id]) : &nbsp;(<?=gettext("confirmation");?>)<?php if (isset($id) && $a_secret[$id]) :
?><br /> ?><br />
<span class="vexpl"><?=gettext("If you want to change the users' password, ". <span class="vexpl"><?=gettext("If you want to change the users' password, ".
......
...@@ -34,6 +34,38 @@ require_once("guiconfig.inc"); ...@@ -34,6 +34,38 @@ require_once("guiconfig.inc");
require_once("functions.inc"); require_once("functions.inc");
require_once("ipsec.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'])) { if (isset($config['ipsec']['phase1'])) {
echo "<div>&nbsp;</div>\n"; echo "<div>&nbsp;</div>\n";
$tab_array = array(); $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