From b1f4c41310d4bbb4ebc1b16954b7453871b5d0e7 Mon Sep 17 00:00:00 2001 From: Jonathan Miller <230051081+jmiller-moko@users.noreply.github.com> Date: Tue, 7 Apr 2026 14:40:07 -0500 Subject: [PATCH] feat: action log registration, Moko theme defaults, security defaults - Register plg_system_mokowaas in #__action_logs_extensions on install so emergency access events appear as filterable in Action Logs UI - Unregister on uninstall - Set Moko brand colors as defaults: navy #1a2744, dark #0f1b2d, accent green #2ecc71 - Force HTTPS default: Yes (was No) - Admin session timeout default: 60 minutes (was 0/disabled) Co-Authored-By: Claude Opus 4.6 (1M context) --- src/mokowaas.xml | 12 +++++------ src/script.php | 54 +++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 59 insertions(+), 7 deletions(-) diff --git a/src/mokowaas.xml b/src/mokowaas.xml index aef68bdf..e52c3c5f 100644 --- a/src/mokowaas.xml +++ b/src/mokowaas.xml @@ -193,19 +193,19 @@ + default="#1a2744" /> + default="#0f1b2d" /> + default="#1a2744" /> + default="#2ecc71" /> - @@ -269,7 +269,7 @@ + default="60" hint="Minutes (0 = Joomla default)" /> diff --git a/src/script.php b/src/script.php index 07fc062e..561bd3a0 100644 --- a/src/script.php +++ b/src/script.php @@ -125,6 +125,7 @@ class plgSystemMokoWaaSInstallerScript implements InstallerScriptInterface $this->installLanguageOverrides(); $this->updateLoginSupportUrls(); $this->updateAtumBranding(); + $this->registerActionLogExtension(); } return true; @@ -169,8 +170,8 @@ class plgSystemMokoWaaSInstallerScript implements InstallerScriptInterface */ public function uninstall(InstallerAdapter $adapter): bool { - // Remove language overrides on uninstall $this->uninstallLanguageOverrides(); + $this->unregisterActionLogExtension(); return true; } @@ -437,6 +438,57 @@ class plgSystemMokoWaaSInstallerScript implements InstallerScriptInterface ); } + /** + * Register the plugin in #__action_logs_extensions so it appears + * as a filterable extension in System > Action Logs. + * + * @return void + * + * @since 02.00.00 + */ + private function registerActionLogExtension() + { + $db = Factory::getDbo(); + $query = $db->getQuery(true) + ->select('COUNT(*)') + ->from($db->quoteName('#__action_logs_extensions')) + ->where($db->quoteName('extension') . ' = ' + . $db->quote('plg_system_mokowaas')); + + $db->setQuery($query); + + if ((int) $db->loadResult() > 0) + { + return; + } + + $row = (object) ['extension' => 'plg_system_mokowaas']; + $db->insertObject('#__action_logs_extensions', $row); + + Factory::getApplication()->enqueueMessage( + 'Registered MokoWaaS in Action Logs.', 'message' + ); + } + + /** + * Remove the plugin from #__action_logs_extensions on uninstall. + * + * @return void + * + * @since 02.00.00 + */ + private function unregisterActionLogExtension() + { + $db = Factory::getDbo(); + $db->setQuery( + $db->getQuery(true) + ->delete($db->quoteName('#__action_logs_extensions')) + ->where($db->quoteName('extension') . ' = ' + . $db->quote('plg_system_mokowaas')) + ); + $db->execute(); + } + /** * Remove only MokoWaaS overrides from Joomla's global override files. *