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
5.4 KiB
PHP
50 lines
5.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' => 'จำเป็นต้องระบุชื่อผู้ใช้งาน',
|
|
];
|