Merge pull request #40368 from nextcloud/feature/update-signup-link

pull/41635/head
Julius Härtl 2023-11-21 11:22:42 +07:00 committed by GitHub
commit f74084cd3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

@ -110,7 +110,7 @@ if (isset($template) && $template->getActionCount() !== 0) {
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>

@ -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');
}