diff options
author | Erik Fonnesbeck <efonnes@gmail.com> | 2010-11-17 06:47:05 -0700 |
---|---|---|
committer | Erik Fonnesbeck <efonnes@gmail.com> | 2010-11-17 07:01:19 -0700 |
commit | fd7f136b2665a1fda1df5329d24617413cf78847 (patch) | |
tree | c94523a941327a5d807a3ca94c54099b72640be4 | |
parent | cfcebf070f258ecc43289ed97492524b7c7f5990 (diff) | |
download | pfsense-fd7f136b2665a1fda1df5329d24617413cf78847.zip pfsense-fd7f136b2665a1fda1df5329d24617413cf78847.tar.gz |
Redirect to the correct IP at the end of the setup wizard if accessing it on an IP address that was changed. Fixes #455
-rwxr-xr-x | usr/local/www/wizard.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/usr/local/www/wizard.php b/usr/local/www/wizard.php index 965a2aa..0c93977 100755 --- a/usr/local/www/wizard.php +++ b/usr/local/www/wizard.php @@ -894,7 +894,7 @@ if($pkg['step'][$stepid]['javascriptafterformdisplay'] <> "") { */ function fixup_string($string) { - global $config, $myurl; + global $config, $myurl, $title; $newstring = $string; // fixup #1: $myurl -> http[s]://ip_address:port/ switch($config['system']['webgui']['protocol']) { @@ -918,7 +918,15 @@ function fixup_string($string) { $urlport = ""; } } - $myurl = $proto . "://" . $_SERVER['HTTP_HOST'] . $urlport . "/"; + $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']; + } + $myurl = $proto . "://" . $urlhost . $urlport . "/"; if (strstr($newstring, "\$myurl")) $newstring = str_replace("\$myurl", $myurl, $newstring); |