diff options
author | Erik Fonnesbeck <efonnes@gmail.com> | 2010-11-17 07:43:57 -0700 |
---|---|---|
committer | Erik Fonnesbeck <efonnes@gmail.com> | 2010-11-17 08:35:30 -0700 |
commit | a219c6432582650f4942cfb3b5c9c94e14551af5 (patch) | |
tree | 61224db4c7a4c605efa087d6551573f2e5aae685 /etc | |
parent | fd7f136b2665a1fda1df5329d24617413cf78847 (diff) | |
download | pfsense-a219c6432582650f4942cfb3b5c9c94e14551af5.zip pfsense-a219c6432582650f4942cfb3b5c9c94e14551af5.tar.gz |
Add workaround for referrer check to not be triggered on the previous IP address when redirected by the setup wizard.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/auth.inc | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc index b966af3..3fd989b 100644 --- a/etc/inc/auth.inc +++ b/etc/inc/auth.inc @@ -93,7 +93,16 @@ if(function_exists("display_error_form") && !isset($config['system']['webgui'][' $hostname_me = $config['system']['hostname'] . "." . $config['system']['domain']; if(stristr($_SERVER['HTTP_REFERER'], $hostname_me)) $found_host = true; - if(!empty($config['system']['webgui']['althostnames'])) { + if(file_exists("{$g['tmp_path']}/setupwizard_lastreferrer") && !$found_host) { + if($_SERVER['HTTP_REFERER'] == file_get_contents("{$g['tmp_path']}/setupwizard_lastreferrer")) { + unlink("{$g['tmp_path']}/setupwizard_lastreferrer"); + header("Refresh: 1; url=index.php"); + echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">"; + echo "<html><head><title>" . gettext("Redirecting...") . "</title></head><body>" . gettext("Redirecting to the dashboard...") . "</body></html>"; + exit; + } + } + if(!empty($config['system']['webgui']['althostnames']) && !$found_host) { $althosts = explode(" ", $config['system']['webgui']['althostnames']); foreach ($althosts as $ah) { if(empty($ah)) @@ -104,14 +113,16 @@ if(function_exists("display_error_form") && !isset($config['system']['webgui'][' } } } - $interface_list_ips = get_configured_ip_addresses(); - foreach($interface_list_ips as $ilips) { - if(empty($ilips)) - continue; - $hostname_me_ip = $config['webgui']['protocol'] . "://" . $ilips; - if(stristr($_SERVER['HTTP_REFERER'],$hostname_me_ip)) { - $found_host = true; - break; + if(!$found_host) { + $interface_list_ips = get_configured_ip_addresses(); + foreach($interface_list_ips as $ilips) { + if(empty($ilips)) + continue; + $hostname_me_ip = $config['webgui']['protocol'] . "://" . $ilips; + if(stristr($_SERVER['HTTP_REFERER'],$hostname_me_ip)) { + $found_host = true; + break; + } } } if($found_host == false) { |