mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-09-21 10:15:01 -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
2.1 KiB
PHP
50 lines
2.1 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' => 'Změny oprávnění jsou v tomto demonu zakázány.',
|
|
'error_password_change_disallowed' => 'Změny hesla jsou v tomto demonu zakázány.',
|
|
'error_updating_admin' => '',
|
|
'error_updating_demo_admin' => '',
|
|
'language' => '',
|
|
'login_info' => '',
|
|
'manager' => '',
|
|
'new' => '',
|
|
'none_selected' => '',
|
|
'one_or_multiple' => '',
|
|
'password' => '',
|
|
'password_minlength' => '',
|
|
'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' => '',
|
|
'username_required' => '',
|
|
];
|