Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update sign up link in share pages #40368

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/templates/layout.public.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
if ($_['showSimpleSignUpLink']) {
?>
<p>
<a href="https://nextcloud.com/signup/" target="_blank" rel="noreferrer noopener">
<a href="<?php p($_['signUpLink']); ?>" target="_blank" rel="noreferrer noopener">
<?php p($l->t('Get your own free account')); ?>
</a>
</p>
Expand Down
16 changes: 16 additions & 0 deletions lib/private/TemplateLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,13 @@
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;
Expand Down Expand Up @@ -206,7 +208,21 @@ public function __construct($renderAs, $appId = '') {
if ($showSimpleSignup && $subscription->delegateHasValidSubscription()) {
$showSimpleSignup = false;
}

$defaultSignUpLink = 'https://nextcloud.com/signup/';
$signUpLink = $this->config->getSystemValueString('registration_link', $defaultSignUpLink);
if ($signUpLink !== $defaultSignUpLink) {
$showSimpleSignup = true;
icewind1991 marked this conversation as resolved.
Show resolved Hide resolved
}

$appManager = \OCP\Server::get(IAppManager::class);
luka-nextcloud marked this conversation as resolved.
Show resolved Hide resolved
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');
}
Expand Down
Loading