Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/privacy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2019-03-21 11:44:17 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2019-03-21 11:44:17 +0300
commit91081c41a0e30fc8270192a4e1cc41608d6769ae (patch)
treed3c79b9826b098eea256136ed9e3a492875b0ecb
parent98dd5ef68c970e892e62cf828bb5fb7926ce9acf (diff)
Add a privacy policy link if it's set
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
-rw-r--r--lib/Settings/WhoHasAccessSettings.php13
-rw-r--r--templates/who-has-access.php7
2 files changed, 19 insertions, 1 deletions
diff --git a/lib/Settings/WhoHasAccessSettings.php b/lib/Settings/WhoHasAccessSettings.php
index 69422c6..cd39a4e 100644
--- a/lib/Settings/WhoHasAccessSettings.php
+++ b/lib/Settings/WhoHasAccessSettings.php
@@ -21,6 +21,8 @@
*/
namespace OCA\Privacy\Settings;
+use OC;
+use OCA\Theming\ThemingDefaults;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\Settings\ISettings;
@@ -35,7 +37,16 @@ class WhoHasAccessSettings implements ISettings {
* @return TemplateResponse
*/
public function getForm():TemplateResponse {
- return new TemplateResponse('privacy', 'who-has-access');
+ $themingDefaults = OC::$server->getThemingDefaults();
+ if ($themingDefaults instanceof ThemingDefaults) {
+ $privacyPolicyUrl = $themingDefaults->getPrivacyUrl();
+ } else {
+ $privacyPolicyUrl = null;
+ }
+
+ return new TemplateResponse('privacy', 'who-has-access', [
+ 'privacyPolicyUrl' => $privacyPolicyUrl,
+ ]);
}
/**
diff --git a/templates/who-has-access.php b/templates/who-has-access.php
index 194e548..3a97c39 100644
--- a/templates/who-has-access.php
+++ b/templates/who-has-access.php
@@ -5,4 +5,11 @@
<h4><?php p($l->t('People you shared with')) ?></h4>
<div id="privacy_access_shares"></div>
+
+ <?php if (!empty($_['privacyPolicyUrl'])): ?>
+ <h4><?php p($l->t('Privacy policy')) ?></h4>
+ <p>
+ <a href="<?php print_unescaped($_['privacyPolicyUrl']) ?>"><?php p($l->t('Read the privacy policy.')) ?></a>
+ </p>
+ <?php endif; ?>
</div> \ No newline at end of file