OPNSense/core df34601. plist, src/opnsense/mvc/app/models/OPNsense/Base/Menu MenuSystem.php MenuContainer.php

MVC: add support for pluggable dynamic menu items and move some existing parts out of the MenuSystem class

In most cases we use static menu registartions, but there are exceptions which depend on interfaces for example.
While looking at https://github.com/opnsense/core/pull/10033, a longer standing wish came up again, which is the reason to add this support right now. It also helps in removing some legacy components for good via plugins.

To register new menu items, the following pattern may be used:

* In your model, derive a Menu class from MenuContainer
* implement a method collect() which should add new menu items via the appendItem() {bound to appendItem in MenuSystem}

Always try to minimize the amount of code inside these plugins as this code will be executed on each page load.
DeltaFile
+59-163src/opnsense/mvc/app/models/OPNsense/Base/Menu/MenuSystem.php
+129-0src/opnsense/mvc/app/models/OPNsense/Interfaces/Menu/Menu.php
+98-0src/opnsense/mvc/app/models/OPNsense/Firewall/Menu/Menu.php
+49-0src/opnsense/mvc/app/models/OPNsense/Base/Menu/MenuContainer.php
+3-0plist
+338-1635 files

OPNSense/core e75f212src/opnsense/mvc/app/library/OPNsense/Auth LDAP.php

system: escape LDAP username during search

Reported by: Matt Andreko
PR: GHSA-jpm7-f59c-mp54

(cherry picked from commit 016f66cb4620cd48183fa97843f343bb71813c6e)
DeltaFile
+3-2src/opnsense/mvc/app/library/OPNsense/Auth/LDAP.php
+3-21 files

OPNSense/core 016f66csrc/opnsense/mvc/app/library/OPNsense/Auth LDAP.php

system: escape LDAP username during search

Reported by: Matt Andreko
PR: GHSA-jpm7-f59c-mp54
DeltaFile
+3-2src/opnsense/mvc/app/library/OPNsense/Auth/LDAP.php
+3-21 files

OPNSense/core a5e151asrc/opnsense/mvc/app/controllers/OPNsense/Base ApiMutableModelControllerBase.php

mvc: a bit of spring cleaning for setActionHook(), result is never used and throwing a UserException is preferred in cases where can't pin a message to a field. closes https://github.com/opnsense/core/pull/10046

(cherry picked from commit 7397ce01770435b26706c644b2cb20110056bbe6)
DeltaFile
+9-13src/opnsense/mvc/app/controllers/OPNsense/Base/ApiMutableModelControllerBase.php
+9-131 files

OPNSense/core 17ead5esrc/opnsense/mvc/app/views/layout_partials base_apply_button.volt, src/opnsense/www/js opnsense_bootgrid.js opnsense_ui.js

ui: color box like old legacy apply as an additional idea
DeltaFile
+13-16src/opnsense/mvc/app/views/layout_partials/base_apply_button.volt
+1-1src/opnsense/www/js/opnsense_bootgrid.js
+1-0src/opnsense/www/js/opnsense_ui.js
+15-173 files

OPNSense/core 1b5cf9asrc/opnsense/mvc/app/views/layout_partials base_apply_button.volt, src/opnsense/www/js opnsense_bootgrid.js opnsense_ui.js

ui: use space in apply box for the apply reminder

We could extend this a bit if we want to go this way.
It's the best way to use existing space and move the
message to where it matters most -- the apply button
itself.

I'm not entirely sure about coloring.  We could instead
make the whole box change color similar to what alerts
are doing.
DeltaFile
+1-19src/opnsense/www/js/opnsense_bootgrid.js
+8-9src/opnsense/mvc/app/views/layout_partials/base_apply_button.volt
+2-0src/opnsense/www/js/opnsense_ui.js
+11-283 files

OPNSense/core 546086dsrc/opnsense/mvc/app/controllers/OPNsense/Hostdiscovery/forms general.xml, src/opnsense/mvc/app/models/OPNsense/Hostdiscovery Hostwatch.xml

Interfaces: Neighbors: Automatic Discovery - configurable cleanups

PR: https://github.com/opnsense/core/issues/9953

(cherry picked from commit 26b9169d44d6e897732e5ff40fdfde1b4197ce97)
(cherry picked from commit a7034c0ede0edbb89c589d9cc47f97410d03c464)
(cherry picked from commit cdf172056fb579e7af7834a619bdaf39d5fe5024)
DeltaFile
+14-5src/opnsense/service/templates/OPNsense/Hostdiscovery/rc.conf.d
+12-0src/opnsense/mvc/app/controllers/OPNsense/Hostdiscovery/forms/general.xml
+6-0src/opnsense/mvc/app/models/OPNsense/Hostdiscovery/Hostwatch.xml
+32-53 files

OPNSense/core a663c3asrc/etc/inc/plugins.inc.d radvd.inc

radvd: fix PHP warning for previous
DeltaFile
+1-1src/etc/inc/plugins.inc.d/radvd.inc
+1-11 files

OPNSense/core cdf1720src/opnsense/service/templates/OPNsense/Hostdiscovery rc.conf.d

hostwatch: restructure rc.conf to avoid mistakes

This adds one configurable command option per separate if-block.
DeltaFile
+14-7src/opnsense/service/templates/OPNsense/Hostdiscovery/rc.conf.d
+14-71 files

OPNSense/core b63f8b6src/opnsense/mvc/app/views/layout_partials base_apply_button.volt, src/opnsense/www/js opnsense_bootgrid.js opnsense_ui.js

ui: use space in apply box for the apply reminder

We could extend this a bit if we want to go this way.
It's the best way to use existing space and move the
message to where it matters most -- the apply button
itself.

I'm not entirely sure about coloring.  We could instead
make the whole box change color similar to what alerts
are doing.
DeltaFile
+1-19src/opnsense/www/js/opnsense_bootgrid.js
+8-8src/opnsense/mvc/app/views/layout_partials/base_apply_button.volt
+2-0src/opnsense/www/js/opnsense_ui.js
+11-273 files

OPNSense/core 5a5350esrc/opnsense/mvc/app/controllers/OPNsense/Core/Api DashboardController.php

dashboard: throw UserException when size limit reached on save. Closes https://github.com/opnsense/core/issues/10096
DeltaFile
+3-2src/opnsense/mvc/app/controllers/OPNsense/Core/Api/DashboardController.php
+3-21 files

OPNSense/core 8b5a768src/opnsense/www/js/widgets Traffic.js

widgets: fix Traffic.js initialization race condition (#10099)
DeltaFile
+3-3src/opnsense/www/js/widgets/Traffic.js
+3-31 files

OPNSense/core 477451dsrc/opnsense/mvc/app/controllers/OPNsense/Syslog/Api SettingsController.php

mvc: clear unused inputs in syslog controller
DeltaFile
+0-2src/opnsense/mvc/app/controllers/OPNsense/Syslog/Api/SettingsController.php
+0-21 files

OPNSense/core 4f7fccdScripts class-import.sh

Scripts: add instanceof syntax for import linter
DeltaFile
+4-1Scripts/class-import.sh
+4-11 files

OPNSense/core 7cfb03bsrc/opnsense/www/js opnsense_menusystem.js

mvc: MenuSystem - tweak JavaScript wrapper to match server-side breadcrumb format (#10101)
DeltaFile
+1-1src/opnsense/www/js/opnsense_menusystem.js
+1-11 files

OPNSense/core d092f74src/opnsense/mvc/app/models/OPNsense/Firewall Category.php, src/opnsense/mvc/app/models/OPNsense/Interfaces Bridge.php

mvc: remove Util imports where not needed
DeltaFile
+20-23src/opnsense/mvc/app/models/OPNsense/Firewall/Category.php
+5-1src/opnsense/mvc/app/models/OPNsense/Interfaces/Bridge.php
+25-242 files

OPNSense/core 267f5a4src/etc/inc/plugins.inc.d radvd.inc, src/opnsense/mvc/app/controllers/OPNsense/Radvd/forms dialogEntry.xml

radvd: allow user controlled hop limit

PR: #9688
DeltaFile
+10-0src/opnsense/mvc/app/controllers/OPNsense/Radvd/forms/dialogEntry.xml
+8-1src/opnsense/mvc/app/models/OPNsense/Radvd/Radvd.xml
+1-0src/etc/inc/plugins.inc.d/radvd.inc
+19-13 files

OPNSense/core a7034c0Scripts class-import.sh, src/opnsense/mvc/app/models/OPNsense/Hostdiscovery Hostwatch.xml

src: whitespace sweep
DeltaFile
+2-2src/opnsense/mvc/app/models/OPNsense/Hostdiscovery/Hostwatch.xml
+1-1Scripts/class-import.sh
+3-32 files

OPNSense/core faa7dabsrc/etc/inc util.inc, src/etc/inc/plugins.inc.d pf.inc

system: audit staticroute' config access for #10027
DeltaFile
+2-3src/etc/inc/util.inc
+1-4src/etc/inc/plugins.inc.d/pf.inc
+1-0src/opnsense/mvc/app/controllers/OPNsense/Routing/Api/SettingsController.php
+0-1src/opnsense/mvc/app/models/OPNsense/Firewall/Alias.php
+4-84 files

OPNSense/core 700d6a0src/opnsense/mvc/app/library/OPNsense/Core ConfigMaintenance.php, src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes PortFieldTest.php

src: a few more samples for import linter
DeltaFile
+0-3src/opnsense/mvc/app/library/OPNsense/Core/ConfigMaintenance.php
+1-1src/opnsense/scripts/captiveportal/process_accounting_messages.php
+0-1src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/PortFieldTest.php
+1-53 files

OPNSense/core 2c74e4eScripts class-import.sh

Scripts: tweak pattern matching related to #10052
DeltaFile
+3-9Scripts/class-import.sh
+3-91 files

OPNSense/core acab676src/opnsense/mvc/script run_validations.php

mvc: obvious linter complaint
DeltaFile
+0-2src/opnsense/mvc/script/run_validations.php
+0-21 files

OPNSense/core bbf6ee6src/www firewall_rule_lookup.php

firewall: unused vars/imports
DeltaFile
+0-4src/www/firewall_rule_lookup.php
+0-41 files

OPNSense/core e6726baMk lint.mk, Scripts class-import.sh

lint: Add linter that finds unused imports in php classes
DeltaFile
+49-0Scripts/class-import.sh
+4-1Mk/lint.mk
+53-12 files

OPNSense/core aaf9a1csrc/opnsense/mvc/app/controllers/OPNsense/IDS/Api SettingsController.php, src/opnsense/mvc/app/controllers/OPNsense/Monit/Api SettingsController.php

mvc: Remove UIModelGrid imports in IDS, Monit, Syslog SettingsController, unused
DeltaFile
+0-1src/opnsense/mvc/app/controllers/OPNsense/Syslog/Api/SettingsController.php
+0-1src/opnsense/mvc/app/controllers/OPNsense/IDS/Api/SettingsController.php
+0-1src/opnsense/mvc/app/controllers/OPNsense/Monit/Api/SettingsController.php
+0-33 files

OPNSense/core fd780bbsrc/etc/inc/plugins.inc.d radvd.inc

radvd: make a note for dev/debug and closes #10048

Ideally this should be refactored a bit to flush the configuration
regardless of enabled state, but the legacy code has no separate
template flush so it is tied to service (re)start and we are going
to leave it at a note.
DeltaFile
+1-0src/etc/inc/plugins.inc.d/radvd.inc
+1-01 files

OPNSense/core 79ba2dasrc/etc/inc/plugins.inc.d radvd.inc

radvd: refactor and put eligible-test back #10048

Not super happy but make $radvdifs use simpler since $manuallist now
does exclusion and we don't use the values saved in the former anyway.
DeltaFile
+10-10src/etc/inc/plugins.inc.d/radvd.inc
+10-101 files

OPNSense/core 7116a1fsrc/etc/inc/plugins.inc.d radvd.inc

radvd: split lists, easier to read and less code #10048
DeltaFile
+4-3src/etc/inc/plugins.inc.d/radvd.inc
+4-31 files

OPNSense/core 72ccc1esrc/etc/inc/plugins.inc.d radvd.inc

radvd: allow to start without primary IPv6 for #10048

Reshuffle the code a little to make it (a bit) more obvious this is
safe to assume and working confirmed by automatic mode already.

Since we have full control via MVC enable/disable this is fine now.
DeltaFile
+16-24src/etc/inc/plugins.inc.d/radvd.inc
+16-241 files

OPNSense/core 816271dsrc/opnsense/www/js opnsense_bootgrid.js

bootgrid: shorten previous

(cherry picked from commit 7a6a581209024b2b08a846c3699330a067e611f1)
DeltaFile
+2-2src/opnsense/www/js/opnsense_bootgrid.js
+2-21 files