diff --git a/debian/changelog b/debian/changelog index 2ed711f1..3bcf4c78 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.406.68) stable; urgency=low +hedera-web (1.406.69) stable; urgency=low * Initial Release. diff --git a/forms/ecomerce/checkout/locale/ca.yml b/forms/ecomerce/checkout/locale/ca.yml index 7b1ed86c..5846dff5 100644 --- a/forms/ecomerce/checkout/locale/ca.yml +++ b/forms/ecomerce/checkout/locale/ca.yml @@ -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 diff --git a/forms/ecomerce/checkout/locale/en.yml b/forms/ecomerce/checkout/locale/en.yml index cdaafd85..45a54a7b 100644 --- a/forms/ecomerce/checkout/locale/en.yml +++ b/forms/ecomerce/checkout/locale/en.yml @@ -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 diff --git a/forms/ecomerce/checkout/locale/es.yml b/forms/ecomerce/checkout/locale/es.yml index 74069ff4..a699f3e0 100644 --- a/forms/ecomerce/checkout/locale/es.yml +++ b/forms/ecomerce/checkout/locale/es.yml @@ -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 diff --git a/forms/ecomerce/checkout/locale/fr.yml b/forms/ecomerce/checkout/locale/fr.yml index 20f0c290..d729dd01 100644 --- a/forms/ecomerce/checkout/locale/fr.yml +++ b/forms/ecomerce/checkout/locale/fr.yml @@ -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 diff --git a/forms/ecomerce/checkout/locale/pt.yml b/forms/ecomerce/checkout/locale/pt.yml index 800486d7..aa4b59e2 100644 --- a/forms/ecomerce/checkout/locale/pt.yml +++ b/forms/ecomerce/checkout/locale/pt.yml @@ -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 diff --git a/js/hedera/app.js b/js/hedera/app.js index d515a515..8a3bc433 100644 --- a/js/hedera/app.js +++ b/js/hedera/app.js @@ -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(); diff --git a/js/hedera/locale/ca.yml b/js/hedera/locale/ca.yml index 10db75d8..e26b24f7 100644 --- a/js/hedera/locale/ca.yml +++ b/js/hedera/locale/ca.yml @@ -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ú diff --git a/js/hedera/locale/en.yml b/js/hedera/locale/en.yml index e71747dc..bbcce251 100644 --- a/js/hedera/locale/en.yml +++ b/js/hedera/locale/en.yml @@ -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 diff --git a/js/hedera/locale/es.yml b/js/hedera/locale/es.yml index 8cbccf56..04ef133b 100644 --- a/js/hedera/locale/es.yml +++ b/js/hedera/locale/es.yml @@ -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ú diff --git a/js/hedera/locale/fr.yml b/js/hedera/locale/fr.yml index 5564407c..2c752c45 100644 --- a/js/hedera/locale/fr.yml +++ b/js/hedera/locale/fr.yml @@ -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: >- + L’authentification 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 diff --git a/js/hedera/locale/pt.yml b/js/hedera/locale/pt.yml index 7519aec4..326d88be 100644 --- a/js/hedera/locale/pt.yml +++ b/js/hedera/locale/pt.yml @@ -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ú diff --git a/package.json b/package.json index c3b8b8e7..af28444c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.406.68", + "version": "1.406.69", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { diff --git a/reports/recover-password/locale/en.json b/reports/recover-password/locale/en.json new file mode 100644 index 00000000..d6652994 --- /dev/null +++ b/reports/recover-password/locale/en.json @@ -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." +} diff --git a/reports/recover-password/locale/en.yml b/reports/recover-password/locale/en.yml deleted file mode 100644 index 80bb6f88..00000000 --- a/reports/recover-password/locale/en.yml +++ /dev/null @@ -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. diff --git a/reports/recover-password/locale/es.json b/reports/recover-password/locale/es.json new file mode 100644 index 00000000..9525e11c --- /dev/null +++ b/reports/recover-password/locale/es.json @@ -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." +} diff --git a/reports/recover-password/locale/es.yml b/reports/recover-password/locale/es.yml deleted file mode 100644 index 8bd79bc5..00000000 --- a/reports/recover-password/locale/es.yml +++ /dev/null @@ -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. diff --git a/reports/recover-password/locale/fr.json b/reports/recover-password/locale/fr.json new file mode 100644 index 00000000..ac05d0bd --- /dev/null +++ b/reports/recover-password/locale/fr.json @@ -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." +} diff --git a/reports/recover-password/locale/pt.json b/reports/recover-password/locale/pt.json new file mode 100644 index 00000000..0fab61fb --- /dev/null +++ b/reports/recover-password/locale/pt.json @@ -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." +} diff --git a/reports/recover-password/locale/pt.yml b/reports/recover-password/locale/pt.yml deleted file mode 100644 index 3c48c01a..00000000 --- a/reports/recover-password/locale/pt.yml +++ /dev/null @@ -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. diff --git a/rest/core/login.php b/rest/core/login.php index 7ba660c0..b9c58dd2 100644 --- a/rest/core/login.php +++ b/rest/core/login.php @@ -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 { diff --git a/rest/core/recover-password.php b/rest/core/recover-password.php index 9e59d0d7..5eb34352 100644 --- a/rest/core/recover-password.php +++ b/rest/core/recover-password.php @@ -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; } diff --git a/web/service.php b/web/service.php index 0aadb147..b4ba97ca 100644 --- a/web/service.php +++ b/web/service.php @@ -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