Merge pull request #17674 from nextcloud/enh/do_not_show_footer_sub

Do not show 'Get your own free account' on services under subscription
This commit is contained in:
Roeland Jago Douma 2019-10-30 10:54:42 +01:00 committed by GitHub
commit 938428c275
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View 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');