Security
Reference
Public
Research
Research evidence behind the ERPat Security user guide — the live module source files (manifest, config, controllers, models, migrations, views, language) read to verify every fact about all four tools, including the Device Management move in from core.
Guide version: r1
Module version: 1.1.0 Updated: 2026-08-28 Estimated time: 14 min 8 views 0% helpful
Administration & Reference
Research
This guide was written from the module's own source, not from assumptions. This
page lists the files that were read and the verified facts each one established — so a future
editor can re-check the guide against reality.
????
Documentation-only. Nothing on this page (or anywhere in modules/Security/docs/)
is served by a route or consumed by PHP — it exists to keep the guide honest and traceable.
Manifest & module metadata
| File | Established |
module.json | Version 1.1.0; type feature; the module owns three tools end-to-end; the four tables and their migrations; the permission list; user_guide: true (docs sync into the User Guide portal); the "core protection layer stays in core" risk note. |
config/module_config.php | module_key = security (matches slug); can_disable = false — the umbrella is locked on. |
Config sidecars
| File | Established |
config/menu.php | Three items — Offsite Access (perm offsite_access + setting module_offsite_access), Locked Accounts (perm locked_accounts, no sub-toggle), Access Logs (perm access_logs + setting module_access); icons fa-globe / fa-shield / fa-history. |
config/default_menu.php | The three items coalesce under a Security header (position 160) shared with the core Device Management feature. |
config/permissions.php | The four RBAC groups and their exact categories/actions; Offsite Access is a dropdown (default_level: specific), Active Sessions & Access Logs are module-level, Locked Accounts is a simple View. Keys unchanged from core (no data migration). |
config/routes.php | The flat URL → controller map, incl. the lowercase routes for the mixed-case/underscore controllers. |
config/system_logs.php | The 14 audit-log event keys and their severities; note that offsite_access:ip_security stays core-owned (emitted by IP-restriction middleware). |
Controllers
| File | Established |
controllers/OffsiteAccess.php | Constructor gates module_offsite_access + offsite_access; save() creates one grant per selected user (multi-select) and writes created:offsite_access; edit/delete write updated/deleted; the list captures old values before update/delete. |
controllers/Locked_Accounts.php | Constructor allows locked_accounts OR core staff_support; clear_attempts() resets disable_login/login_attempts/last_login_attempts, notifies the user, logs unlocked:locked_account; the Active Sessions tab reads live sessions and logs logout:active_session / deleted:active_session. |
controllers/Access_logs.php | The tabbed page shell (index → access/index), the Logs tab (view/list_data), a log_action creator, and delete logging deleted:access_log. |
controllers/Access_devices.php | Auto-generates api_key (UUID) + hashed api_secret on create; generate_new_secret() rotates and logs the critical rotated_secret:access_device (secret never logged); passes = staff allowed through; create/update/delete audited. |
controllers/Access_device_categories.php | Category CRUD gated on access_logs; create/update/delete audited. |
Models & migrations
| File | Established |
models/OffsiteAccessModel.php | The grants model — also read by the core IP-restriction middleware to resolve active off-network exceptions. |
models/Access_devices_model.php, Access_device_categories_model.php, Access_logs_model.php | The Access Device Logs data layer (list/detail/save/delete). |
migrations/…_create_offsite_access_table.php | Columns for offsite_access (uuid, user_id, start/end date, audit block); guarded CREATE-IF-NOT-EXISTS. |
migrations/…_create_access_device_categories_table.php | Columns for access_device_categories (title, detail, status). |
migrations/…_create_access_devices_table.php | Columns for access_devices (api_key, api_secret, device_name, passes, remarks, category_id, labels, status). |
migrations/…_create_access_logs_table.php | Columns for access_logs (device_id, user_id, remarks, timestamp). |
Views & language
| File | Established |
views/access/index.php | The three-tab Access Device Logs shell — Logs · Devices · Categories (ajax-tab, lazy-loaded). |
views/locked_accounts/index.php | The two-tab shell — Browse (Locked Accounts) · Active Sessions. |
views/offsite_access/*, views/access/devices/*, views/active_sessions/* | The grant form, the device forms incl. the credential dialog, the passes list, and the session-viewer modal. |
language/english/security_lang.php | The feature strings and the three nav_desc_* hover descriptions; documents which vocabulary stays core-shared. |
Scope note — what was verified NOT to be here
The guide's central claim — that this module is tooling, not the protection layer — was
confirmed by the manifest's own risk notes and the config comments: guards
(application/guards/), the middleware pipeline
(application/middleware/), the Roles/permissions RBAC editor, and the audit-log
store all remain in core. This module reads the IP grants, contributes permissions, and writes
audit rows — it does not own or gate those core controls.
Next steps