aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/TemplateLayout.php
diff options
context:
space:
mode:
authorLuka Trovic <luka@nextcloud.com>2023-09-11 18:22:07 +0200
committerLuka Trovic <luka@nextcloud.com>2023-11-21 10:10:37 +0100
commitb134e1cbc754dcfa8ad5359009974659c27f7f79 (patch)
treed41652a34716981593e559d2d76e90ec9056ae08 /lib/private/TemplateLayout.php
parent24c2c09aeae1e99f9d6f1dff0103db3b6198cb4f (diff)
downloadnextcloud-server-b134e1cbc754dcfa8ad5359009974659c27f7f79.tar.gz
nextcloud-server-b134e1cbc754dcfa8ad5359009974659c27f7f79.zip
feat: update sign up link in share pages
Signed-off-by: Luka Trovic <luka@nextcloud.com>
Diffstat (limited to 'lib/private/TemplateLayout.php')
-rw-r--r--lib/private/TemplateLayout.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php
index 011597e6c29..2adf3c5e692 100644
--- a/lib/private/TemplateLayout.php
+++ b/lib/private/TemplateLayout.php
@@ -47,11 +47,13 @@ use OC\Search\SearchQuery;
use OC\Template\CSSResourceLocator;
use OC\Template\JSConfigHelper;
use OC\Template\JSResourceLocator;
+use OCP\App\IAppManager;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\Defaults;
use OCP\IConfig;
use OCP\IInitialStateService;
use OCP\INavigationManager;
+use OCP\IURLGenerator;
use OCP\IUserSession;
use OCP\Support\Subscription\IRegistry;
use OCP\Util;
@@ -206,7 +208,21 @@ class TemplateLayout extends \OC_Template {
if ($showSimpleSignup && $subscription->delegateHasValidSubscription()) {
$showSimpleSignup = false;
}
+
+ $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')) {
+ $urlGenerator = \OCP\Server::get(IURLGenerator::class);
+ $signUpLink = $urlGenerator->getAbsoluteURL('/index.php/apps/registration/');
+ }
+
$this->assign('showSimpleSignUpLink', $showSimpleSignup);
+ $this->assign('signUpLink', $signUpLink);
} else {
parent::__construct('core', 'layout.base');
}