summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2020-03-10 19:39:03 +0100
committerGitHub <noreply@github.com>2020-03-10 19:39:03 +0100
commit5e4ee4dc59c3542cdee6c72209c8d75bcd977399 (patch)
tree4abe7ae75a7cf818eccd5abfb5980f18db4bdcec /lib
parentc82c1da8f763d7b2e2fff2df1e37664b54698468 (diff)
parentdbd63222c890127307a0106db5fda35b74929523 (diff)
downloadnextcloud-server-5e4ee4dc59c3542cdee6c72209c8d75bcd977399.tar.gz
nextcloud-server-5e4ee4dc59c3542cdee6c72209c8d75bcd977399.zip
Merge pull request #19812 from nextcloud/enh/noid/subscription-config
Add config flag for subscription and hide server development notice
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Support/Subscription/Registry.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/private/Support/Subscription/Registry.php b/lib/private/Support/Subscription/Registry.php
index dfcff8ff96a..f0d946a2911 100644
--- a/lib/private/Support/Subscription/Registry.php
+++ b/lib/private/Support/Subscription/Registry.php
@@ -27,6 +27,7 @@ declare(strict_types=1);
namespace OC\Support\Subscription;
+use OCP\IConfig;
use OCP\Support\Subscription\Exception\AlreadyRegisteredException;
use OCP\Support\Subscription\IRegistry;
use OCP\Support\Subscription\ISubscription;
@@ -37,6 +38,13 @@ class Registry implements IRegistry {
/** @var ISubscription */
private $subscription = null;
+ /** @var IConfig */
+ private $config;
+
+ public function __construct(IConfig $config) {
+ $this->config = $config;
+ }
+
/**
* Register a subscription instance. In case it is called multiple times the
* first one is used.
@@ -71,6 +79,11 @@ class Registry implements IRegistry {
* @since 17.0.0
*/
public function delegateHasValidSubscription(): bool {
+ // Allow overwriting this manually for environments where the subscription information cannot be fetched
+ if ($this->config->getSystemValueBool('has_valid_subscription')) {
+ return true;
+ }
+
if ($this->subscription instanceof ISubscription) {
return $this->subscription->hasValidSubscription();
}