From 9ecba1d01072d01b51f6ee0ec33441fd0c00a58d Mon Sep 17 00:00:00 2001 From: Mafoo Date: Sat, 10 Jun 2017 05:13:51 +0100 Subject: [PATCH] Enhance [master] - update check_auth to use $text (#2661) * Enhance - update check_auth to use $text convert to messages::add and utilize $text for invalid_credentials * Russian translations for check_auth --- resources/app_languages.php | 22 +++++++++++++++++++++- resources/check_auth.php | 12 +++++++----- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/resources/app_languages.php b/resources/app_languages.php index 4f52aefbac..fbe5593916 100644 --- a/resources/app_languages.php +++ b/resources/app_languages.php @@ -1,5 +1,5 @@ get('resources'); + +//for compatibility require this library if less than version 5.5 if (version_compare(phpversion(), '5.5', '<')) { require_once "resources/functions/password.php"; } @@ -55,8 +59,7 @@ //if the username is not provided then send to login.php if (strlen($_REQUEST["username"]) == 0 && strlen($_REQUEST["key"]) == 0) { $target_path = ($_REQUEST["path"] != '') ? $_REQUEST["path"] : $_SERVER["REQUEST_URI"]; - $_SESSION["message_mood"] = "negative"; - $_SESSION["message"] = "Invalid Username and/or Password"; + messages::add($text['message-invalid_credentials'], 'negative'); header("Location: ".PROJECT_PATH."/login.php?path=".urlencode($target_path)); exit; } @@ -97,8 +100,7 @@ closelog(); //redirect the user to the login page $target_path = ($_REQUEST["path"] != '') ? $_REQUEST["path"] : $_SERVER["PHP_SELF"]; - $_SESSION["message_mood"] = "negative"; - $_SESSION["message"] = "Invalid Username and/or Password"; + messages::add($text['message-invalid_credentials'], 'negative'); header("Location: ".PROJECT_PATH."/login.php?path=".urlencode($target_path)); exit; }