From bd6a687772ee3c262bda765a8ac70fe83b29e28b Mon Sep 17 00:00:00 2001 From: Steve Breker Date: Wed, 30 Oct 2024 14:16:52 -0700 Subject: [PATCH] Add OIDC plugin activation control Add the ability for an admin to activate the OIDC plugin in a way that does not require updating the ProjectConfiguration class file, or using the plugin admin interface. If the empty file 'activate-oidc-plugin' is present in the root of the AtoM installation, the OIDC plugin will be enabled. At this point in Symfony's startup, in ProjectConfiguration::setup() config files like app.yml are not yet loaded which is why the presence of an OS file is being used. --- config/ProjectConfiguration.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/ProjectConfiguration.class.php b/config/ProjectConfiguration.class.php index f8b866a8dc..6298d877fb 100644 --- a/config/ProjectConfiguration.class.php +++ b/config/ProjectConfiguration.class.php @@ -48,6 +48,12 @@ public function setup() 'sfPluginAdminPlugin', ]; + // Check if the OIDC plugin should be enabled. + $filePath = 'activate-oidc-plugin'; + if (file_exists($filePath) && filesize($filePath) === 0) { + $plugins[] = 'arOidcPlugin'; + } + $this->enablePlugins($plugins); $this->dispatcher->connect(