diff --git a/src/etc/inc/authgui.inc b/src/etc/inc/authgui.inc index f92cd3d4e..4c3e15583 100644 --- a/src/etc/inc/authgui.inc +++ b/src/etc/inc/authgui.inc @@ -45,8 +45,10 @@ function set_language() $lang = $config['system']['language']; } - if (!empty($_SESSION['Username']) && array_key_exists($_SESSION['Username'], $userindex) && - !empty($config['system']['user'][$userindex[$_SESSION['Username']]]['language'])) { + if ( + !empty($_SESSION['Username']) && array_key_exists($_SESSION['Username'], $userindex) && + !empty($config['system']['user'][$userindex[$_SESSION['Username']]]['language']) + ) { $lang = $config['system']['user'][$userindex[$_SESSION['Username']]]['language']; } @@ -68,7 +70,7 @@ function session_auth(&$Login_Error) session_set_cookie_params( $currentCookieParams["lifetime"], $currentCookieParams["path"], - NULL, + null, ($config['system']['webgui']['protocol'] == "https"), true ); @@ -169,7 +171,7 @@ function session_auth(&$Login_Error) if (isset($_COOKIE[session_name()])) { $secure = $config['system']['webgui']['protocol'] == "https"; - setcookie(session_name(), '', time()-42000, '/', null, $secure, true); + setcookie(session_name(), '', time() - 42000, '/', null, $secure, true); } /* and destroy it */ @@ -234,7 +236,7 @@ function display_error_form($http_code, $desc) { $themename = htmlspecialchars(get_current_theme()); -?> + ?> @@ -268,7 +270,6 @@ function display_error_form($http_code, $desc) + ?> @@ -320,9 +321,9 @@ function display_login_form($Login_Error) - + - + @@ -331,19 +332,19 @@ function display_login_form($Login_Error)

')); - } - ?> + if (is_ipaddr($http_host) && !$local_ip && !isset($config['system']['webgui']['nohttpreferercheck'])) { + print_info_box(sprintf(gettext("You are accessing this router by an IP address not configured locally, which may be forwarded by NAT or other means. %sIf you did not setup this forwarding, you may be the target of a man-in-the-middle attack."), '

')); + } + ?>
@@ -369,7 +370,7 @@ function display_login_form($Login_Error)

- + diff --git a/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/AliasController.php b/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/AliasController.php index a41bf9986..a778d508f 100644 --- a/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/AliasController.php +++ b/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/AliasController.php @@ -337,7 +337,8 @@ class AliasController extends ApiMutableModelControllerBase if (file_exists('/usr/local/share/GeoIP/alias.stats')) { $stats = json_decode(file_get_contents('/usr/local/share/GeoIP/alias.stats'), true); $result[static::$internalModelName]['geoip'] = array_merge( - $result[static::$internalModelName]['geoip'], $stats + $result[static::$internalModelName]['geoip'], + $stats ); } }