Login & order checkout user error logging improved, recover password translation fixes

This commit is contained in:
Juan Ferrer 2019-10-29 14:02:09 +01:00
parent 4d7d35cb84
commit e1ed50b139
23 changed files with 82 additions and 25 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (1.406.68) stable; urgency=low
hedera-web (1.406.69) stable; urgency=low
* Initial Release.

View File

@ -26,7 +26,9 @@ Please select an agency: Si us plau tria una agència
Please select a store: Si us plau tria un magatzem
NoAgeciesAvailableForDate: >-
No hi ha agències disponibles per a la data i el consignatari seleccionats,
modifica la data d'enviament de la comanda
comprova la data de la comanda i que consignatari seleccionat conté una
província i codi postal correctes
NoWarehousesAvailableForDate: >-
No hi ha magatzems disponibles per a la data seleccionada, modifica la data de
recollida de la comanda
No hi ha magatzems disponibles per a la data seleccionada, comprova la data
de recollida de la comanda i que consignatari seleccionat conté una província
i codi postal correctes

View File

@ -25,6 +25,9 @@ Please select an address: Please select an address
Please select an agency: Please select an agency
Please select a store: Please select a store
NoAgeciesAvailableForDate: >-
No agencies available for the selected date and consignee, change the shipping
date of your order
NoWarehousesAvailableForDate: 'No stores available for the selected date, change the pickup date of you order'
There are no agencies available for the selected date and consignee, check
the date of the order and that selected address contains a correct province
and zip code
NoWarehousesAvailableForDate: >-
There are no stores available for the selected date, check the date of order
pickup and that selected address contains a correct province and zip code

View File

@ -25,8 +25,10 @@ Please select an address: Por favor elige una dirección
Please select an agency: Por favor elige una agencia
Please select a store: Por favor elige un almacén
NoAgeciesAvailableForDate: >-
No hay agencias disponibles para la fecha y el consignatario seleccionados,
modifica la fecha de envío del pedido
No hay agencias disponibles para la fecha y el consignatario seleccionados,
comprueba la fecha del pedido y que consignatario seleccionado
contiene una provincia y código postal correctos
NoWarehousesAvailableForDate: >-
No hay almacenes disponibles para la fecha seleccionada, modifica la fecha de
recogida del pedido
No hay almacenes disponibles para la fecha seleccionada, comprueba la fecha
de recogida del pedido y que consignatario seleccionado contiene una
provincia y código postal correctos

View File

@ -26,5 +26,9 @@ Please select an agency: Veuillez choisir une agence
Please select a store: Veuillez choisir un entrepôt
NoAgeciesAvailableForDate: >-
Aucune agence disponibles pour la date et le destinataire sélectionné, changer
la date d'envoi de la commande
NoWarehousesAvailableForDate: 'Pas de magasins disponibles à la date sélectionnée, changer la date de retrait'
la date d'envoi de la commande et vérifier quel destinataire a été sélectionné
contient une province et un code postal correct
NoWarehousesAvailableForDate: >-
Pas de magasins disponibles à la date sélectionnée, changer la date de
retrait et vérifier quel destinataire a été sélectionné contient une province
et un code postal correct

View File

@ -26,7 +26,9 @@ Please select an agency: Por favor, escolha uma agência
Please select a store: Por favor, escolha um armazém
NoAgeciesAvailableForDate: >-
Não há agências disponíveis para a data e o consignatario escolhido, modifique
a data de envío do pedido
a data de envío do pedido e verifique qual destinatário selecionou contém uma
província e código postal corretos
NoWarehousesAvailableForDate: >-
Não há armazéns disponíveis para a data seleccionada, modifique a data para
levantar a encomenda
levantar a encomenda e verifique qual destinatário selecionou contém uma
província e código postal corretos

View File

@ -68,6 +68,10 @@ module.exports = new Class({
Htk.Toast.showError(_('Invalid login'));
this._logout();
break;
case 'UserDisabled':
Htk.Toast.showError(_('User disabled'));
this._logout();
break;
case 'SessionExpired':
Htk.Toast.showError(_('You\'ve been too idle'));
this._logout();

View File

@ -13,6 +13,9 @@ You've been too idle: Has estat massa temps inactiu i la sessió ha expirat
Invalid login: >-
Usuari o contrasenya incorrectes, recorda que s'hi distingeix entre majúscula
i minúscula
User disabled: >-
L'autenticació és correcta però el compte d'usuari ha estat desactivada, si
us plau posa't en contacte amb el teu comercial o persona assignada
Please write your user name: Si us plau introdueix el teu nom d'usuari
A mail has been sent wich you can recover your password: T'hem enviat un correu on podràs recuperar la teva contrasenya
Menu: Menú

View File

@ -11,6 +11,9 @@ Yet you are not a customer?: Yet you are not a customer?
Sign up: Sign up
You've been too idle: You have been idle too long and your session has expired
Invalid login: 'Username or password incorrect, remember that it is case-sensitive'
User disabled: >-
Authentication is correct but the user account has been disabled, please
contact your commercial or assigned person
Please write your user name: Please write your user name
A mail has been sent wich you can recover your password: A mail has been sent wich you can recover your password
Menu: Menu

View File

@ -13,6 +13,9 @@ You've been too idle: Has estado demasiado tiempo inactivo y la sesión ha expir
Invalid login: >-
Usuario o contraseña incorrectos, recuerda que se hace distinción entre
mayúsculas y minúsculas
User disabled: >-
La autenticación es correcta pero la cuenta de usuario ha sido deshabilitada,
por favor ponte en contacto con tu comercial o persona asignada
Please write your user name: Por favor escribe tu nombre de usuario
A mail has been sent wich you can recover your password: Te hemos enviado un correo donde podrás recuperar tu contraseña
Menu: Menú

View File

@ -13,6 +13,9 @@ You've been too idle: Il a eu le temps de trop paresseux et votre session a expi
Invalid login: >-
Utilisateur ou mot de passe incorrect, n'oubliez pas de distinction entre
majuscules et minuscules
User disabled: >-
Lauthentification est correcte mais le compte utilisateur a été désactivé.
Veuillez contacter votre représentant commercial ou votre correspondant.
Please write your user name: S'il vous plaît entrer votre nom d'utilisateur
A mail has been sent wich you can recover your password: Nous avons envoyé un e-mail où vous pouvez récupérer votre mot de passe
Menu: Menu

View File

@ -13,6 +13,9 @@ You've been too idle: 'Muito tempo de inatividade, a sessão foi finalizada'
Invalid login: >-
Usuário ou Palavra-Passe incorreto, lembre-se de diferenciar maiusculas e
minusculas
User disabled: >-
A autenticação está correta, mas a conta do usuário foi desativada. Entre em
contato com a pessoa comercial ou a quem foi designada.
Please write your user name: 'Por favor, escreva seu nome de usuário'
A mail has been sent wich you can recover your password: Um e-mail foi enviado para recuperar sua palavra-passe
Menu: Menú

View File

@ -1,6 +1,6 @@
{
"name": "hedera-web",
"version": "1.406.68",
"version": "1.406.69",
"description": "Verdnatura web page",
"license": "GPL-3.0",
"repository": {

View File

@ -0,0 +1,4 @@
{
"Recover password": "Recover password",
"Press on the following link to change your password.": "Press on the following link to change your password."
}

View File

@ -1,2 +0,0 @@
Recover password: Recover password
Press on the following link to change your password.: Press on the following link to change your password.

View File

@ -0,0 +1,4 @@
{
"Recover password": "Restaurar contraseña",
"Press on the following link to change your password.": "Pulsa en el siguiente link para cambiar tu contraseña."
}

View File

@ -1,2 +0,0 @@
Recover password: Restaurar contraseña
Press on the following link to change your password.: Presiona en el siguiente link para cambiar tu contraseña.

View File

@ -0,0 +1,4 @@
{
"Recover password": "Réinitialisation du mot de passe",
"Press on the following link to change your password.": "Appuyez sur le lien suivant pour changer votre mot de passe."
}

View File

@ -0,0 +1,4 @@
{
"Recover password": "Recuperar palavra-passe",
"Press on the following link to change your password.": "Pressione o botão para modificar sua palavra-passe."
}

View File

@ -1,2 +0,0 @@
Recover password: Recuperar palavra-passe
Press on the following link to change your password.: Pressione o botão para modificar sua palavra-passe.

View File

@ -4,7 +4,7 @@ include __DIR__.'/account.php';
class Login extends Vn\Web\JsonRequest {
function run($db) {
if (!$_POST['user'])
if (!$_POST['user'] || !$_POST['password'])
throw new Vn\Web\BadLoginException();
try {

View File

@ -21,6 +21,7 @@ class RecoverPassword extends Vn\Web\JsonRequest {
$report = new Vn\Web\Report($db, 'recover-password', ['url' => $url]);
$report->sendMail($user['email']);
return \Vn\Lib\Locale::get();
return TRUE;
}

View File

@ -21,6 +21,11 @@ class SessionExpiredException extends UserException {}
*/
class BadLoginException extends UserException {}
/**
* Thrown when user credentials are invalid.
*/
class UserDisabledException extends UserException {}
/**
* Thrown when client version is outdated.
*/
@ -131,8 +136,7 @@ abstract class Service {
$user = strtolower($_POST['user']);
$passwordHash = $db->getValue(
'SELECT bcryptPassword FROM account.user
WHERE active AND `name` = #',
'SELECT bcryptPassword FROM account.user WHERE `name` = #',
[$user]
);
@ -190,6 +194,16 @@ abstract class Service {
}
}
if (!$anonymousUser) {
$isActive = $db->getValue(
'SELECT active FROM account.user WHERE `name` = #',
[$user]
);
if (!$isActive)
throw new UserDisabledException();
}
$db->query('CALL account.userLoginWithName(#)', [$user]);
$userChanged = !$anonymousUser