Skip to content
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
13 changes: 12 additions & 1 deletion lib/Settings/WhoHasAccessSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
*/
namespace OCA\Privacy\Settings;

use OC;
use OCA\Theming\ThemingDefaults;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\Settings\ISettings;

Expand All @@ -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();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@juliushaertl fyi I've checked the server code and we actually already test if the theming app is enabled in the server container, hence this check here isn't necessary :)

if ($themingDefaults instanceof ThemingDefaults) {
$privacyPolicyUrl = $themingDefaults->getPrivacyUrl();
} else {
$privacyPolicyUrl = null;
}

return new TemplateResponse('privacy', 'who-has-access', [
'privacyPolicyUrl' => $privacyPolicyUrl,
]);
}

/**
Expand Down
7 changes: 7 additions & 0 deletions templates/who-has-access.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>