mirror of
https://github.com/nextcloud/server.git
synced 2026-04-22 14:50:17 -04:00
feat: Add legal notice and privacy policy links to help page
Signed-off-by: Christopher Ng <chrng8@gmail.com>
This commit is contained in:
parent
097f04c8b7
commit
2b04a80f90
2 changed files with 21 additions and 0 deletions
|
|
@ -34,6 +34,7 @@ use OCP\AppFramework\Controller;
|
|||
use OCP\AppFramework\Http\Attribute\OpenAPI;
|
||||
use OCP\AppFramework\Http\ContentSecurityPolicy;
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
use OCP\IAppConfig;
|
||||
use OCP\IConfig;
|
||||
use OCP\IGroupManager;
|
||||
use OCP\IL10N;
|
||||
|
|
@ -59,6 +60,9 @@ class HelpController extends Controller {
|
|||
/** @var IConfig */
|
||||
private $config;
|
||||
|
||||
/** @var IAppConfig */
|
||||
private $appConfig;
|
||||
|
||||
public function __construct(
|
||||
string $appName,
|
||||
IRequest $request,
|
||||
|
|
@ -68,6 +72,7 @@ class HelpController extends Controller {
|
|||
IGroupManager $groupManager,
|
||||
IL10N $l10n,
|
||||
IConfig $config,
|
||||
IAppConfig $appConfig,
|
||||
) {
|
||||
parent::__construct($appName, $request);
|
||||
$this->navigationManager = $navigationManager;
|
||||
|
|
@ -76,6 +81,7 @@ class HelpController extends Controller {
|
|||
$this->groupManager = $groupManager;
|
||||
$this->l10n = $l10n;
|
||||
$this->config = $config;
|
||||
$this->appConfig = $appConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -107,6 +113,9 @@ class HelpController extends Controller {
|
|||
$urlAdminDocs = $this->urlGenerator->linkToDocs('admin');
|
||||
}
|
||||
|
||||
$legalNoticeUrl = $this->appConfig->getValueString('theming', 'imprintUrl');
|
||||
$privacyUrl = $this->appConfig->getValueString('theming', 'privacyUrl');
|
||||
|
||||
$response = new TemplateResponse('settings', 'help', [
|
||||
'admin' => $this->groupManager->isAdmin($this->userId),
|
||||
'url' => $documentationUrl,
|
||||
|
|
@ -115,6 +124,8 @@ class HelpController extends Controller {
|
|||
'mode' => $mode,
|
||||
'pageTitle' => $pageTitle,
|
||||
'knowledgebaseEmbedded' => $knowledgebaseEmbedded,
|
||||
'legalNoticeUrl' => $legalNoticeUrl,
|
||||
'privacyUrl' => $privacyUrl,
|
||||
]);
|
||||
$policy = new ContentSecurityPolicy();
|
||||
$policy->addAllowedFrameDomain('\'self\'');
|
||||
|
|
|
|||
|
|
@ -73,6 +73,16 @@
|
|||
<a href="https://help.nextcloud.com" class="button" target="_blank" rel="noreferrer noopener">
|
||||
<?php p($l->t('Forum')); ?> ↗
|
||||
</a>
|
||||
<?php if ($_['legalNoticeUrl']) { ?>
|
||||
<a href="<?php print_unescaped($_['legalNoticeUrl']); ?>" class="button" target="_blank" rel="noreferrer noopener">
|
||||
<?php p($l->t('Legal notice')); ?> ↗
|
||||
</a>
|
||||
<?php } ?>
|
||||
<?php if ($_['privacyUrl']) { ?>
|
||||
<a href="<?php print_unescaped($_['privacyUrl']); ?>" class="button" target="_blank" rel="noreferrer noopener">
|
||||
<?php p($l->t('Privacy policy')); ?> ↗
|
||||
</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue