2015-10-29 12:27:14 -04:00
< ? php
2024-05-28 10:42:42 -04:00
/**
* SPDX - FileCopyrightText : 2016 - 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX - FileCopyrightText : 2015 - 2016 ownCloud , Inc .
* SPDX - License - Identifier : AGPL - 3.0 - only
*/
2024-12-28 05:22:18 -05:00
2015-11-18 07:38:03 -05:00
use OCA\Federation\TrustedServers ;
2024-12-28 05:22:18 -05:00
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' );
2015-11-18 07:38:03 -05:00
2024-12-28 05:22:18 -05:00
$urlGenerator = Server :: get ( IURLGenerator :: class );
$documentationLink = $urlGenerator -> linkToDocs ( 'admin-sharing-federated' ) . '#configuring-trusted-nextcloud-servers' ;
$documentationLabel = $l -> t ( 'External documentation for Federated Cloud Sharing' );
2015-10-29 12:27:14 -04:00
?>
< div id = " ocFederationSettings " class = " section " >
2024-12-28 05:22:18 -05:00
< 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 >
2022-09-21 11:44:32 -04:00
< 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>
2024-12-28 05:22:18 -05:00
< p class = " settings-hint " >< ? php p ( $l -> t ( 'Each server must validate the other. This process may require a few cron cycles.' )); ?> </p>
2015-10-29 12:27:14 -04:00
< ul id = " listOfTrustedServers " >
< ? php foreach ( $_ [ 'trustedServers' ] as $trustedServer ) { ?>
2016-06-08 05:02:05 -04:00
< li id = " <?php p( $trustedServer['id'] ); ?> " >
2015-11-18 07:38:03 -05:00
< ? php if (( int ) $trustedServer [ 'status' ] === TrustedServers :: STATUS_OK ) { ?>
< span class = " status success " ></ span >
2016-02-26 11:51:20 -05:00
< ? php
} elseif (
( int ) $trustedServer [ 'status' ] === TrustedServers :: STATUS_PENDING ||
( int ) $trustedServer [ 'status' ] === TrustedServers :: STATUS_ACCESS_REVOKED
) { ?>
2015-11-18 07:38:03 -05:00
< span class = " status indeterminate " ></ span >
< ? php } else { ?>
< span class = " status error " ></ span >
< ? php } ?>
2015-10-29 12:27:14 -04:00
< ? php p ( $trustedServer [ 'url' ]); ?>
2016-06-08 05:02:05 -04:00
< span class = " icon icon-delete " ></ span >
2015-10-29 12:27:14 -04:00
</ li >
< ? php } ?>
</ ul >
2024-12-27 05:02:32 -05:00
< div id = " ocFederationAddServer " >
< button id = " ocFederationAddServerButton " >< ? php p ( $l -> t ( '+ Add trusted server' )); ?> </button>
2023-10-20 05:17:29 -04:00
< 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 >
2024-12-27 05:02:32 -05:00
</ div >
2015-10-29 12:27:14 -04:00
</ div >