Skip to content

Commit

Permalink
feat: update sign up link in share pages
Browse files Browse the repository at this point in the history
Signed-off-by: Luka Trovic <[email protected]>
  • Loading branch information
luka-nextcloud committed Sep 13, 2023
1 parent 993d9bc commit 239ab00
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/private/TemplateLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,20 @@ public function __construct($renderAs, $appId = '') {
if ($showSimpleSignup && $subscription->delegateHasValidSubscription()) {
$showSimpleSignup = false;
}
$this->assign('showSimpleSignUpLink', $showSimpleSignup);

$urlGenerator = \OCP\Server::get(IURLGenerator::class);
$signUpLink = $this->config->getSystemValueString('registration_link', $urlGenerator->getAbsoluteURL('/index.php/signup/'));
$defaultSignUpLink = 'https://nextcloud.com/signup/';
$signUpLink = $this->config->getSystemValueString('registration_link', $defaultSignUpLink);
if ($signUpLink !== $defaultSignUpLink) {
$showSimpleSignup = true;
}

$appManager = \OCP\Server::get(IAppManager::class);
if ($appManager->isEnabledForUser('registration')) {
$signUpLink = $urlGenerator->getAbsoluteURL('/index.php/apps/registration/');
}

$this->assign('showSimpleSignUpLink', $showSimpleSignup);
$this->assign('signUpLink', $signUpLink);
} else {
parent::__construct('core', 'layout.base');
Expand Down

0 comments on commit 239ab00

Please sign in to comment.