Commit Graph

24 Commits

Author SHA1 Message Date
Isaac Connor
cd33af3ad9 fix: use text input for menu item image icon path instead of file upload
Replace the file upload input with a text input for image icon type,
accepting a URL path relative to the web root. Remove multipart form
encoding, file upload handling, and uploaded file cleanup on reset.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 17:15:46 -04:00
Isaac Connor
47cdb699ba feat: add 'none' icon type, show icons in navbar, fix console column dropdown
- Add 'none' as icon type option to hide icons on individual menu items
- Display custom icons in top navbar to match left sidebar appearance
- Fix console table Columns dropdown showing raw HTML by moving icon/link
  rendering to JS post-init (bootstrap-table captures th innerHTML for
  dropdown labels, so icons must be injected after initialization)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 16:59:40 -04:00
Isaac Connor
7364ba036a feat: add custom icon support to menu items (material, font-awesome, image upload)
Add Icon and IconType columns to Menu_Items table allowing admins to
override the default material icon for each menu entry. Supports three
icon types: Material Icons, Font Awesome 4.7 classes, and uploaded
image files (stored in graphics/menu/).

Add renderMenuIcon() helper and $menuIconOverride global to pass
custom icons through to buildMenuItem() and getOptionsHTML() without
changing every get*HTML() function signature.

Options > Menu tab now shows icon preview, type selector, and
text/file input per row. Upload handler validates file type and
cleans up old images on change or reset.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 15:01:05 -04:00
Isaac Connor
4bd56c22d9 feat: add customizable navbar/sidebar menu via Options > Menu tab
Add Menu_Items table to store per-item enabled state, custom labels,
and sort order. Admins can enable/disable menu items, set custom
labels, and reorder via drag-and-drop in Options > Menu tab.

Refactor hardcoded get*HTML() calls in buildSidebarMenu(),
getNormalNavBarHTML(), and getCollapsedNavBarHTML() to data-driven
renderMenuItems() that reads from DB with fallback for empty table.

Remove deprecated Cycle view from menu (functionality merged into
Watch view). Add reset button to restore default menu configuration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 14:37:14 -04:00
Isaac Connor
e6ace6fcf4 feat: add AUDIT logging level for tracking administrative changes
Add a new AUDIT logging level (-5) between PANIC (-4) and NOLOG (shifted
to -6) across C++, PHP, and Perl loggers. AUDIT entries use code 'AUD'
and syslog priority LOG_NOTICE. They record who changed what, from where,
for monitors, filters, users, config, roles, groups, zones, states,
servers, storage, events, snapshots, control caps, and login/logout.

AUDIT entries have their own retention period (ZM_LOG_AUDIT_DATABASE_LIMIT,
default 1 year) separate from regular log pruning. The log pruning in
zmstats.pl and zmaudit.pl now excludes AUDIT rows from regular pruning
and prunes them independently.

Critical safety: the C++ termination logic is changed from
'if (level <= FATAL)' to 'if (level == FATAL || level == PANIC)' to
prevent AUDIT-level log calls from killing the process.

Includes db migration zm_update-1.39.1.sql to shift any stored NOLOG
config values from -5 to -6.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 18:19:20 -05:00
Isaac Connor
4e60cb96a7 feat: add User Roles feature for reusable permission templates
Add a User Roles system where roles define reusable permission templates.
When a user has a role assigned, the role provides fallback permissions
(user's direct permissions take precedence; role is used when user has 'None').

Database changes:
- Add User_Roles table with same permission fields as Users
- Add Role_Groups_Permissions table for per-role group overrides
- Add Role_Monitors_Permissions table for per-role monitor overrides
- Add RoleId foreign key to Users table

Permission resolution order:
1. User's direct Monitor/Group permissions (if not 'Inherit')
2. Role's Monitor/Group permissions (if user has role)
3. Role's base permission (if user's is 'None')
4. User's base permission (fallback)

Includes:
- PHP models: User_Role, Role_Group_Permission, Role_Monitor_Permission
- Role management UI in Options > Roles tab
- Role selector in user edit form
- REST API endpoints for roles CRUD
- Translation strings for en_gb

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 13:34:27 -05:00
Isaac Connor
0ccc604380 Fix \n\r to \n preg_replace. Must use double quotes to do it right. 2025-10-15 17:37:29 -04:00
Isaac Connor
b3d5fb765b Fix dhcp-option handling 2025-07-30 11:16:09 -05:00
Isaac Connor
bdc6bb58d6 Add a redirect after user delete so that we don't have form resubmission 2023-10-11 13:33:31 -04:00
Isaac Connor
24d6649e98 Log useful output when failure to write dnsmasq.conf and fail to restart dnsmasq 2023-09-21 12:51:37 -04:00
Isaac Connor
6204dfdecc Fix start/stop/restart dnsmasq 2023-05-30 20:47:05 -04:00
Isaac Connor
969baa3891 Convert user from an array to a User object 2023-04-23 12:57:29 -04:00
Isaac Connor
1431eca868 Remove stripslashes when saving config values. The values in REQUEST have not been escaped, so stripslashes is not appropriate. Fixes #3655 2023-01-24 11:47:31 -05:00
Isaac Connor
2f25421cf0 Spacing 2022-05-07 19:39:01 -04:00
Isaac Connor
8cdd96f286 Implement a check on change of language. Make sure that the specified language file exists. Reports errors to UI 2022-02-08 13:29:51 -05:00
Isaac Connor
c99f43205d add parenthesis for safety 2021-02-18 13:47:27 -05:00
Isaac Connor
4b9b2015cb write a note why regnerateAuthHash doesn't work when saving config 2019-06-04 16:30:57 -04:00
Isaac Connor
cc269378cf regenerate auth_hash in session because we might have changed an auth hash setting 2019-06-04 16:27:25 -04:00
Pliable Pixels
a9d601e5ae add ability to revoke tokens and enable/disable APIs per user 2019-05-12 10:56:17 -04:00
Isaac Connor
8dd8888975 Php namespace (#2537)
* experiment with namespaces on the Server class

* experiment with namespaces on the Server class

* Implement the ZM namespace on objects

* Implement the ZM namespace on objects

* Implement the ZM namespace on objects
2019-02-22 09:19:07 -05:00
Matthew Noorenberghe
a97711de89 Replace or sanitize remaining uses of PHP_SELF. Fixes #2446 2019-02-09 22:12:36 -08:00
Isaac Connor
e2f32ab091 Upgrade config saving 2019-01-04 09:43:36 -05:00
Isaac Connor
7ec96655c3 fix missing ! when testing for permission on editing config 2019-01-04 09:37:26 -05:00
Isaac Connor
dbe9817bc8 Split actions.php into individual files per view 2019-01-04 09:26:34 -05:00