From 6898927f4f48bd67710cffe0cdd828922254e25b Mon Sep 17 00:00:00 2001 From: Erik Fonnesbeck Date: Wed, 17 Nov 2010 20:00:05 -0700 Subject: Make this check more general in case someone makes a wizard that changes an opt interface's IP address and wants to use the "Reload in progress" step. Ticket #455 --- usr/local/www/wizard.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'usr') diff --git a/usr/local/www/wizard.php b/usr/local/www/wizard.php index cc9ce72..485dd17 100755 --- a/usr/local/www/wizard.php +++ b/usr/local/www/wizard.php @@ -921,10 +921,14 @@ function fixup_string($string) { $urlhost = $_SERVER['HTTP_HOST']; // If finishing the setup wizard, check if accessing on a LAN or WAN address that changed if($title == "Reload in progress") { - if ($urlhost == get_interface_ip("lan") && is_ipaddr($config['interfaces']['lan']['ipaddr'])) - $urlhost = $config['interfaces']['lan']['ipaddr']; - else if ($urlhost == get_interface_ip() && is_ipaddr($config['interfaces']['wan']['ipaddr'])) - $urlhost = $config['interfaces']['wan']['ipaddr']; + if (is_ipaddr($urlhost)) { + $host_if = find_ip_interface($urlhost); + if ($host_if) { + $host_if = convert_real_interface_to_friendly_interface_name($host_if); + if ($host_if && is_ipaddr($config['interfaces'][$host_if]['ipaddr'])) + $urlhost = $config['interfaces'][$host_if]['ipaddr']; + } + } } if($urlhost != $_SERVER['HTTP_HOST']) file_put_contents("{$g['tmp_path']}/setupwizard_lastreferrer", $proto . "://" . $_SERVER['HTTP_HOST'] . $urlport . $_SERVER['REQUEST_URI']); -- cgit v1.1