blob: 857a8b23e372e6e3ef5d245c2cd159f1d75a4445 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
<?php
/**
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2015-2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
*/
use OCA\Federation\TrustedServers;
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\Server;
use OCP\Util;
/** @var IL10N $l */
Util::addScript('federation', 'settings-admin');
Util::addStyle('federation', 'settings-admin');
$urlGenerator = Server::get(IURLGenerator::class);
$documentationLink = $urlGenerator->linkToDocs('admin-sharing-federated') . '#configuring-trusted-nextcloud-servers';
$documentationLabel = $l->t('External documentation for Federated Cloud Sharing');
?>
<div id="ocFederationSettings" class="section">
<h2>
<?php p($l->t('Trusted servers')); ?>
<a target="_blank" rel="noreferrer noopener" class="icon-info"
title="<?php p($documentationLabel);?>"
href="<?php p($documentationLink); ?>"></a>
</h2>
<p class="settings-hint"><?php p($l->t('Federation allows you to connect with other trusted servers to exchange the account directory. For example this will be used to auto-complete external accounts for federated sharing. It is not necessary to add a server as trusted server in order to create a federated share.')); ?></p>
<p class="settings-hint"><?php p($l->t('Each server must validate the other. This process may require a few cron cycles.')); ?></p>
<ul id="listOfTrustedServers">
<?php foreach ($_['trustedServers'] as $trustedServer) { ?>
<li id="<?php p($trustedServer['id']); ?>">
<?php if ((int)$trustedServer['status'] === TrustedServers::STATUS_OK) { ?>
<span class="status success"></span>
<?php
} elseif (
(int)$trustedServer['status'] === TrustedServers::STATUS_PENDING
|| (int)$trustedServer['status'] === TrustedServers::STATUS_ACCESS_REVOKED
) { ?>
<span class="status indeterminate"></span>
<?php } else {?>
<span class="status error"></span>
<?php } ?>
<?php p($trustedServer['url']); ?>
<span class="icon icon-delete"></span>
</li>
<?php } ?>
</ul>
<div id="ocFederationAddServer">
<button id="ocFederationAddServerButton"><?php p($l->t('+ Add trusted server')); ?></button>
<div class="serverUrl hidden">
<div class="serverUrl-block">
<label for="serverUrl"><?php p($l->t('Trusted server')); ?></label>
<input id="serverUrl" type="text" value="" placeholder="<?php p($l->t('Trusted server')); ?>" name="server_url"/>
<button id="ocFederationSubmit" class="hidden"><?php p($l->t('Add')); ?></button>
</div>
<span class="msg"></span>
</div>
</div>
</div>
|