From c7c4092548ab5437cdba89e12e02cf94dc76ea2f Mon Sep 17 00:00:00 2001 From: Daniel Schwen Date: Fri, 12 Feb 2016 10:44:10 -0700 Subject: [PATCH] Fix the loginMessage errorText stuff in Default.php (#309) --- churchinfo/Default.php | 51 ++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 29 deletions(-) diff --git a/churchinfo/Default.php b/churchinfo/Default.php index d9cc1fc6f4..f54d9581de 100644 --- a/churchinfo/Default.php +++ b/churchinfo/Default.php @@ -43,7 +43,6 @@ $bSuppressSessionTests = TRUE; require 'Include/Functions.php'; // Initialize the variables -$sErrorText = ''; // Is the user requesting to logoff or timed out? if (isset($_GET["Logoff"]) || isset($_GET['timeout'])) { @@ -88,7 +87,7 @@ $iUserID = 0; // Get the UserID out of user name submitted in form results -if (isset($_POST['User']) && $sErrorText == '') { +if (isset($_POST['User']) && !isset($sErrorText)) { // Get the information for the selected user $UserName = FilterInput($_POST['User'],'string',32); @@ -97,7 +96,7 @@ $usQueryResultSet = mysql_fetch_array($usQueryResult); if ($usQueryResultSet == Null){ // Set the error text - $sErrorText = ' ' . gettext('Invalid login or password'); + $sErrorText = gettext('Invalid login or password'); }else{ //Set user Id based on login name provided $iUserID = $usQueryResultSet['usr_per_id']; @@ -130,7 +129,7 @@ // Block the login if a maximum login failure count has been reached if ($iMaxFailedLogins > 0 && $usr_FailedLogins >= $iMaxFailedLogins) { - $sErrorText = '
' . gettext('Too many failed logins: your account has been locked. Please contact an administrator.'); + $sErrorText = gettext('Too many failed logins: your account has been locked. Please contact an administrator.'); } // Does the password match? elseif ($usr_Password != $sPasswordHashSha256) @@ -141,7 +140,7 @@ RunQuery($sSQL); // Set the error text - $sErrorText = ' ' . gettext('Invalid login or password'); + $sErrorText = gettext('Invalid login or password'); } else { @@ -332,20 +331,17 @@

' . $sErrorText . ''; +if (isset($loginPageMsg)) + echo '
' . $loginPageMsg . '
'; +?> - $loginPageMsg = ''; - if (isset($_GET['timeout'])) { - $loginPageMsg = "Your previous session timed out. Please login again."; - } - if ($sErrorText != '') { - $loginPageMsg = $sErrorText; - } - - if ($loginPageMsg != '') { ?> -
+
@@ -371,29 +367,26 @@ + -