From 023bc28e2fbc1d943244642644ed41fe4fbd365c Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Fri, 20 Sep 2024 14:19:02 -0700 Subject: [PATCH 1/2] feat: Add check for enterprise Signed-off-by: Christopher Ng --- lib/public/Util.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/public/Util.php b/lib/public/Util.php index 28da91c9a0f5d..1441d9cff1b91 100644 --- a/lib/public/Util.php +++ b/lib/public/Util.php @@ -73,6 +73,14 @@ public static function getChannel() { return \OCP\Server::get(ServerVersion::class)->getChannel(); } + /** + * @since 31.0.0 + */ + public static function isEnterprise() { + $versionString = Server::get(ServerVersion::class)->getVersionString(); + return str_contains($versionString, 'Enterprise'); + } + /** * check if sharing is disabled for the current user * From bcbe6f83eda8938698808b580ebfe8ea574d8540 Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Fri, 20 Sep 2024 14:19:02 -0700 Subject: [PATCH 2/2] feat: Provide enterprise check in initial state Signed-off-by: Christopher Ng --- lib/private/Template/JSConfigHelper.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/private/Template/JSConfigHelper.php b/lib/private/Template/JSConfigHelper.php index 44563f2938c35..a65eaacbd2907 100644 --- a/lib/private/Template/JSConfigHelper.php +++ b/lib/private/Template/JSConfigHelper.php @@ -159,6 +159,7 @@ public function getConfig(): string { 'version' => implode('.', $this->serverVersion->getVersion()), 'versionstring' => $this->serverVersion->getVersionString(), 'enable_non-accessible_features' => $this->config->getSystemValueBool('enable_non-accessible_features', true), + 'is_enterprise' => Util::isEnterprise(), ]; $array = [