mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-09-22 02:34:59 -04:00
fix(sales): gate per-record endpoints behind reports_sales grant (REDACTED) Cashiers holding only the base `sales` grant could reach per-sale endpoints (getRow, getEdit, postSave, getReceipt, getInvoice, getSendPdf, getSendReceipt) that require `reports_sales`. getManage() enforced this at the list level, but individual endpoints did not re-check. Regression tests added. Auth: - Introduce `IsLoggedIn` filter to centralize login checks across controllers - Replace custom `AccessDeniedRedirectException` with built-in `RedirectException` Employees: - Add `DISALLOW_PASSWORD_CHANGE` and `DISALLOW_GRANT_CHANGE` env vars to restrict credential and permission changes in locked-down environments - Extract `hasGrantsChanged()` to streamline `postSave` Refactor: - Rename snake_case variables to camelCase in Sales, Items, and Employees controllers for PSR-12 compliance - Use explicit `db_connect()` for transaction clarity in Items controller Fixes: - SMTP config entries fall back to defaults via null coalescing - Migration uses `DROP FOREIGN KEY` instead of `DROP CONSTRAINT` - Password hash upgrade only sets session on successful `hash_version` update - Correct lang key for unknown error in Module model Language: - Translate `error_grant_change_disallowed` / `error_password_change_disallowed` across all 44 supported locales with => alignment matching en reference - Fix "cannot be deleted" messages and misc typos across ~15 language files Tests: - Bootstrap seeder only once in ItemsCsvImportTest; close connection after - Restore `DISALLOW_GRANT_CHANGE` in teardown to prevent side effects - Use `uniqid()` for test user data to avoid collisions Signed-off-by: 17935339+objecttothis@users.noreply.github.com
50 lines
4.4 KiB
PHP
50 lines
4.4 KiB
PHP
<?php
|
|
|
|
return [
|
|
'administrator' => '',
|
|
'basic_information' => 'Информация',
|
|
'cannot_be_deleted' => 'Не удалось удалить выбранных сотрудников, один или несколько из них обработали продажи или вы пытаетесь удалить свою учетную запись.',
|
|
'change_employee' => '',
|
|
'change_password' => 'Смена пароля',
|
|
'clerk' => '',
|
|
'commission' => '',
|
|
'confirm_delete' => 'Вы уверены, что хотите удалить выбранных сотрудников?',
|
|
'confirm_restore' => 'Вы уверены, что хотите восстановить выбранных сотрудников?',
|
|
'current_password' => 'Текущий пароль',
|
|
'current_password_invalid' => 'Текущий пароль введен неверно.',
|
|
'employee' => 'Сотрудник',
|
|
'error_adding_updating' => 'Ошибка при добавлении/обновлении сотрудника.',
|
|
'error_deleting_admin' => '',
|
|
'error_deleting_demo_admin' => 'Вы не можете удалить демо-администратора.',
|
|
'error_grant_change_disallowed' => 'Изменения прав доступа отключены в этой демонстрации.',
|
|
'error_password_change_disallowed' => 'Изменение пароля отключено в этой демонстрации.',
|
|
'error_updating_admin' => '',
|
|
'error_updating_demo_admin' => 'Вы не можете изменить демо-администратора.',
|
|
'language' => 'Язык',
|
|
'login_info' => 'Вход',
|
|
'manager' => '',
|
|
'new' => 'Новый сотрудник',
|
|
'none_selected' => 'Вы не выбрали ни одного сотрудника для удаления.',
|
|
'one_or_multiple' => 'сотрудник(и)',
|
|
'password' => 'Пароль',
|
|
'password_minlength' => 'Пароль должен быть не менее 8 символов.',
|
|
'password_must_match' => 'Пароли не совпадают.',
|
|
'password_not_must_match' => 'Текущий пароль и новый пароль должны быть уникальными.',
|
|
'password_required' => 'Ввод пароля - обязателен.',
|
|
'permission_desc' => 'Отметьте флажками ниже, чтобы предоставить доступ к модулям.',
|
|
'permission_info' => 'Права доступа',
|
|
'repeat_password' => 'Повтор пароля',
|
|
'subpermission_required' => 'Добавьте хотя бы одно разрешение для каждого модуля.',
|
|
'successful_adding' => 'Сотрудник успешно создан.',
|
|
'successful_change_password' => 'Смена пароля прошла успешно.',
|
|
'successful_deleted' => 'Успешно удалено',
|
|
'successful_updating' => 'Информация о сотруднике успешно обновлена',
|
|
'system_language' => 'Язык системы',
|
|
'unsuccessful_change_password' => 'Не удалось изменить пароль.',
|
|
'update' => 'Обновление сотрудника',
|
|
'username' => 'Имя пользователя',
|
|
'username_duplicate' => 'Имя пользователя сотрудника уже используется. Пожалуйста, выберите другое.',
|
|
'username_minlength' => 'Имя пользователя должно быть не менее 5 символов.',
|
|
'username_required' => 'Имя пользователя - обязательное поле для заполнения.',
|
|
];
|