From 1b38ce9a073390bb610e97b1e43db04a16ef71ad Mon Sep 17 00:00:00 2001 From: Jonathan Miller <230051081+jmiller-moko@users.noreply.github.com> Date: Tue, 7 Apr 2026 15:55:38 -0500 Subject: [PATCH] =?UTF-8?q?feat:=20lock=20plugin=20on=20install=20?= =?UTF-8?q?=E2=80=94=20cannot=20be=20disabled=20or=20uninstalled?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sets both locked=1 and protected=1 in #__extensions on install. Prevents tenants from disabling or uninstalling the plugin through the Extension Manager. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/script.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/script.php b/src/script.php index 74653a4..f4a2aa3 100644 --- a/src/script.php +++ b/src/script.php @@ -142,12 +142,14 @@ class plgSystemMokoWaaSInstallerScript implements InstallerScriptInterface */ public function install(InstallerAdapter $adapter): bool { - // Auto-enable the plugin on first install + // Auto-enable and lock the plugin on first install $db = Factory::getDbo(); $db->setQuery( $db->getQuery(true) ->update($db->quoteName('#__extensions')) ->set($db->quoteName('enabled') . ' = 1') + ->set($db->quoteName('locked') . ' = 1') + ->set($db->quoteName('protected') . ' = 1') ->where($db->quoteName('element') . ' = ' . $db->quote('mokowaas')) ->where($db->quoteName('folder') . ' = '