summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Fonnesbeck <efonnes@gmail.com>2010-11-17 06:47:05 -0700
committerErik Fonnesbeck <efonnes@gmail.com>2010-11-17 07:01:19 -0700
commitfd7f136b2665a1fda1df5329d24617413cf78847 (patch)
treec94523a941327a5d807a3ca94c54099b72640be4
parentcfcebf070f258ecc43289ed97492524b7c7f5990 (diff)
downloadpfsense-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-xusr/local/www/wizard.php12
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);
OpenPOWER on IntegriCloud