diff --git a/CHANGELOG.md b/CHANGELOG.md index b353789b..47792ec0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added +- Alias offline bypass: aliases with offline=No override Joomla's global offline setting, allowing access via alias domain while main site is down +- CI: auto-release uses stream tag `stable` instead of version tag `vXX` + ### Planned - License/subscription check - System email template branding (DB approach) diff --git a/src/packages/plg_system_mokowaas/Extension/MokoWaaS.php b/src/packages/plg_system_mokowaas/Extension/MokoWaaS.php index 62e935b1..302b026a 100644 --- a/src/packages/plg_system_mokowaas/Extension/MokoWaaS.php +++ b/src/packages/plg_system_mokowaas/Extension/MokoWaaS.php @@ -2944,25 +2944,33 @@ class MokoWaaS extends CMSPlugin } // Offline: use Joomla's native offline mode for frontend requests - if (!empty($alias->offline) && (string) $alias->offline === '1' - && $this->app->isClient('site')) + if ($this->app->isClient('site')) { - // Allow health API to still respond - if ($this->app->input->get('mokowaas', '') !== '') + if (!empty($alias->offline) && (string) $alias->offline === '1') { - return; + // Allow health API to still respond + if ($this->app->input->get('mokowaas', '') !== '') + { + return; + } + + // Set custom offline message if provided + $message = $alias->offline_message ?? ''; + + if (!empty($message)) + { + $this->app->getConfig()->set('offline_message', $message); + } + + // Enable Joomla's native offline mode + $this->app->getConfig()->set('offline', 1); } - - // Set custom offline message if provided - $message = $alias->offline_message ?? ''; - - if (!empty($message)) + else { - $this->app->getConfig()->set('offline_message', $message); + // Alias is NOT offline — override Joomla's global offline setting + // This allows access via the alias domain even when the main site is offline + $this->app->getConfig()->set('offline', 0); } - - // Enable Joomla's native offline mode — renders through the template's offline.php - $this->app->getConfig()->set('offline', 1); } }