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
3.1 KiB
PHP
50 lines
3.1 KiB
PHP
<?php
|
|
|
|
return [
|
|
'administrator' => '',
|
|
'basic_information' => 'Information',
|
|
'cannot_be_deleted' => 'Unable to delete selected employee(s), one or more of the has processed sales or you are trying to delete your account.',
|
|
'change_employee' => '',
|
|
'change_password' => 'Change Password',
|
|
'clerk' => '',
|
|
'commission' => '',
|
|
'confirm_delete' => 'Are you sure you want to delete the selected employee(s)?',
|
|
'confirm_restore' => 'Are you sure you want to restore selected employee(s)?',
|
|
'current_password' => 'Current Password',
|
|
'current_password_invalid' => 'Current Password is invalid.',
|
|
'employee' => 'Employee',
|
|
'error_adding_updating' => 'Employee add or update failed.',
|
|
'error_deleting_admin' => '',
|
|
'error_deleting_demo_admin' => 'You can not delete the demo admin user.',
|
|
'error_grant_change_disallowed' => 'Rettighedsændringer er deaktiveret i denne demo.',
|
|
'error_password_change_disallowed' => 'Adgangskodeændringer er deaktiveret i denne demo.',
|
|
'error_updating_admin' => '',
|
|
'error_updating_demo_admin' => 'You can not change the demo admin user.',
|
|
'language' => 'Language',
|
|
'login_info' => 'Login',
|
|
'manager' => '',
|
|
'new' => 'New Employee',
|
|
'none_selected' => 'You have not selected any employee(s) to delete.',
|
|
'one_or_multiple' => 'employee(s)',
|
|
'password' => 'Password',
|
|
'password_minlength' => 'Password must be at least 8 characters in length.',
|
|
'password_must_match' => 'Passwords do not match.',
|
|
'password_not_must_match' => 'Current password and new password must be unique.',
|
|
'password_required' => 'Password is required.',
|
|
'permission_desc' => 'Check the boxes below to grant access to modules.',
|
|
'permission_info' => 'Permissions',
|
|
'repeat_password' => 'Password Again',
|
|
'subpermission_required' => 'Add at least one grant for each module.',
|
|
'successful_adding' => 'Employee add successful.',
|
|
'successful_change_password' => 'Password change successful.',
|
|
'successful_deleted' => 'You have successfully deleted',
|
|
'successful_updating' => 'You have successfully updated employee',
|
|
'system_language' => 'System Language',
|
|
'unsuccessful_change_password' => 'Password change failed.',
|
|
'update' => 'Update Employee',
|
|
'username' => 'Username',
|
|
'username_duplicate' => '',
|
|
'username_minlength' => 'Username must be at least 5 characters in length.',
|
|
'username_required' => 'Username is a required field.',
|
|
];
|