Security Reference Public

Reference

Technical reference for the ERPat Security module — controllers, routes, models, views, migrations, database tables and columns, permission keys, menu entries, and system-audit-log event keys for Device Management, Offsite Access, Locked Accounts, Active Sessions, and Access Device Logs.

Guide version: r1 Module version: 1.1.0 Updated: 2026-08-28 Estimated time: 14 min 10 views 0% helpful
You are viewing version r1 of this guide. View the current version
Administration & Reference

Reference

The data-and-screen reference for the Security module — controllers, routes, tables, permission keys, menu entries, and audit-log events. Everything here is drawn from the live module source; see Research for the exact files.

Controllers

ControllerToolKey methods
OffsiteAccess Offsite Access index, modalForm, save, listData, delete
Locked_Accounts Locked Accounts + Active Sessions index, locked_accounts_view, active_sessions_view, list_data, clear_attempts, list_sessions_data, view_sessions_modal, logout_user_all_devices, delete_session, get_session_statistics
Access_logs Access Device Logs — Logs tab (page shell) index (tabbed shell), view, list_data, log_action, delete
Access_devices Access Device Logs — Devices tab index, list_data, modal_form, modal_form_credential, generate_new_secret, save, delete, pass_list
Access_device_categories Access Device Logs — Categories tab index, list_data, modal_form, save, delete

All five extend App_Controller (staff, session-authenticated). Each constructor gates access: Offsite Access on module_offsite_access + offsite_access; the two Access Device controllers on module_access + access_logs; Locked Accounts on locked_accounts (or the core staff_support).

Routes

Declared in modules/Security/config/routes.php (mixed-case/underscore controllers need explicit lowercase routes). The (:any) catch-alls map to controller methods.

URLResolves to
offsite_accessOffsiteAccess/index
offsite_access/(:any)OffsiteAccess/$1
locked_accountsLocked_Accounts/index
locked_accounts/(:any) · /(:any)/(:any)Locked_Accounts/$1 · $1/$2
access_logs · access_logs/(:any)Access_logs/index · $1
access_devices · access_devices/(:any)Access_devices/index · $1
access_device_categories · …/(:any)Access_device_categories/index · $1

Database tables

Four tables, all shipping in the base-install schema and re-created idempotently by the module migrations (tracked in migrations_security). All carry the standard updated_at + deleted audit columns.

offsite_access

ColumnTypeNotes
idint unsignedPK
uuidvarchar(36)Per-grant UUID (v4)
user_idintStaff member granted the window
start_date / end_datedateThe exception window
date_createddatetimeUTC create time
created_byintGranting admin
updated_at · deletedtimestamp · tinyintAudit + soft delete

access_device_categories

ColumnTypeNotes
idint unsignedPK
titlevarchar(150)Category name
detailtextOptional description
statustinyint1 = active
updated_at · deletedtimestamp · tinyintAudit + soft delete

access_devices

ColumnTypeNotes
idint unsignedPK
api_keyvarchar(36)UUID the device presents
api_secretvarchar(120)Hashed secret (never shown/logged in clear)
device_namevarchar(36)Display name
passestextComma-separated staff user IDs allowed through
remarkstextOptional notes
category_idintFK-by-value to access_device_categories
labelstextLabels
statustinyint1 = active
updated_at · deletedtimestamp · tinyintAudit + soft delete

access_logs

ColumnTypeNotes
idint unsignedPK
device_idintWhich device recorded the event
user_idintWho accessed
remarkstextOptional (e.g. entry / exit)
timestampdatetimeUTC event time (shown local)
updated_at · deletedtimestamp · tinyintAudit + soft delete
ℹ️
Locked Accounts / Active Sessions has no dedicated table. The Locked Accounts tab reads the failed-attempt columns on users (disable_login, login_attempts, last_login_attempts); the Active Sessions tab reads the core session store (ci_sessions) through the core session helper.

Permission keys

KeyRoles-editor group / actionStyle
offsite_accessSecurity: Offsite Access / AccessDropdown (all / specific)
offsite_access_create · _update · _deleteSecurity: Offsite Access / Create · Edit · RemoveChild
locked_accountsSecurity: Locked Accounts / ViewSimple (no children)
active_sessionsSecurity: Active Sessions / ManageModule-level
active_sessions_create · _update · _deleteSecurity: Active Sessions / Create · Edit · RemoveChild
access_logsSecurity: Access Logs / EnabledModule-level
access_logs_create · _update · _deleteSecurity: Access Logs / Create · Edit · RemoveChild

Not owned here: staff_support (Staffing) and api_clients (Security: API Clients) remain core-owned; the core IP-restriction block event offsite_access:ip_security is emitted by core middleware, not this module.

Settings & menu

SettingRole
module_securityUmbrella, seeded on, can_disable=false
module_offsite_accessSub-toggle for the Offsite Access item
module_accessSub-toggle for the Access Logs item

Menu entries (config/menu.php): Offsite Access (fa-globe) · Locked Accounts (fa-shield) · Access Logs (fa-history), all under the coalesced Security header (default_menu.php, position 160).

Audit-log events

Keyed action:component in config/system_logs.php, merged into the core audit-log config. Written on every sensitive mutation.

Event keySeverityMeaning
created:offsite_accesswarningOffsite window granted
updated:offsite_accesswarningOffsite window updated
deleted:offsite_accesswarningOffsite window revoked
unlocked:locked_accountwarningAccount unlocked (attempts cleared)
logout:active_sessionwarningAll sessions terminated for a user
deleted:active_sessionwarningSingle session terminated
created:access_deviceinfoDevice registered
updated:access_deviceinfoDevice updated
deleted:access_devicewarningDevice deleted
rotated_secret:access_devicecriticalDevice API secret regenerated
created:access_device_categoryinfoCategory created
updated:access_device_categoryinfoCategory updated
deleted:access_device_categorywarningCategory deleted
deleted:access_logwarningAccess log entry deleted

Next steps

Report a content problem