diff options
Diffstat (limited to 'usr')
24 files changed, 273 insertions, 216 deletions
diff --git a/usr/local/www/diag_arp.php b/usr/local/www/diag_arp.php index e202bc0..3aff783 100755 --- a/usr/local/www/diag_arp.php +++ b/usr/local/www/diag_arp.php @@ -205,15 +205,15 @@ if(count($pools) > 0) { // Put this in an easy to use form $dhcpmac = array(); $dhcpip = array(); - + foreach ($leases as $value) { - $dhcpmac[$value['mac']] = $value['hostname']; - $dhcpip[$value['ip']] = $value['hostname']; + $dhcpmac[$value['mac']] = $value['hostname']; + $dhcpip[$value['ip']] = $value['hostname']; } exec("/usr/sbin/arp -an",$rawdata); -$i = 0; +$i = 0; /* if list */ $ifdescrs = get_configured_interface_with_descr(); @@ -225,7 +225,7 @@ foreach ($ifdescrs as $key =>$interface) { $data = array(); foreach ($rawdata as $line) { $elements = explode(' ',$line); - + if ($elements[3] != "(incomplete)") { $arpent = array(); $arpent['ip'] = trim(str_replace(array('(',')'),'',$elements[1])); @@ -238,15 +238,15 @@ foreach ($rawdata as $line) { function getHostName($mac,$ip) { global $dhcpmac, $dhcpip; - + if ($dhcpmac[$mac]) return $dhcpmac[$mac]; else if ($dhcpip[$ip]) return $dhcpip[$ip]; else if(gethostbyaddr($ip) <> "" and gethostbyaddr($ip) <> $ip) return gethostbyaddr($ip); - else - return ""; + else + return ""; } $pgtitle = array(gettext("Diagnostics"),gettext("ARP Table")); @@ -255,7 +255,7 @@ include("head.inc"); ?> <body link="#000000" vlink="#000000" alink="#000000"> - + <?php include("fbegin.inc"); ?> <div id="loading"> @@ -276,7 +276,7 @@ foreach ($data as &$entry) { $dns = trim(getHostName($entry['mac'], $entry['ip'])); if(trim($dns)) $entry['dnsresolve'] = "$dns"; - else + else $entry['dnsresolve'] = "Z_ "; } diff --git a/usr/local/www/diag_authentication.php b/usr/local/www/diag_authentication.php index 079e335..91874d4 100755 --- a/usr/local/www/diag_authentication.php +++ b/usr/local/www/diag_authentication.php @@ -49,16 +49,16 @@ if ($_POST) { $authcfg = auth_get_authserver($_POST['authmode']); if (!$authcfg) - $input_errors[] = "{$_POST['authmode']}" + gettext("is not a valid authentication server "); + $input_errors[] = $_POST['authmode'] . " " . gettext("is not a valid authentication server"); if (empty($_POST['username']) || empty($_POST['password'])) $input_errors[] = gettext("A username and password must be specified."); if (!$input_errors) { if (authenticate_user($_POST['username'], $_POST['password'], $authcfg)) { - $savemsg = gettext("User: ") + {$_POST['username']} + gettext(" authenticated sucessfully."); + $savemsg = gettext("User") . ": " . $_POST['username'] . " " . gettext("authenticated sucessfully."); $groups = getUserGroups($_POST['username'], $authcfg); - $savemsg .= "<br />" + gettext("This user is member of this groups:") + " <br />"; + $savemsg .= "<br />" + gettext("This user is member of this groups") + ": <br />"; foreach ($groups as $group) $savemsg .= "{$group} "; } else { @@ -72,7 +72,7 @@ include("head.inc"); ?> <body link="#000000" vlink="#000000" alink="#000000"> - + <?php include("fbegin.inc"); ?> <?php if ($input_errors) print_input_errors($input_errors);?> <?php if ($savemsg) print_info_box($savemsg);?> diff --git a/usr/local/www/diag_backup.php b/usr/local/www/diag_backup.php index 540eb47..6ce7b8d 100755 --- a/usr/local/www/diag_backup.php +++ b/usr/local/www/diag_backup.php @@ -60,7 +60,7 @@ function add_base_packages_menu_items() { $modified_config = false; foreach($base_packages as $bp) { $basepkg_path = "/usr/local/pkg/{$bp}"; - $tmpinfo = pathinfo($basepkg_path, PATHINFO_EXTENSION); + $tmpinfo = pathinfo($basepkg_path, PATHINFO_EXTENSION); if($tmpinfo['extension'] == "xml" && file_exists($basepkg_path)) { $pkg_config = parse_xml_config_pkg($basepkg_path, "packagegui"); if($pkg_config['menu'] != "") { @@ -80,7 +80,7 @@ function add_base_packages_menu_items() { } } if($modified_config) { - write_confg("Restored base_package menus after configuration restore."); + write_confg(gettext("Restored base_package menus after configuration restore.")); $config = parse_config(true); } } @@ -98,11 +98,11 @@ function check_and_returnif_section_exists($section) { function spit_out_select_items($area, $showall) { global $config; - - $areas = array("aliases" => gettext("Aliases"), + + $areas = array("aliases" => gettext("Aliases"), "captiveportal" => gettext("Captive Portal"), "voucher" => gettext("Captive Portal Vouchers"), - "dnsmasq" => gettext("DNS Forwarder"), + "dnsmasq" => gettext("DNS Forwarder"), "dhcpd" => gettext("DHCP Server"), "filter" => gettext("Firewall Rules"), "interfaces" => gettext("Interfaces"), @@ -111,7 +111,7 @@ function spit_out_select_items($area, $showall) { "ovpn" => gettext("OpenVPN"), "installedpackages" => gettext("Package Manager"), "pptpd" => gettext("PPTP Server"), - "cron" => gettext("Scheduled Tasks"), + "cron" => gettext("Scheduled Tasks"), "syslog" => gettext("Syslog"), "system" => gettext("System"), "staticroutes" => gettext("Static routes"), @@ -128,16 +128,16 @@ function spit_out_select_items($area, $showall) { $select .= " >\n"; $select .= "<option VALUE=\"\">ALL</option>"; - if($showall == true) + if($showall == true) foreach($areas as $area => $areaname) $select .= "<option value='{$area}'>{$areaname}</option>\n"; - else + else foreach($areas as $area => $areaname) if(check_and_returnif_section_exists($area) == true) $select .= "<option value='{$area}'>{$areaname}</option>\n"; $select .= "</select>\n"; - + echo $select; } @@ -153,13 +153,13 @@ if ($_POST['apply']) { if ($_POST) { unset($input_errors); - if (stristr($_POST['Submit'], "Restore configuration")) + if (stristr($_POST['Submit'], gettext("Restore configuration"))) $mode = "restore"; - else if (stristr($_POST['Submit'], "Reinstall")) + else if (stristr($_POST['Submit'], gettext("Reinstall"))) $mode = "reinstallpackages"; - else if (stristr($_POST['Submit'], "Download")) + else if (stristr($_POST['Submit'], gettext("Download"))) $mode = "download"; - else if (stristr($_POST['Submit'], "Restore version")) + else if (stristr($_POST['Submit'], gettext("Restore version"))) $mode = "restore_ver"; if ($_POST["nopackages"] <> "") @@ -199,7 +199,7 @@ if ($_POST) { $sfn = "{$g['tmp_path']}/config.xml.nopkg"; file_put_contents($sfn, $data); exec("sed '/<installedpackages>/,/<\/installedpackages>/d' {$sfn} > {$sfn}-new"); - $data = file_get_contents($sfn . "-new"); + $data = file_get_contents($sfn . "-new"); } else { if(!$_POST['backuparea']) { /* backup entire configuration */ @@ -218,7 +218,7 @@ if ($_POST) { tagfile_reformat($data, $data, "config.xml"); } - /* + /* * Backup RRD Data */ if(!$_POST['donotbackuprrd']) { @@ -238,7 +238,7 @@ if ($_POST) { $data .= "\t</rrddata>\n"; $data .= "</pfsense>\n"; } - + $size = strlen($data); header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment; filename={$name}"); @@ -272,7 +272,7 @@ if ($_POST) { /* read the file contents */ $data = file_get_contents($_FILES['conffile']['tmp_name']); if(!$data) { - log_error(gettext("Warning, could not read file ") . $_FILES['conffile']['tmp_name']); + log_error(gettext("Warning, could not read file") . " " . $_FILES['conffile']['tmp_name']); return 1; } @@ -301,7 +301,7 @@ if ($_POST) { } } else { if(!stristr($data, "<" . $g['xml_rootobj'] . ">")) { - $input_errors[] = gettext("You have selected to restore the full configuration but we could not locate a ") . $g['xml_rootobj'] . gettext(" tag."); + $input_errors[] = gettext("You have selected to restore the full configuration but we could not locate a") . " " . $g['xml_rootobj'] . " " . gettext("tag."); } else { /* restore the entire configuration */ file_put_contents($_FILES['conffile']['tmp_name'], $data); @@ -370,7 +370,7 @@ if ($_POST) { } unlink_if_exists("{$g['tmp_path']}/config.cache"); // Reset configuration version to something low - // in order to force the config upgrade code to + // in order to force the config upgrade code to // run through with all steps that are required. $config['system']['version'] = "1.0"; // Deal with descriptions longer than 63 characters @@ -432,7 +432,7 @@ if ($_POST) { } $config['diag']['ipv6nat'] = true; write_config(); - add_base_packages_menu_items(); + add_base_packages_menu_items(); convert_config(); conf_mount_ro(); $savemsg = gettext("The m0n0wall configuration has been restored and upgraded to pfSense."); @@ -527,7 +527,7 @@ function backuparea_change(obj) { <?php if (is_subsystem_dirty('restore')): ?><p> <form action="reboot.php" method="post"> <input name="Submit" type="hidden" value=" Yes "> -<?php print_info_box(gettext("The firewall configuration has been changed.<br/>The firewall is now rebooting."));?><br> +<?php print_info_box(gettext("The firewall configuration has been changed.") . "<br/>" . gettext("The firewall is now rebooting."));?><br> </form> <?php endif; ?> <form action="diag_backup.php" method="post" name="iform" enctype="multipart/form-data"> diff --git a/usr/local/www/diag_confbak.php b/usr/local/www/diag_confbak.php index 5d0458b..393f771 100755 --- a/usr/local/www/diag_confbak.php +++ b/usr/local/www/diag_confbak.php @@ -28,7 +28,7 @@ POSSIBILITY OF SUCH DAMAGE. */ -/* +/* pfSense_MODULE: config */ @@ -45,9 +45,10 @@ if($_GET['newver'] != "") { conf_mount_rw(); $confvers = unserialize(file_get_contents($g['cf_conf_path'] . '/backup/backup.cache')); if(config_restore($g['conf_path'] . '/backup/config-' . $_GET['newver'] . '.xml') == 0) - $savemsg = "Successfully reverted to timestamp " . date("n/j/y H:i:s", $_GET['newver']) . " with description \"" . $confvers[$_GET['newver']]['description'] . "\"."; + + $savemsg = sprintf(gettext("Successfully reverted to timestamp %s with description \"%s\"."), date(gettext("n/j/y H:i:s"), $_GET['newver']), $confvers[$_GET['newver']]['description']); else - $savemsg = "Unable to revert to the selected configuration."; + $savemsg = gettext("Unable to revert to the selected configuration."); conf_mount_ro(); } @@ -55,7 +56,7 @@ if($_GET['rmver'] != "") { conf_mount_rw(); $confvers = unserialize(file_get_contents($g['cf_conf_path'] . '/backup/backup.cache')); unlink_if_exists($g['conf_path'] . '/backup/config-' . $_GET['rmver'] . '.xml'); - $savemsg = "Deleted backup with timestamp " . date("n/j/y H:i:s", $_GET['rmver']) . " and description \"" . $confvers[$_GET['rmver']]['description'] . "\"."; + $savemsg = sprintf(gettext("Deleted backup with timestamp %s and description \"%s\"."), date(gettext("n/j/y H:i:s"), $_GET['rmver']),$confvers[$_GET['rmver']]['description']); conf_mount_ro(); } @@ -94,7 +95,7 @@ cleanup_backupcache(); $confvers = get_backups(); unset($confvers['versions']); -$pgtitle = array("Diagnostics","Configuration History"); +$pgtitle = array(gettext("Diagnostics"),gettext("Configuration History")); include("head.inc"); ?> @@ -107,7 +108,7 @@ include("head.inc"); ?> <? if ($diff) { ?> <table align="center" valign="middle" width="100%" border="0" cellspacing="0" style="padding-top: 4px; padding-bottom: 4px;"> - <tr><td>Configuration diff from <?php echo date("n/j/y H:i:s", $oldtime); ?> to <?php echo date("n/j/y H:i:s", $newtime); ?></td></tr> + <tr><td><?=gettext("Configuration diff from");?> <?php echo date(gettext("n/j/y H:i:s"), $oldtime); ?> <?=gettext("to");?> <?php echo date(gettext("n/j/y H:i:s"), $newtime); ?></td></tr> <?php foreach ($diff as $line) { switch (substr($line, 0, 1)) { case "+": @@ -135,10 +136,10 @@ include("head.inc"); <td> <?php $tab_array = array(); - $tab_array[0] = array("Config History", true, "diag_confbak.php"); - $tab_array[1] = array("Backup/Restore", false, "diag_backup.php"); + $tab_array[0] = array(gettext("Config History"), true, "diag_confbak.php"); + $tab_array[1] = array(gettext("Backup/Restore"), false, "diag_backup.php"); display_top_tabs($tab_array); - ?> + ?> </td> </tr> <tr> @@ -149,25 +150,25 @@ include("head.inc"); <?php if (is_array($confvers)): ?> <tr> <td colspan="2" valign="middle" align="center" class="list" nowrap><input type="submit" name="diff" value="Diff"></td> - <td width="30%" class="listhdrr">Date</td> - <td width="70%" class="listhdrr">Configuration Change</td> + <td width="30%" class="listhdrr"><?=gettext("Date");?></td> + <td width="70%" class="listhdrr"><?=gettext("Configuration Change");?></td> </tr> <tr valign="top"> <td valign="middle" class="list" nowrap></td> <td class="list"> <input type="radio" name="newtime" value="current"> </td> - <td class="listlr"> <?= date("n/j/y H:i:s", $config['revision']['time']) ?></td> + <td class="listlr"> <?= date(gettext("n/j/y H:i:s"), $config['revision']['time']) ?></td> <td class="listr"> <?= $config['revision']['description'] ?></td> - <td colspan="3" valign="middle" class="list" nowrap><b>Current</b></td> + <td colspan="3" valign="middle" class="list" nowrap><b><?=gettext("Current");?></b></td> </tr> <?php $c = 0; foreach($confvers as $version): if($version['time'] != 0) - $date = date("n/j/y H:i:s", $version['time']); + $date = date(gettext("n/j/y H:i:s"), $version['time']); else - $date = "Unknown"; + $date = gettext("Unknown"); $desc = $version['description']; ?> <tr valign="top"> @@ -179,24 +180,24 @@ include("head.inc"); <input type="radio" name="newtime" value="<?php echo $version['time'];?>"> <? } else { ?> - <? } + <? } $c++; ?> </td> <td class="listlr"> <?= $date ?></td> <td class="listr"> <?= $desc ?></td> <td valign="middle" class="list" nowrap> - <a href="diag_confbak.php?newver=<?=$version['time'];?>" onclick="return confirm('Revert to this configuration?')"> - <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="Revert to this configuration" title="Revert to this configuration"> + <a href="diag_confbak.php?newver=<?=$version['time'];?>" onclick="return confirm('<?=gettext("Revert to this configuration?");?>'")> + <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="<?=gettext("Revert to this configuration");?>" title="<?=gettext("Revert to this configuration");?>"> </a> </td> <td valign="middle" class="list" nowrap> - <a href="diag_confbak.php?rmver=<?=$version['time'];?>" onclick="return confirm('Delete this configuration backup?')"> - <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="Remove this backup" title="Remove this backup"> + <a href="diag_confbak.php?rmver=<?=$version['time'];?>" onclick="return confirm('<?=gettext("Delete this configuration backup?");?>')"> + <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="<?=gettext("Remove this backup");?>" title="<?=gettext("Remove this backup");?>"> </a> </td> <td valign="middle" class="list" nowrap> <a href="diag_confbak.php?getcfg=<?=$version['time'];?>"> - <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_down.gif" width="17" height="17" border="0" alt="Download this backup" title="Download this backup"> + <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_down.gif" width="17" height="17" border="0" alt="<?=gettext("Download this backup");?>" title="<?=gettext("Download this backup");?>"> </a> </td> </tr> @@ -208,7 +209,7 @@ include("head.inc"); <?php else: ?> <tr> <td> - <?php print_info_box("No backups found."); ?> + <?php print_info_box(gettext("No backups found.")); ?> </td> </tr> <?php endif; ?> diff --git a/usr/local/www/diag_defaults.php b/usr/local/www/diag_defaults.php index c462abd..cde9d54 100755 --- a/usr/local/www/diag_defaults.php +++ b/usr/local/www/diag_defaults.php @@ -48,14 +48,14 @@ if ($_POST) { if ($_POST['Submit'] != " No ") { reset_factory_defaults(); system_reboot(); - $rebootmsg = "The system has been reset to factory defaults and is now rebooting. This may take one minute."; + $rebootmsg = gettext("The system has been reset to factory defaults and is now rebooting. This may take one minute."); } else { header("Location: index.php"); exit; } } -$pgtitle = array("Diagnostics","Factory defaults"); +$pgtitle = array(gettext("Diagnostics"),gettext("Factory defaults")); include("head.inc"); ?> @@ -64,21 +64,22 @@ include("head.inc"); <?php include("fbegin.inc"); ?> <?php if ($rebootmsg): echo print_info_box($rebootmsg); else: ?> <form action="diag_defaults.php" method="post"> - <p><strong>If you click "Yes", the firewall will: - + <p><strong> <?=gettext("If you click") . " "" . gettext("Yes") . "", " . gettext("the firewall will")?>: + <ul> - <li>Reset to factory defaults</li> - <li>LAN IP address will be reset to 192.168.1.1</li> - <li>System will be configured as a DHCP server on the default LAN interface</li> - <li>Reboot after changes are installed</li> - <li>WAN interface will be set to obtain an address automatically from a DHCP server</li> - <li>webConfigurator admin username will be reset to 'admin'</li> - <li>webConfigurator admin password will be reset to '<?=$g['product_name']?>'</li> + <li><?=gettext("Reset to factory defaults");?></li> + <li><?=gettext("LAN IP address will be reset to 192.168.1.1");?></li> + <li><?=gettext("System will be configured as a DHCP server on the default LAN interface");?></li> + <li><?=gettext("Reboot after changes are installed");?></li> + <li><?=gettext("WAN interface will be set to obtain an address automatically from a DHCP server");?></li> + <li><?=gettext("webConfigurator admin username will be reset to 'admin'");?></li> + <li><?=gettext("webConfigurator admin password will be reset to");?> '<?=$g['product_name']?>'</li> + </ul> - Are you sure you want to proceed?</strong></p> + <?=gettext("Are you sure you want to proceed?");?></strong></p> <p> - <input name="Submit" type="submit" class="formbtn" value=" Yes "> - <input name="Submit" type="submit" class="formbtn" value=" No "> + <input name="Submit" type="submit" class="formbtn" value=" <?=gettext("Yes");?> "> + <input name="Submit" type="submit" class="formbtn" value=" <?=gettext("No");?> "> </p> </form> <?php endif; ?> diff --git a/usr/local/www/diag_dns.php b/usr/local/www/diag_dns.php index abdeea3..a82628d 100644 --- a/usr/local/www/diag_dns.php +++ b/usr/local/www/diag_dns.php @@ -49,7 +49,7 @@ if ($_POST) { $host_esc = escapeshellarg(trim($_POST['host'])); if (!is_hostname($host) && !is_ipaddr($host)) - $input_errors[] = "Host must be a valid hostname or IP address."; + $input_errors[] = gettext("Host must be a valid hostname or IP address."); // Test resolution speed of each DNS server. if ((is_hostname($host) || is_ipaddr($host))) { @@ -59,7 +59,7 @@ if ($_POST) { $dns_server = $pconfig['dns' . $dnscounter]; $query_time = `dig {$host_esc} @{$dns_server} | grep Query | cut -d':' -f2`; if($query_time == "") - $query_time = "No response"; + $query_time = gettext("No response"); $new_qt = array(); $new_qt['dns_server'] = $dns_server; $new_qt['query_time'] = $query_time; @@ -68,7 +68,7 @@ if ($_POST) { } } - $type = "unknown"; + $type = gettext("unknown"); $resolved = ""; $ipaddr = ""; $hostname = ""; @@ -88,7 +88,7 @@ if ($_POST) { } if ($host == $resolved) { - $resolved = "No record found"; + $resolved = gettext("No record found"); } } } @@ -103,10 +103,10 @@ include("head.inc"); ?> <form action="diag_dns.php" method="post" name="iform" id="iform"> <table width="100%" border="0" cellpadding="6" cellspacing="0"> <tr> - <td colspan="2" valign="top" class="listtopic">Resolve DNS hostname or IP</td> + <td colspan="2" valign="top" class="listtopic"> <?=gettext("Resolve DNS hostname or IP");?></td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Hostname or IP</td> + <td width="22%" valign="top" class="vncellreq">gettext("Hostname or IP");?></td> <td width="78%" class="vtable"> <?=$mandfldhtml;?><input name="host" type="text" class="formfld" id="host" size="20" value="<?=htmlspecialchars($host);?>"> <? if ($resolved && $type) { ?> @@ -116,15 +116,15 @@ include("head.inc"); ?> </tr> <?php if($_POST): ?> <tr> - <td width="22%" valign="top" class="vncell">Resolution time per server</td> + <td width="22%" valign="top" class="vncell"><?=gettext("Resolution time per server");?></td> <td width="78%" class="vtable"> <table width="170" border="1" cellpadding="2" style="border-width: 1px 1px 1px 1px; border-collapse: collapse;"> <tr> <td> - <b>Server</b> + <b><?=gettext("Server");?></b> </td> <td> - <b>Query time</b> + <b><?=gettext("Query time");></b> </td> </tr> <?php @@ -148,14 +148,14 @@ include("head.inc"); ?> <?php endif; ?> <?php if (!$input_errors && $ipaddr) { ?> <tr> - <td width="22%" valign="top" class="vncell">More Information:</td> + <td width="22%" valign="top" class="vncell"><?=gettext("More Information:");?></td> <td width="78%" class="vtable"> - <a target="_new" href ="/diag_ping.php?host=<?=$host?>&interface=wan&count=3">Ping</a> <br/> - <a target="_new" href ="/diag_traceroute.php?host=<?=$host?>&ttl=18">Traceroute</a> + <a target="_new" href ="/diag_ping.php?host=<?=$host?>&interface=wan&count=3"><?=gettext("Ping");?></a> <br/> + <a target="_new" href ="/diag_traceroute.php?host=<?=$host?>&ttl=18"><?=gettext("Traceroute");?></a> <p/> - NOTE: The following links are to external services, so their reliability cannot be guaranteed.<br/><br/> - <a target="_new" href="http://private.dnsstuff.com/tools/whois.ch?ip=<?php echo $ipaddr; ?>">IP WHOIS @ DNS Stuff</a><br /> - <a target="_new" href="http://private.dnsstuff.com/tools/ipall.ch?ip=<?php echo $ipaddr; ?>">IP Info @ DNS Stuff</a> + <?=gettext("NOTE: The following links are to external services, so their reliability cannot be guaranteed.");?><br/><br/> + <a target="_new" href="http://private.dnsstuff.com/tools/whois.ch?ip=<?php echo $ipaddr; ?>"><?=gettext("IP WHOIS @ DNS Stuff");?></a><br /> + <a target="_new" href="http://private.dnsstuff.com/tools/ipall.ch?ip=<?php echo $ipaddr; ?>"><?=gettext("IP Info @ DNS Stuff");?></a> </td> </tr> <?php } ?> @@ -163,7 +163,7 @@ include("head.inc"); ?> <td width="22%" valign="top"> </td> <td width="78%"> <br/> - <input name="Submit" type="submit" class="formbtn" value="DNS Lookup"> + <input name="Submit" type="submit" class="formbtn" value="<?=gettext("DNS Lookup");?>"> </td> </tr> </table> diff --git a/usr/local/www/diag_dump_states.php b/usr/local/www/diag_dump_states.php index c3818f6..f0b9ba5 100755 --- a/usr/local/www/diag_dump_states.php +++ b/usr/local/www/diag_dump_states.php @@ -50,7 +50,7 @@ if($_GET['action']) { $retval = mwexec("/sbin/pfctl -k '{$srcip}' -k '{$dstip}'"); echo htmlentities("|{$srcip}|{$dstip}|{$retval}|"); } else { - echo "invalid input"; + echo gettext("invalid input"); } exit; } @@ -132,7 +132,7 @@ include("head.inc"); <form action="<?=$_SERVER['SCRIPT_NAME'];?>" method="get"> <table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> - <td>Current state count: <?=$current_statecount?></td> + <td><?=gettext("Current state count");?>: <?=$current_statecount?></td> <td style="font-weight:bold;" align="right"> <?=gettext("Filter expression:");?> <input type="text" name="filter" class="formfld search" value="<?=$_GET['filter'];?>" size="30" /> @@ -172,26 +172,26 @@ if(count($states) > 0) { $parts = split(":", $ends[count($ends) - 1]); $dstip = trim($parts[0]); - echo "<tr valign='top' name='r:{$srcip}:{$dstip}'> + echo "<tr valign='top' name='r:{$srcip}:{$dstip}'>" <td class='listlr'>{$proto}</td> <td class='listr'>{$info}</td> <td class='listr'>{$state}</td> <td class='list'> <img src='/themes/{$g['theme']}/images/icons/icon_x.gif' height='17' width='17' border='0' - onclick=\"removeState('{$srcip}', '{$dstip}');\" style='cursor:pointer;' + onclick="removeState('{$srcip}', '{$dstip}');" style='cursor:pointer;' name='i:{$srcip}:{$dstip}' title='" . gettext("Remove all state entries from") . " {$srcip} " . gettext("to") . " {$dstip}' alt='' /> </td> - </tr>"; + </tr>; $row++; } } else { - echo "<tr> + echo "<tr>" <td class='list' colspan='4' align='center' valign='top'> " . gettext("No states were found.") . " </td> - </tr>"; + </tr>; } ?> </table> diff --git a/usr/local/www/diag_ipsec.php b/usr/local/www/diag_ipsec.php index a77d261..99b9864 100644 --- a/usr/local/www/diag_ipsec.php +++ b/usr/local/www/diag_ipsec.php @@ -45,7 +45,7 @@ global $g; -$pgtitle = array("Status","IPsec"); +$pgtitle = array(gettext("Status"),gettext("IPsec")); require("guiconfig.inc"); include("head.inc"); @@ -69,10 +69,10 @@ $sad = ipsec_dump_sad(); <td> <?php $tab_array = array(); - $tab_array[0] = array("Overview", true, "diag_ipsec.php"); - $tab_array[1] = array("SAD", false, "diag_ipsec_sad.php"); - $tab_array[2] = array("SPD", false, "diag_ipsec_spd.php"); - $tab_array[3] = array("Logs", false, "diag_logs_ipsec.php"); + $tab_array[0] = array(gettext("Overview"), true, "diag_ipsec.php"); + $tab_array[1] = array(gettext("SAD"), false, "diag_ipsec_sad.php"); + $tab_array[2] = array(gettext("SPD"), false, "diag_ipsec_spd.php"); + $tab_array[3] = array(gettext("Logs"), false, "diag_logs_ipsec.php"); display_top_tabs($tab_array); ?> </td> @@ -82,12 +82,12 @@ $sad = ipsec_dump_sad(); <div id="mainarea"> <table width="100%" border="0" cellpadding="6" cellspacing="0" class="tabcont sortable"> <tr> - <td nowrap class="listhdrr">Local IP</td> - <td nowrap class="listhdrr">Remote IP</a></td> - <td nowrap class="listhdrr">Local Network</td> - <td nowrap class="listhdrr">Remote Network</a></td> - <td nowrap class="listhdrr">Description</a></td> - <td nowrap class="listhdrr">Status</td> + <td nowrap class="listhdrr"><?=gettext("Local IP");?></td> + <td nowrap class="listhdrr"><?=gettext("Remote IP");?></a></td> + <td nowrap class="listhdrr"><?=gettext("Local Network");?></td> + <td nowrap class="listhdrr"><?=gettext("Remote Network");?></a></td> + <td nowrap class="listhdrr"><?=gettext("Description");?></a></td> + <td nowrap class="listhdrr"><?=gettext("Status");?></td> </tr> <?php foreach ($a_phase2 as $ph2ent) { @@ -132,9 +132,9 @@ $sad = ipsec_dump_sad(); <span class="vexpl"> <span class="red"> - <strong>Note:<br /></strong> + <strong><?=gettext("Note");?>:<br /></strong> </span> - You can configure your IPsec + <?=gettext("You can configure your IPsec");?> <a href="vpn_ipsec.php">here</a>. </span> diff --git a/usr/local/www/diag_ipsec_sad.php b/usr/local/www/diag_ipsec_sad.php index 75ec782..3af1e69 100755 --- a/usr/local/www/diag_ipsec_sad.php +++ b/usr/local/www/diag_ipsec_sad.php @@ -46,7 +46,7 @@ require("guiconfig.inc"); require("ipsec.inc"); -$pgtitle = array("Status","IPsec","SAD"); +$pgtitle = array(gettext("Status"),gettext("IPsec"),gettext("SAD")); include("head.inc"); $sad = ipsec_dump_sad(); @@ -70,10 +70,10 @@ if ($_GET['act'] == "del") { <td> <?php $tab_array = array(); - $tab_array[0] = array("Overview", false, "diag_ipsec.php"); - $tab_array[1] = array("SAD", true, "diag_ipsec_sad.php"); - $tab_array[2] = array("SPD", false, "diag_ipsec_spd.php"); - $tab_array[3] = array("Logs", false, "diag_logs_ipsec.php"); + $tab_array[0] = array(gettext("Overview"), false, "diag_ipsec.php"); + $tab_array[1] = array(gettext("SAD"), true, "diag_ipsec_sad.php"); + $tab_array[2] = array(gettext("SPD"), false, "diag_ipsec_spd.php"); + $tab_array[3] = array(gettext("Logs"), false, "diag_logs_ipsec.php"); display_top_tabs($tab_array); ?> </td> @@ -84,12 +84,12 @@ if ($_GET['act'] == "del") { <table class="tabcont sortable" width="100%" border="0" cellpadding="6" cellspacing="0"> <?php if (count($sad)): ?> <tr> - <td nowrap class="listhdrr">Source</td> - <td nowrap class="listhdrr">Destination</a></td> - <td nowrap class="listhdrr">Protocol</td> - <td nowrap class="listhdrr">SPI</td> - <td nowrap class="listhdrr">Enc. alg.</td> - <td nowrap class="listhdr">Auth. alg.</td> + <td nowrap class="listhdrr"><?=gettext("Source");?></td> + <td nowrap class="listhdrr"><?=gettext("Destination");?></a></td> + <td nowrap class="listhdrr"><?=gettext("Protocol");?></td> + <td nowrap class="listhdrr"><?=gettext("SPI");?></td> + <td nowrap class="listhdrr"><?=gettext("Enc. alg.");?></td> + <td nowrap class="listhdr"><?=gettext("Auth. alg.");?></td> <td nowrap class="list"></td> </tr> <?php foreach ($sad as $sa): ?> @@ -116,7 +116,7 @@ if ($_GET['act'] == "del") { <?php else: ?> <tr> <td> - <p><strong>No IPsec security associations.</strong></p> + <p><strong><?=gettext("No IPsec security associations.");?></strong></p> </td> </tr> <?php endif; ?> @@ -129,8 +129,8 @@ if ($_GET['act'] == "del") { <p/> <span class="vexpl"> -<span class="red"><strong>Note:<br></strong></span> -You can configure your IPsec <a href="vpn_ipsec.php">here</a>. +<span class="red"><strong><?=gettext("Note");?>:<br></strong></span> +<?=gettext("You can configure your IPsec");?> <a href="vpn_ipsec.php">here</a>. </span> <?php include("fend.inc"); ?> diff --git a/usr/local/www/diag_logs_filter_summary.php b/usr/local/www/diag_logs_filter_summary.php index ba5751a..1171b89 100644 --- a/usr/local/www/diag_logs_filter_summary.php +++ b/usr/local/www/diag_logs_filter_summary.php @@ -121,7 +121,7 @@ function pie_block($summary, $stat, $num) { print " [\n"; for ($i=0; $i < $num; $i++) { if ($k[$i]) { - print " { ".gettext("data").": d{$stat}{$i}, ".gettext("label").": \"{$k[$i]}\"}"; + print " { data: d{$stat}{$i}, label: \"{$k[$i]}\"}"; if (!(($i == ($numentries - 1)) && ($leftover <= 0))) print ",\n"; else @@ -129,11 +129,11 @@ function pie_block($summary, $stat, $num) { } } if ($leftover > 0) - print " { ".gettext("data").": d{$stat}{$i}, ".gettext("label").": \"Other\"}\n"; + print " { data: d{$stat}{$i}, label: \"Other\"}\n"; print " ],\n"; print " {\n"; - print " ".gettext("pies").": {show: true, autoScale: true},\n"; - print " ".gettext("legend").": {show: true, labelFormatter: lblfmt}\n"; + print " pies: {show: true, autoScale: true},\n"; + print " legend: {show: true, labelFormatter: lblfmt}\n"; print " });\n"; print "});\n"; @@ -181,17 +181,17 @@ include("head.inc"); ?> <tr><td> <?php $tab_array = array(); - $tab_array[] = array(gettext("System"), false, gettext("diag_logs.php")); - $tab_array[] = array(gettext("Firewall"), true, gettext("diag_logs_filter.php")); - $tab_array[] = array(gettext("DHCP"), false, gettext("diag_logs_dhcp.php")); - $tab_array[] = array(gettext("Portal Auth"), false, gettext("diag_logs_auth.php")); - $tab_array[] = array(gettext("IPsec"), false, gettext("diag_logs_ipsec.php")); - $tab_array[] = array(gettext("PPP"), false, gettext("diag_logs_ppp.php")); - $tab_array[] = array(gettext("VPN"), false, gettext("diag_logs_vpn.php")); - $tab_array[] = array(gettext("Load Balancer"), false, gettext("diag_logs_relayd.php")); - $tab_array[] = array(gettext("OpenVPN"), false, gettext("diag_logs_openvpn.php")); - $tab_array[] = array(gettext("OpenNTPD"), false, gettext("diag_logs_ntpd.php")); - $tab_array[] = array(gettext("Settings"), false, gettext("diag_logs_settings.php")); + $tab_array[] = array(gettext("System"), false, "diag_logs.php"); + $tab_array[] = array(gettext("Firewall"), true, "diag_logs_filter.php"); + $tab_array[] = array(gettext("DHCP"), false, "diag_logs_dhcp.php"); + $tab_array[] = array(gettext("Portal Auth"), false, "diag_logs_auth.php"); + $tab_array[] = array(gettext("IPsec"), false, "diag_logs_ipsec.php"); + $tab_array[] = array(gettext("PPP"), false, "diag_logs_ppp.php"); + $tab_array[] = array(gettext("VPN"), false, "diag_logs_vpn.php"); + $tab_array[] = array(gettext("Load Balancer"), false, "diag_logs_relayd.php"); + $tab_array[] = array(gettext("OpenVPN"), false, "diag_logs_openvpn.php"); + $tab_array[] = array(gettext("OpenNTPD"), false, "diag_logs_ntpd.php"); + $tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php"); display_top_tabs($tab_array); ?> </td></tr> diff --git a/usr/local/www/diag_logs_ipsec.php b/usr/local/www/diag_logs_ipsec.php index bb1cc80..9de5494 100755 --- a/usr/local/www/diag_logs_ipsec.php +++ b/usr/local/www/diag_logs_ipsec.php @@ -84,17 +84,17 @@ include("head.inc"); <td> <?php $tab_array = array(); - $tab_array[] = array(gettext("System"), false, gettext("diag_logs.php")); - $tab_array[] = array(gettext("Firewall"), false, gettext("diag_logs_filter.php")); - $tab_array[] = array(gettext("DHCP"), false, gettext("diag_logs_dhcp.php")); - $tab_array[] = array(gettext("Portal Auth"), false, gettext("diag_logs_auth.php")); - $tab_array[] = array(gettext("IPsec"), true, gettext("diag_logs_ipsec.php")); - $tab_array[] = array(gettext("PPP"), false, gettext("diag_logs_ppp.php")); - $tab_array[] = array(gettext("VPN"), false, gettext("diag_logs_vpn.php")); - $tab_array[] = array(gettext("Load Balancer"), false, gettext("diag_logs_relayd.php")); - $tab_array[] = array(gettext("OpenVPN"), false, gettext("diag_logs_openvpn.php")); - $tab_array[] = array(gettext("OpenNTPD"), false, gettext("diag_logs_ntpd.php")); - $tab_array[] = array(gettext("Settings"), false, gettext("diag_logs_settings.php")); + $tab_array[] = array(gettext("System"), false, "diag_logs.php"); + $tab_array[] = array(gettext("Firewall"), false, "diag_logs_filter.php"); + $tab_array[] = array(gettext("DHCP"), false, "diag_logs_dhcp.php"); + $tab_array[] = array(gettext("Portal Auth"), false, "diag_logs_auth.php"); + $tab_array[] = array(gettext("IPsec"), true, "diag_logs_ipsec.php"); + $tab_array[] = array(gettext("PPP"), false, "diag_logs_ppp.php"); + $tab_array[] = array(gettext("VPN"), false, "diag_logs_vpn.php"); + $tab_array[] = array(gettext("Load Balancer"), false, "diag_logs_relayd.php"); + $tab_array[] = array(gettext("OpenVPN"), false, "diag_logs_openvpn.php"); + $tab_array[] = array(gettext("OpenNTPD"), false, "diag_logs_ntpd.php"); + $tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php"); display_top_tabs($tab_array); ?> </td> diff --git a/usr/local/www/diag_logs_ntpd.php b/usr/local/www/diag_logs_ntpd.php index a07c54e..588c0e2 100644 --- a/usr/local/www/diag_logs_ntpd.php +++ b/usr/local/www/diag_logs_ntpd.php @@ -62,17 +62,17 @@ include("head.inc"); <tr><td> <?php $tab_array = array(); - $tab_array[] = array(gettext("System"), false, gettext("diag_logs.php")); - $tab_array[] = array(gettext("Firewall"), false, gettext("diag_logs_filter.php")); - $tab_array[] = array(gettext("DHCP"), false, gettext("diag_logs_dhcp.php")); - $tab_array[] = array(gettext("Portal Auth"), false, gettext("diag_logs_auth.php")); - $tab_array[] = array(gettext("IPsec"), false, gettext("diag_logs_ipsec.php")); - $tab_array[] = array(gettext("PPP"), false, gettext("diag_logs_ppp.php")); - $tab_array[] = array(gettext("VPN"), false, gettext("diag_logs_vpn.php")); - $tab_array[] = array(gettext("Load Balancer"), false, gettext("diag_logs_relayd.php")); - $tab_array[] = array(gettext("OpenVPN"), false, gettext("diag_logs_openvpn.php")); - $tab_array[] = array(gettext("OpenNTPD"), true, gettext("diag_logs_ntpd.php")); - $tab_array[] = array(gettext("Settings"), false, gettext("diag_logs_settings.php")); + $tab_array[] = array(gettext("System"), false, "diag_logs.php"); + $tab_array[] = array(gettext("Firewall"), false, "diag_logs_filter.php"); + $tab_array[] = array(gettext("DHCP"), false, "diag_logs_dhcp.php"); + $tab_array[] = array(gettext("Portal Auth"), false, "diag_logs_auth.php"); + $tab_array[] = array(gettext("IPsec"), false, "diag_logs_ipsec.php"); + $tab_array[] = array(gettext("PPP"), false, "diag_logs_ppp.php"); + $tab_array[] = array(gettext("VPN"), false, "diag_logs_vpn.php"); + $tab_array[] = array(gettext("Load Balancer"), false, "diag_logs_relayd.php"); + $tab_array[] = array(gettext("OpenVPN"), false, "diag_logs_openvpn.php"); + $tab_array[] = array(gettext("OpenNTPD"), true, "diag_logs_ntpd.php"); + $tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php"); display_top_tabs($tab_array); ?> </td></tr> diff --git a/usr/local/www/diag_logs_openvpn.php b/usr/local/www/diag_logs_openvpn.php index 18c48df..f052ad9 100644 --- a/usr/local/www/diag_logs_openvpn.php +++ b/usr/local/www/diag_logs_openvpn.php @@ -66,17 +66,17 @@ include("head.inc"); <td> <?php $tab_array = array(); - $tab_array[] = array(gettext("System"), false, gettext("diag_logs.php")); - $tab_array[] = array(gettext("Firewall"), false, gettext("diag_logs_filter.php")); - $tab_array[] = array(gettext("DHCP"), false, gettext("diag_logs_dhcp.php")); - $tab_array[] = array(gettext("Portal Auth"), false, gettext("diag_logs_auth.php")); - $tab_array[] = array(gettext("IPsec"), false, gettext("diag_logs_ipsec.php")); - $tab_array[] = array(gettext("PPP"), false, gettext("diag_logs_ppp.php")); - $tab_array[] = array(gettext("VPN"), false, gettext("diag_logs_vpn.php")); - $tab_array[] = array(gettext("Load Balancer"), false, gettext("diag_logs_relayd.php")); - $tab_array[] = array(gettext("OpenVPN"), true, gettext("diag_logs_openvpn.php")); - $tab_array[] = array(gettext("OpenNTPD"), false, gettext("diag_logs_ntpd.php")); - $tab_array[] = array(gettext("Settings"), false, gettext("diag_logs_settings.php")); + $tab_array[] = array(gettext("System"), false, "diag_logs.php"); + $tab_array[] = array(gettext("Firewall"), false, "diag_logs_filter.php"); + $tab_array[] = array(gettext("DHCP"), false, "diag_logs_dhcp.php"); + $tab_array[] = array(gettext("Portal Auth"), false, "diag_logs_auth.php"); + $tab_array[] = array(gettext("IPsec"), false, "diag_logs_ipsec.php"); + $tab_array[] = array(gettext("PPP"), false, "diag_logs_ppp.php"); + $tab_array[] = array(gettext("VPN"), false, "diag_logs_vpn.php"); + $tab_array[] = array(gettext("Load Balancer"), false, "diag_logs_relayd.php"); + $tab_array[] = array(gettext("OpenVPN"), true, "diag_logs_openvpn.php"); + $tab_array[] = array(gettext("OpenNTPD"), false, "diag_logs_ntpd.php"); + $tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php"); display_top_tabs($tab_array); ?> </td> diff --git a/usr/local/www/diag_logs_ppp.php b/usr/local/www/diag_logs_ppp.php index e38d096..52eb40b 100755 --- a/usr/local/www/diag_logs_ppp.php +++ b/usr/local/www/diag_logs_ppp.php @@ -67,17 +67,17 @@ include("head.inc"); <td> <?php $tab_array = array(); - $tab_array[] = array(gettext("System"), false, gettext("diag_logs.php")); - $tab_array[] = array(gettext("Firewall"), false, gettext("diag_logs_filter.php")); - $tab_array[] = array(gettext("DHCP"), false, gettext("diag_logs_dhcp.php")); - $tab_array[] = array(gettext("Portal Auth"), false, gettext("diag_logs_auth.php")); - $tab_array[] = array(gettext("IPsec"), false, gettext("diag_logs_ipsec.php")); - $tab_array[] = array(gettext("PPP"), true, gettext("diag_logs_ppp.php")); - $tab_array[] = array(gettext("VPN"), false, gettext("diag_logs_vpn.php")); - $tab_array[] = array(gettext("Load Balancer"), false, gettext("diag_logs_relayd.php")); - $tab_array[] = array(gettext("OpenVPN"), false, gettext("diag_logs_openvpn.php")); - $tab_array[] = array(gettext("OpenNTPD"), false, gettext("diag_logs_ntpd.php")); - $tab_array[] = array(gettext("Settings"), false, gettext("diag_logs_settings.php")); + $tab_array[] = array(gettext("System"), false, "diag_logs.php"); + $tab_array[] = array(gettext("Firewall"), false, "diag_logs_filter.php"); + $tab_array[] = array(gettext("DHCP"), false, "diag_logs_dhcp.php"); + $tab_array[] = array(gettext("Portal Auth"), false, "diag_logs_auth.php"); + $tab_array[] = array(gettext("IPsec"), false, "diag_logs_ipsec.php"); + $tab_array[] = array(gettext("PPP"), true, "diag_logs_ppp.php"); + $tab_array[] = array(gettext("VPN"), false, "diag_logs_vpn.php"); + $tab_array[] = array(gettext("Load Balancer"), false, "diag_logs_relayd.php"); + $tab_array[] = array(gettext("OpenVPN"), false, "diag_logs_openvpn.php"); + $tab_array[] = array(gettext("OpenNTPD"), false, "diag_logs_ntpd.php"); + $tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php"); display_top_tabs($tab_array); ?> </td> diff --git a/usr/local/www/diag_logs_relayd.php b/usr/local/www/diag_logs_relayd.php index a2c8ab5..8ce35b8 100755 --- a/usr/local/www/diag_logs_relayd.php +++ b/usr/local/www/diag_logs_relayd.php @@ -63,17 +63,17 @@ include("head.inc"); <tr><td> <?php $tab_array = array(); - $tab_array[] = array(gettext("System"), false, gettext("diag_logs.php")); - $tab_array[] = array(gettext("Firewall"), false, gettext("diag_logs_filter.php")); - $tab_array[] = array(gettext("DHCP"), false, gettext("diag_logs_dhcp.php")); - $tab_array[] = array(gettext("Portal Auth"), false, gettext("diag_logs_auth.php")); - $tab_array[] = array(gettext("PPP"), false, gettext("diag_logs_ppp.php")); - $tab_array[] = array(gettext("IPsec"), false, gettext("diag_logs_ipsec.php")); - $tab_array[] = array(gettext("VPN"), false, gettext("diag_logs_vpn.php")); - $tab_array[] = array(gettext("Load Balancer"), true, gettext("diag_logs_relayd.php")); - $tab_array[] = array(gettext("OpenVPN"), false, gettext("diag_logs_openvpn.php")); - $tab_array[] = array(gettext("OpenNTPD"), false, gettext("diag_logs_ntpd.php")); - $tab_array[] = array(gettext("Settings"), false, gettext("diag_logs_settings.php")); + $tab_array[] = array(gettext("System"), false, "diag_logs.php"); + $tab_array[] = array(gettext("Firewall"), false, "diag_logs_filter.php"); + $tab_array[] = array(gettext("DHCP"), false, "diag_logs_dhcp.php"); + $tab_array[] = array(gettext("Portal Auth"), false, "diag_logs_auth.php"); + $tab_array[] = array(gettext("PPP"), false, "diag_logs_ppp.php"); + $tab_array[] = array(gettext("IPsec"), false, "diag_logs_ipsec.php"); + $tab_array[] = array(gettext("VPN"), false, "diag_logs_vpn.php"); + $tab_array[] = array(gettext("Load Balancer"), true, "diag_logs_relayd.php"); + $tab_array[] = array(gettext("OpenVPN"), false, "diag_logs_openvpn.php"); + $tab_array[] = array(gettext("OpenNTPD"), false, "diag_logs_ntpd.php"); + $tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php"); display_top_tabs($tab_array); ?> </td></tr> diff --git a/usr/local/www/firewall_aliases.php b/usr/local/www/firewall_aliases.php index bc210a1..28bb7e7 100755 --- a/usr/local/www/firewall_aliases.php +++ b/usr/local/www/firewall_aliases.php @@ -147,7 +147,7 @@ if ($_GET['act'] == "del") { } } if($is_alias_referenced == true) { - $savemsg = "Cannot delete rule. Currently in use by {$referenced_by}"; + $savemsg = gettext("Cannot delete rule. Currently in use by {$referenced_by}"); } else { unset($a_aliases[$_GET['id']]); write_config(); @@ -169,7 +169,7 @@ include("head.inc"); <form action="firewall_aliases.php" method="post"> <?php if ($savemsg) print_info_box($savemsg); ?> <?php if (is_subsystem_dirty('aliases')): ?><p> -<?php print_info_box_np("The alias list has been changed.<br>You must apply the changes in order for them to take effect.");?> +<?php print_info_box_np gettext("The alias list has been changed.<br>You must apply the changes in order for them to take effect.");?> <?php endif; ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> @@ -230,7 +230,7 @@ include("head.inc"); <a href="firewall_aliases_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="add a new alias"></a></td> </td> <td valign="middle"> - <a href="firewall_aliases_import.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_import_alias.gif" width="17" height="17" border="0" title="<?=gettext("Bulk import aliases from list");?>" alt="" /></a> + <a href="firewall_aliases_import.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_import_alias.gif" width="17" height="17" border="0" title="<?=gettext("Bulk import aliases from list");"?>" alt="" /></a> </td> </tr> </table> @@ -238,7 +238,7 @@ include("head.inc"); </tr> <tr> <td class="tabcont" colspan="3"> - <p><span class="vexpl"><span class="red"><strong>Note:<br></strong></span>Aliases act as placeholders for real hosts, networks or ports. They can be used to minimize the number of changes that have to be made if a host, network or port changes. You can enter the name of an alias instead of the host, network or port in all fields that have a red background. The alias will be resolved according to the list above. If an alias cannot be resolved (e.g. because you deleted it), the corresponding element (e.g. filter/NAT/shaper rule) will be considered invalid and skipped.</span></p> + <p><span class="vexpl"><span class="red"><strong>Note:<br></strong></span>gettext("Aliases act as placeholders for real hosts, networks or ports.") gettext("They can be used to minimize the number of changes that have to be made if a host, network or port changes.") gettext("You can enter the name of an alias instead of the host, network or port in all fields that have a red background.") gettext("The alias will be resolved according to the list above.") gettext("If an alias cannot be resolved (e.g. because you deleted it), the corresponding element (e.g. filter/NAT/shaper rule) will be considered invalid and skipped.")</span></p> </td> </tr> </table> diff --git a/usr/local/www/firewall_nat.php b/usr/local/www/firewall_nat.php index 0c9229b..ccc524b 100755 --- a/usr/local/www/firewall_nat.php +++ b/usr/local/www/firewall_nat.php @@ -82,6 +82,19 @@ if ($_POST) { } } +if ($_GET['act'] == "del") { + if ($a_nat[$_GET['id']]) { + if (isset($a_nat[$_GET['id']]['associated-rule-id'])) { + delete_id($a_nat[$_GET['id']]['associated-rule-id'], $config['filter']['rule']); + } + unset($a_nat[$_GET['id']]); + write_config(); + mark_subsystem_dirty('nat'); + header("Location: firewall_nat.php"); + exit; + } +} + if (isset($_POST['del_x'])) { /* delete selected rules */ if (is_array($_POST['rule']) && count($_POST['rule'])) { @@ -145,7 +158,7 @@ if (isset($_POST['del_x'])) { } } -$pgtitle = array("Firewall","NAT","Port Forward"); +$pgtitle = array(gettext("Firewall","NAT","Port Forward")); include("head.inc"); echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript/domTT/domLib.js\"></script>"; @@ -161,18 +174,18 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript <?php if (is_subsystem_dirty('natconf')): ?><p> <?php if($savemsg) - print_info_box_np("{$savemsg}<br>The NAT configuration has been changed.<br>You must apply the changes in order for them to take effect."); + print_info_box_np("{$savemsg}<br>gettext("The NAT configuration has been changed.")<br>gettext ("You must apply the changes in order for them to take effect."); else - print_info_box_np("The NAT configuration has been changed.<br>You must apply the changes in order for them to take effect."); + print_info_box_np(gettext("The NAT configuration has been changed.<br>You must apply the changes in order for them to take effect.")); ?> <?php endif; ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td> <?php $tab_array = array(); - $tab_array[] = array("Port Forward", true, "firewall_nat.php"); + $tab_array[] = array(gettext("Port Forward"), true, "firewall_nat.php"); $tab_array[] = array("1:1", false, "firewall_nat_1to1.php"); - $tab_array[] = array("Outbound", false, "firewall_nat_out.php"); + $tab_array[] = array(gettext("Outbound"), false, "firewall_nat_out.php"); display_top_tabs($tab_array); ?> </td></tr> @@ -195,7 +208,13 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript <td width="5%" class="list"> <table border="0" cellspacing="0" cellpadding="1"> <tr> - <td width="17"></td> + <td width="17"> + <?php if (count($a_nat) == 0): ?> + <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title=gettext("delete selected rules") border="0"> + <?php else: ?> + <input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="delete selected rules" onclick="return confirm('Do you really want to delete the selected rules?')"> + <?php endif; ?> + </td> <td><a href="firewall_nat_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td> </tr> </table> @@ -293,11 +312,12 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript <td valign="middle" class="list" nowrap> <table border="0" cellspacing="0" cellpadding="1"> <tr> + <td><input onmouseover="fr_insline(<?=$nnats;?>, true)" onmouseout="fr_insline(<?=$nnats;?>, false)" name="move_<?=$i;?>" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" title=gettext("move selected rules before this rule") height="17" type="image" width="17" border="0"></td> <td><a href="firewall_nat_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="edit rule"></a></td> </tr> <tr> - <td><input onmouseover="fr_insline(<?=$nnats;?>, true)" onmouseout="fr_insline(<?=$nnats;?>, false)" name="move_<?=$i;?>" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" title="move selected rules before this rule" height="17" type="image" width="17" border="0"></td> - <td><a href="firewall_nat_edit.php?dup=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="add a new nat based on this one" width="17" height="17" border="0"></a></td> + <td align="center" valign="middle"><a href="firewall_nat.php?act=del&id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title=gettext("delete rule") onclick="return confirm(gettext('Do you really want to delete this rule?'))"></a></td> + <td><a href="firewall_nat_edit.php?dup=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title=gettext("add a new nat based on this one") width="17" height="17" border="0"></a></td> </tr> </table> </tr> @@ -310,11 +330,17 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript <td class="list" valign="middle" nowrap> <table border="0" cellspacing="0" cellpadding="1"> <tr> - <td><?php if ($nnats == 0): ?><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" title="move selected mappings to end" border="0"><?php else: ?><input name="move_<?=$i;?>" type="image" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" width="17" height="17" title="move selected mappings to end" border="0"><?php endif; ?></td> - <td><a href="firewall_nat_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td> + <td><?php if ($nnats == 0): ?><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" title="move selected rules to end" border="0"><?php else: ?><input name="move_<?=$i;?>" type="image" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" width="17" height="17" title=gettext("move selected rules to end") border="0"><?php endif; ?></td> </tr> <tr> - <td><?php if ($nnats == 0): ?><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title="delete selected rules" border="0"><?php else: ?><input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="delete selected mappings" onclick="return confirm('Do you really want to delete the selected mappings?')"><?php endif; ?></td> + <td width="17"> + <?php if (count($a_nat) == 0): ?> + <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title=gettext("delete selected rules") border="0"> + <?php else: ?> + <input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="delete selected rules" onclick="return confirm(gettext('Do you really want to delete the selected rules?'))"> + <?php endif; ?> + </td> + <td><a href="firewall_nat_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td> </tr> </table> </td> @@ -326,7 +352,7 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript </tr> <tr> <td width="14"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_chain.png" width="11" height="11"></td> - <td colspan="3">linked rule</td> + <td colspan="3">gettext("linked rule")</td> </tr> </table> </div> diff --git a/usr/local/www/index.php b/usr/local/www/index.php index 68755f9..ec3122e 100755 --- a/usr/local/www/index.php +++ b/usr/local/www/index.php @@ -109,7 +109,7 @@ if (!is_array($config['widgets'])) { if(file_exists('/conf/needs_package_sync')) { if($config['installedpackages'] <> '') { conf_mount_rw(); - unlink('/conf/needs_package_sync'); + @unlink('/conf/needs_package_sync'); conf_mount_ro(); if($g['platform'] == "pfSense" || $g['platform'] == "nanobsd") { header('Location: pkg_mgr_install.php?mode=reinstallall'); diff --git a/usr/local/www/interfaces_ppps.php b/usr/local/www/interfaces_ppps.php index 5a6c306..e6d4880 100644 --- a/usr/local/www/interfaces_ppps.php +++ b/usr/local/www/interfaces_ppps.php @@ -88,7 +88,7 @@ include("head.inc"); $tab_array[2] = array("Wireless", false, "interfaces_wireless.php"); $tab_array[3] = array("VLANs", false, "interfaces_vlan.php"); $tab_array[4] = array("QinQs", false, "interfaces_qinq.php"); - $tab_array[5] = array("PPPs", false, "interfaces_ppps.php"); + $tab_array[5] = array("PPPs", true, "interfaces_ppps.php"); $tab_array[6] = array("GRE", false, "interfaces_gre.php"); $tab_array[7] = array("GIF", false, "interfaces_gif.php"); $tab_array[8] = array("Bridges", false, "interfaces_bridge.php"); diff --git a/usr/local/www/status_gateways.php b/usr/local/www/status_gateways.php index 4d85a42..6d6c43d 100755 --- a/usr/local/www/status_gateways.php +++ b/usr/local/www/status_gateways.php @@ -79,7 +79,7 @@ include("head.inc"); ?> <tr> <td class="listlr"> - <?=strtoupper($gateway['name']);?> + <?=$gateway['name'];?> </td> <td class="listr" align="center" > <?php echo lookup_gateway_ip_by_name($gateway['name']);?> diff --git a/usr/local/www/system_advanced_admin.php b/usr/local/www/system_advanced_admin.php index 6f7a077..ca4cee3 100644 --- a/usr/local/www/system_advanced_admin.php +++ b/usr/local/www/system_advanced_admin.php @@ -412,7 +412,7 @@ function prot_change() { <?php if ($restart_sshd) { - mwexec("/usr/bin/killall sshd"); + killbyname(sshd); log_error(gettext("secure shell configuration has changed. Stopping sshd.")); if ($config['system']['enablesshd']) { diff --git a/usr/local/www/system_firmware_auto.php b/usr/local/www/system_firmware_auto.php index d5b7cd5..48d727c 100755 --- a/usr/local/www/system_firmware_auto.php +++ b/usr/local/www/system_firmware_auto.php @@ -124,7 +124,12 @@ include("head.inc"); <?php update_status(gettext("Downloading current version information") . "..."); -download_file_with_progress_bar("{$updater_url}/version", "/tmp/{$g['product_name']}_version"); +$nanosize = ""; +if ($g['platform'] == "nanobsd") { + $nanosize = "-nanobsd-" . strtolower(trim(file_get_contents("/etc/nanosize.txt"))); +} + +download_file_with_progress_bar("{$updater_url}/version{$nanosize}", "/tmp/{$g['product_name']}_version"); $latest_version = str_replace("\n", "", @file_get_contents("/tmp/{$g['product_name']}_version")); if(!$latest_version) { update_output_window(gettext("Unable to check for updates.")); @@ -143,8 +148,13 @@ if(!$latest_version) { if (pfs_version_compare($current_installed_buildtime, $current_installed_version, $latest_version) == -1) { update_status(gettext("Downloading updates") . "..."); conf_mount_rw(); - $status = download_file_with_progress_bar("{$updater_url}/latest.tgz", "{$g['upload_path']}/latest.tgz", "read_body_firmware"); - $status = download_file_with_progress_bar("{$updater_url}/latest.tgz.sha256", "{$g['upload_path']}/latest.tgz.sha256"); + if ($g['platform'] == "nanobsd") { + $update_filename = "latest{$nanosize}.img.gz"; + } else { + $update_filename = "latest.tgz"; + } + $status = download_file_with_progress_bar("{$updater_url}/{$update_filename}", "{$g['upload_path']}/latest.tgz", "read_body_firmware"); + $status = download_file_with_progress_bar("{$updater_url}/{$update_filename}.sha256", "{$g['upload_path']}/latest.tgz.sha256"); conf_mount_ro(); update_output_window("{$g['product_name']} " . gettext("download complete.")); } else { diff --git a/usr/local/www/system_firmware_check.php b/usr/local/www/system_firmware_check.php index 9eabe26..c676950 100755 --- a/usr/local/www/system_firmware_check.php +++ b/usr/local/www/system_firmware_check.php @@ -120,7 +120,13 @@ else $updater_url = $g['update_url']; $needs_system_upgrade = false; $static_text .= gettext("Downloading new version information..."); -download_file_with_progress_bar("{$updater_url}/version", "/tmp/{$g['product_name']}_version"); + +$nanosize = ""; +if ($g['platform'] == "nanobsd") { + $nanosize = "-nanobsd-" . strtolower(trim(file_get_contents("/etc/nanosize.txt"))); +} + +download_file_with_progress_bar("{$updater_url}/version{$nanosize}", "/tmp/{$g['product_name']}_version"); $remote_version = trim(@file_get_contents("/tmp/{$g['product_name']}_version")); $static_text .= gettext("done") . "\\n"; if (!$remote_version) { @@ -155,6 +161,9 @@ if ($needs_system_upgrade == false) { echo "\n<script>$('invokeupgrade').style.visibility = 'visible';</script>"; $txt = gettext("A new version is now available") . "\\n\\n"; $txt .= gettext("Current version") .": ". $current_installed_version . "\\n"; +if ($g['platform'] == "nanobsd") { + $txt .= " " . gettext("NanoBSD Size") . " : " . trim(file_get_contents("/etc/nanosize.txt")) . "\\n"; +} $txt .= " " . gettext("Built On") .": ". $current_installed_buildtime . "\\n"; $txt .= " " . gettext("New version") .": ". $remote_version . "\\n\\n"; $txt .= " " . gettext("Update source") .": ". $updater_url . "\\n"; diff --git a/usr/local/www/system_usermanager.php b/usr/local/www/system_usermanager.php index c3da004..058046a 100644 --- a/usr/local/www/system_usermanager.php +++ b/usr/local/www/system_usermanager.php @@ -174,7 +174,6 @@ if (isAllowedPage("system_usermanager")) { } if ($_POST) { - conf_mount_rw(); unset($input_errors); $pconfig = $_POST; @@ -253,6 +252,7 @@ if (isAllowedPage("system_usermanager")) { } if (!$input_errors) { + conf_mount_rw(); $userent = array(); if (isset($id) && $a_user[$id]) $userent = $a_user[$id]; @@ -303,6 +303,16 @@ if (isAllowedPage("system_usermanager")) { $userent['cert'][] = $cert; } $userent['uid'] = $config['system']['nextuid']++; + /* Add the user to All Users group. */ + if (!is_array($config['system']['group']['member'])) + $config['system']['group']['member'] = array(); + foreach ($config['system']['group'] as $gidx => $group) { + if ($group['name'] == "all") { + $config['system']['group'][$gidx]['member'][] = $userent['uid']; + break; + } + } + $a_user[] = $userent; } |