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
5 changes: 0 additions & 5 deletions apps/federation/appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@
'url' => '/trusted-servers/{id}',
'verb' => 'DELETE'
],
[
'name' => 'Settings#autoAddServers',
'url' => '/auto-add-servers',
'verb' => 'POST'
],
],
'ocs' => [
// old endpoints, only used by Nextcloud and ownCloud
Expand Down
1 change: 0 additions & 1 deletion apps/federation/composer/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
'OCA\\Federation\\DAV\\FedAuth' => $baseDir . '/../lib/DAV/FedAuth.php',
'OCA\\Federation\\DbHandler' => $baseDir . '/../lib/DbHandler.php',
'OCA\\Federation\\Hooks' => $baseDir . '/../lib/Hooks.php',
'OCA\\Federation\\Listener\\FederatedShareAddedListener' => $baseDir . '/../lib/Listener/FederatedShareAddedListener.php',
'OCA\\Federation\\Listener\\SabrePluginAuthInitListener' => $baseDir . '/../lib/Listener/SabrePluginAuthInitListener.php',
'OCA\\Federation\\Middleware\\AddServerMiddleware' => $baseDir . '/../lib/Middleware/AddServerMiddleware.php',
'OCA\\Federation\\Migration\\Version1010Date20200630191302' => $baseDir . '/../lib/Migration/Version1010Date20200630191302.php',
Expand Down
1 change: 0 additions & 1 deletion apps/federation/composer/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class ComposerStaticInitFederation
'OCA\\Federation\\DAV\\FedAuth' => __DIR__ . '/..' . '/../lib/DAV/FedAuth.php',
'OCA\\Federation\\DbHandler' => __DIR__ . '/..' . '/../lib/DbHandler.php',
'OCA\\Federation\\Hooks' => __DIR__ . '/..' . '/../lib/Hooks.php',
'OCA\\Federation\\Listener\\FederatedShareAddedListener' => __DIR__ . '/..' . '/../lib/Listener/FederatedShareAddedListener.php',
'OCA\\Federation\\Listener\\SabrePluginAuthInitListener' => __DIR__ . '/..' . '/../lib/Listener/SabrePluginAuthInitListener.php',
'OCA\\Federation\\Middleware\\AddServerMiddleware' => __DIR__ . '/..' . '/../lib/Middleware/AddServerMiddleware.php',
'OCA\\Federation\\Migration\\Version1010Date20200630191302' => __DIR__ . '/..' . '/../lib/Migration/Version1010Date20200630191302.php',
Expand Down
24 changes: 7 additions & 17 deletions apps/federation/js/settings-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,21 @@
*/

(function( $ ) {

// ocFederationAddServer
$.fn.ocFederationAddServer = function() {

/* Go easy on jquery and define some vars
========================================================================== */

var $wrapper = $(this),

// Buttons
$btnAddServer = $wrapper.find("#ocFederationAddServerButton"),
$btnSubmit = $wrapper.find("#ocFederationSubmit"),

// Inputs
$inpServerUrl = $wrapper.find("#serverUrl"),
$inpAutoAddServers = $wrapper.find("#autoAddServers"),

// misc
$msgBox = $wrapper.find("#ocFederationAddServer .msg"),
Expand All @@ -55,17 +54,8 @@
$srvList.on('click', 'li > .icon-delete', function() {
var $this = $(this).parent();
var id = $this.attr('id');

removeServer( id );
});

$inpAutoAddServers.on("change", function() {
$.post(
OC.generateUrl('/apps/federation/auto-add-servers'),
{
autoAddServers: $(this).is(":checked")
}
);
removeServer( id );
});

$btnSubmit.on("click", function()
Expand Down Expand Up @@ -94,7 +84,7 @@
}
});
};

/* private Functions
========================================================================== */

Expand Down Expand Up @@ -132,11 +122,11 @@
});
}


})( jQuery );

window.addEventListener('DOMContentLoaded', function () {

$('#ocFederationSettings').ocFederationAddServer();

});
3 changes: 0 additions & 3 deletions apps/federation/lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
namespace OCA\Federation\AppInfo;

use OCA\DAV\Events\SabrePluginAuthInitEvent;
use OCA\FederatedFileSharing\Events\FederatedShareAddedEvent;
use OCA\Federation\Listener\FederatedShareAddedListener;
use OCA\Federation\Listener\SabrePluginAuthInitListener;
use OCA\Federation\Middleware\AddServerMiddleware;
use OCP\AppFramework\App;
Expand All @@ -47,7 +45,6 @@ public function __construct($urlParams = []) {
public function register(IRegistrationContext $context): void {
$context->registerMiddleware(AddServerMiddleware::class);

$context->registerEventListener(FederatedShareAddedEvent::class, FederatedShareAddedListener::class);
$context->registerEventListener(SabrePluginAuthInitEvent::class, SabrePluginAuthInitListener::class);
}

Expand Down
10 changes: 0 additions & 10 deletions apps/federation/lib/Controller/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,6 @@ public function removeServer($id) {
return new DataResponse();
}

/**
* enable/disable to automatically add servers to the list of trusted servers
* once a federated share was created and accepted successfully
*
* @param bool $autoAddServers
*/
public function autoAddServers($autoAddServers) {
$this->trustedServers->setAutoAddServers($autoAddServers);
}

/**
* check if the server should be added to the list of trusted servers or not
*
Expand Down
60 changes: 0 additions & 60 deletions apps/federation/lib/Listener/FederatedShareAddedListener.php

This file was deleted.

7 changes: 0 additions & 7 deletions apps/federation/templates/settings-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@
<h2><?php p($l->t('Trusted servers')); ?></h2>
<p class="settings-hint"><?php p($l->t('Federation allows you to connect with other trusted servers to exchange the user directory. For example this will be used to auto-complete external users for federated sharing. It is not necessary to add a server as trusted server in order to create a federated share.')); ?></p>

<p>
<input id="autoAddServers" type="checkbox" class="checkbox" <?php if ($_['autoAddServers']) {
p('checked');
} ?> />
<label for="autoAddServers"><?php p($l->t('Add server automatically once a federated share was created successfully')); ?></label>
</p>

<ul id="listOfTrustedServers">
<?php foreach ($_['trustedServers'] as $trustedServer) { ?>
<li id="<?php p($trustedServer['id']); ?>">
Expand Down