diff --git a/src/etc/inc/authgui.inc b/src/etc/inc/authgui.inc index 9b2167a1c..c97dc0348 100644 --- a/src/etc/inc/authgui.inc +++ b/src/etc/inc/authgui.inc @@ -142,7 +142,8 @@ function getAllowedPages($username) { } -function session_auth() { +function session_auth(&$Login_Error) +{ global $config, $_SESSION; // Handle HTTPS httponly and secure flags @@ -188,7 +189,7 @@ function session_auth() { exit; } else { /* give the user an error message */ - $_SESSION['Login_Error'] = gettext('Wrong username or password.'); + $Login_Error = gettext('Wrong username or password.'); log_error("webConfigurator authentication error for '{$_POST['usernamefld']}' from {$_SERVER['REMOTE_ADDR']}"); } } @@ -251,10 +252,11 @@ function session_auth() { return true; } +$Login_Error = ''; /* Authenticate user - exit if failed */ -if (!session_auth()) { - display_login_form(); +if (!session_auth($Login_Error)) { + display_login_form($Login_Error); exit; } @@ -328,7 +330,7 @@ function display_error_form($http_code, $desc) } // end function -function display_login_form() +function display_login_form($Login_Error = '') { global $config, $g; $g['theme'] = get_current_theme(); @@ -400,11 +402,7 @@ function display_login_form()
- -

- +

action=""> @@ -418,33 +416,27 @@ function display_login_form()
- - - + - -

- - - - + +

+ + + + +
+ (c) + +
- - - +