]> source.dussan.org Git - nextcloud-server.git/commitdiff
Do not show 'Get your own free account' on services under subscription 17674/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Fri, 25 Oct 2019 11:54:39 +0000 (13:54 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Fri, 25 Oct 2019 14:46:32 +0000 (16:46 +0200)
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
lib/private/TemplateLayout.php

index 94b39e951a5a324b5533bd755c809d694b67e120..08f96608c29cc414da061f8232fe8ef0bde2bb41 100644 (file)
@@ -43,6 +43,7 @@ use OC\Template\JSConfigHelper;
 use OC\Template\SCSSCacher;
 use OCP\Defaults;
 use OC\AppFramework\Http\Request;
+use OCP\Support\Subscription\IRegistry;
 
 class TemplateLayout extends \OC_Template {
 
@@ -134,7 +135,14 @@ class TemplateLayout extends \OC_Template {
                        parent::__construct('core', 'layout.public');
                        $this->assign( 'appid', $appId );
                        $this->assign('bodyid', 'body-public');
-                       $this->assign('showSimpleSignUpLink', $this->config->getSystemValue('simpleSignUpLink.shown', true) !== false);
+
+                       /** @var IRegistry $subscription */
+                       $subscription = \OC::$server->query(IRegistry::class);
+                       $showSimpleSignup = $this->config->getSystemValueBool('simpleSignUpLink.shown', true);
+                       if ($showSimpleSignup && $subscription->delegateHasValidSubscription()) {
+                               $showSimpleSignup = false;
+                       }
+                       $this->assign('showSimpleSignUpLink', $showSimpleSignup);
                } else {
                        parent::__construct('core', 'layout.base');