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
This commit is contained in:
Mafoo 2017-06-10 05:13:51 +01:00 committed by FusionPBX
parent 3cab4401cf
commit 9ecba1d010
2 changed files with 28 additions and 6 deletions

View File

@ -1,5 +1,5 @@
<?php
#This file was last reorganized on 2nd of June 2017 04:38:28 PM UTC
#This file was last reorganized on 9th of June 2017 07:00:00 AM UTC
$text['language-name']['en-us'] = "English - United States";
$text['language-name']['ar-eg'] = "العربية - مصر";
@ -181,6 +181,26 @@ $text['message-copy']['ru-ru'] = "Копирование выполнено";
$text['message-copy']['sv-se'] = "Kopiering Slutförd";
$text['message-copy']['uk-ua'] = "Скопійовано";
$text['message-invalid_credentials']['en-us'] = "Invalid Username and/or Password";
$text['message-invalid_credentials']['ar-eg'] = "";
$text['message-invalid_credentials']['de-at'] = "";
$text['message-invalid_credentials']['de-ch'] = "";
$text['message-invalid_credentials']['de-de'] = "";
$text['message-invalid_credentials']['es-cl'] = "";
$text['message-invalid_credentials']['es-mx'] = "";
$text['message-invalid_credentials']['fr-ca'] = "";
$text['message-invalid_credentials']['fr-fr'] = "";
$text['message-invalid_credentials']['he-il'] = "";
$text['message-invalid_credentials']['it-it'] = "";
$text['message-invalid_credentials']['nl-nl'] = "";
$text['message-invalid_credentials']['pl-pl'] = "";
$text['message-invalid_credentials']['pt-br'] = "";
$text['message-invalid_credentials']['pt-pt'] = "";
$text['message-invalid_credentials']['ro-ro'] = "";
$text['message-invalid_credentials']['ru-ru'] = "Неверное имя пользователя или пароль";
$text['message-invalid_credentials']['sv-se'] = "";
$text['message-invalid_credentials']['uk-ua'] = "";
$text['message-message']['en-us'] = "Message";
$text['message-message']['ar-eg'] = "";
$text['message-message']['de-at'] = "Nachricht";

View File

@ -26,7 +26,11 @@
//includes
require_once "resources/require.php";
//for compatability require this library if less than version 5.5
//add multi-lingual support
$language = new text;
$text = $language->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;
}