Merge remote-tracking branch 'mainline/master' into inc

This commit is contained in:
Vinicius Coque 2011-07-11 09:02:41 -03:00
commit fdbce60ca9
7 changed files with 31 additions and 2 deletions

View File

@ -1272,6 +1272,7 @@ function configure_cron() {
}
function upnp_action ($action) {
global $g, $config;
switch($action) {
case "start":
if (file_exists('/var/etc/miniupnpd.conf')) {

View File

@ -93,7 +93,7 @@ switch ($command) {
exec("fetch -1 -w15 -a -v -o /root/firmware.tgz.md5 \"$url.md5\"");
} else {
echo "\n\nWARNING.\n";
echo "\nCould not locate a MD5 file. We cannot verify the download once its done.\n\n";
echo "\nCould not locate a MD5 file. We cannot verify the download once completed.\n\n";
sleep(15);
}
if(file_exists("/root/firmware.tgz.md5")) {

0
etc/rc.stop_packages Normal file → Executable file
View File

View File

@ -302,6 +302,26 @@ if ($_POST) {
$input_errors[] = sprintf(gettext("%s is not a valid start destination port. It must be a port alias or integer between 1 and 65535."),$_POST['dstbeginport']);
if ($_POST['dstendport'] && !is_portoralias($_POST['dstendport']))
$input_errors[] = sprintf(gettext("%s is not a valid end destination port. It must be a port alias or integer between 1 and 65535."),$_POST['dstendport']);
if ( !$_POST['srcbeginport_cust'] && $_POST['srcendport_cust'])
if (is_alias($_POST['srcendport_cust']))
$input_errors[] = 'If you put port alias in Source port range to: field you must put the same port alias in from: field';
if ( $_POST['srcbeginport_cust'] && $_POST['srcendport_cust']){
if (is_alias($_POST['srcendport_cust']) && is_alias($_POST['srcendport_cust']) && $_POST['srcbeginport_cust'] != $_POST['srcendport_cust'])
$input_errors[] = 'The same port alias must be used in Source port range from: and to: fields';
if ((is_alias($_POST['srcbeginport_cust']) && (!is_alias($_POST['srcendport_cust']) && $_POST['srcendport_cust']!='')) ||
((!is_alias($_POST['srcbeginport_cust']) && $_POST['srcbeginport_cust']!='') && is_alias($_POST['srcendport_cust'])))
$input_errors[] = 'You cannot specify numbers and port aliases at the same time in Source port range from: and to: field';
}
if ( !$_POST['dstbeginport_cust'] && $_POST['dstendport_cust'])
if (is_alias($_POST['dstendport_cust']))
$input_errors[] = 'If you put port alias in Destination port range to: field you must put the same port alias in from: field';
if ( $_POST['dstbeginport_cust'] && $_POST['dstendport_cust']){
if (is_alias($_POST['dstendport_cust']) && is_alias($_POST['dstendport_cust']) && $_POST['dstbeginport_cust'] != $_POST['dstendport_cust'])
$input_errors[] = 'The same port alias must be used in Destination port range from: and to: fields';
if ((is_alias($_POST['dstbeginport_cust']) && (!is_alias($_POST['dstendport_cust']) && $_POST['dstendport_cust']!='')) ||
((!is_alias($_POST['dstbeginport_cust']) && $_POST['dstbeginport_cust']!='') && is_alias($_POST['dstendport_cust'])))
$input_errors[] = 'You cannot specify numbers and port aliases at the same time in Destination port range from: and to: field';
}
/* if user enters an alias and selects "network" then disallow. */
if($_POST['srctype'] == "network") {

View File

@ -216,6 +216,12 @@ if ($_POST) {
$input_errors[] = gettext("A valid IP address must be specified for the gateway.");
if (($_POST['wins1'] && !is_ipaddr($_POST['wins1'])) || ($_POST['wins2'] && !is_ipaddr($_POST['wins2'])))
$input_errors[] = gettext("A valid IP address must be specified for the primary/secondary WINS servers.");
$parent_ip = get_interface_ip($_POST['if']);
if (is_ipaddr($parent_ip) && $_POST['gateway']) {
$parent_sn = get_interface_subnet($_POST['if']);
if(!ip_in_subnet($_POST['gateway'], gen_subnet($parent_ip, $parent_sn) . "/" . $parent_sn) && !ip_in_interface_alias_subnet($_POST['if'], $_POST['gateway']))
$input_errors[] = sprintf(gettext("The gateway address %s does not lie within the chosen interface's subnet."), $_POST['gateway']);
}
if (($_POST['dns1'] && !is_ipaddr($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddr($_POST['dns2'])))
$input_errors[] = gettext("A valid IP address must be specified for the primary/secondary DNS servers.");

View File

@ -180,7 +180,7 @@ function enable_change(enable_over) {
<td width="78%" class="vtable">
<input name="server" type="text" class="formfld unknown" id="server" size="20" value="<?=htmlspecialchars($pconfig['server']);?>">
<br>
<?=gettext("This is the IP address of the server to which the DHCP packet is relayed. You can enter multiple ip address server entries separated by commas. Select \"Proxy requests to DHCP server on WAN subnet\" to relay DHCP packets to the server that was used on the WAN interface.");?>
<?=gettext("This is the IP address of the server to which DHCP requests are relayed. You can enter multiple server IP addresses, separated by commas. Select \"Proxy requests to DHCP server on WAN subnet\" to relay DHCP packets to the server that was used on the WAN interface.");?>
</td>
</tr>
<tr>

View File

@ -590,6 +590,8 @@
}
unset($config['wizardtemp']);
write_config();
interface_reconfigure("wan");
interface_reconfigure("lan");
reload_all();
mwexec_bg("/etc/rc.update_bogons.sh now");
]]>