-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
move federated sharing settings to the federatedfilesharing app #24073
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<?php | ||
/** | ||
* @author Björn Schießle <[email protected]> | ||
* | ||
* @copyright Copyright (c) 2016, ownCloud, Inc. | ||
* @license AGPL-3.0 | ||
* | ||
* This code is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License, version 3, | ||
* as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License, version 3, | ||
* along with this program. If not, see <http://www.gnu.org/licenses/> | ||
* | ||
*/ | ||
|
||
|
||
namespace OCA\FederatedFileSharing\AppInfo; | ||
|
||
|
||
use OCA\FederatedFileSharing\FederatedShareProvider; | ||
use OCP\AppFramework\App; | ||
|
||
class Application extends App { | ||
|
||
/** @var FederatedShareProvider */ | ||
protected $federatedShareProvider; | ||
|
||
/** | ||
* register personal and admin settings page | ||
*/ | ||
public function registerSettings() { | ||
\OCP\App::registerAdmin('federatedfilesharing', 'settings-admin'); | ||
\OCP\App::registerPersonal('federatedfilesharing', 'settings-personal'); | ||
} | ||
|
||
/** | ||
* get instance of federated share provider | ||
* | ||
* @return FederatedShareProvider | ||
*/ | ||
public function getFederatedShareProvider() { | ||
if ($this->federatedShareProvider === null) { | ||
$this->initFederatedShareProvider(); | ||
} | ||
return $this->federatedShareProvider; | ||
} | ||
|
||
/** | ||
* initialize federated share provider | ||
*/ | ||
protected function initFederatedShareProvider() { | ||
$addressHandler = new \OCA\FederatedFileSharing\AddressHandler( | ||
\OC::$server->getURLGenerator(), | ||
\OC::$server->getL10N('federatedfilesharing') | ||
); | ||
$discoveryManager = new \OCA\FederatedFileSharing\DiscoveryManager( | ||
\OC::$server->getMemCacheFactory(), | ||
\OC::$server->getHTTPClientService() | ||
); | ||
$notifications = new \OCA\FederatedFileSharing\Notifications( | ||
$addressHandler, | ||
\OC::$server->getHTTPClientService(), | ||
$discoveryManager, | ||
\OC::$server->getJobList() | ||
); | ||
$tokenHandler = new \OCA\FederatedFileSharing\TokenHandler( | ||
\OC::$server->getSecureRandom() | ||
); | ||
|
||
$this->federatedShareProvider = new \OCA\FederatedFileSharing\FederatedShareProvider( | ||
\OC::$server->getDatabaseConnection(), | ||
$addressHandler, | ||
$notifications, | ||
$tokenHandler, | ||
\OC::$server->getL10N('federatedfilesharing'), | ||
\OC::$server->getLogger(), | ||
\OC::$server->getLazyRootFolder(), | ||
\OC::$server->getConfig() | ||
); | ||
} | ||
|
||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
...iles_sharing/templates/settings-admin.php → ...dfilesharing/templates/settings-admin.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...s_sharing/templates/settings-personal.php → ...lesharing/templates/settings-personal.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,8 +31,11 @@ | |
|
||
$l = \OC::$server->getL10N('files_sharing'); | ||
|
||
$federatedSharingApp = new \OCA\FederatedFileSharing\AppInfo\Application('federatedfilesharing'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
$federatedShareProvider = $federatedSharingApp->getFederatedShareProvider(); | ||
|
||
// check if server admin allows to mount public links from other servers | ||
if (OCA\Files_Sharing\Helper::isIncomingServer2serverShareEnabled() === false) { | ||
if ($federatedShareProvider->isIncomingServer2serverShareEnabled() === false) { | ||
\OCP\JSON::error(array('data' => array('message' => $l->t('Server to server sharing is not enabled on this server')))); | ||
exit(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throws an exception when the app is not enabled, because autoloading from the path is not allowed...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, but at the moment the app is always enabled. I also want to move the settings 1:1 with as few changes as possible. Maybe in a second step the shareManager should have a "getShareProvider($shareType)" method which we could query instead of the share provider directly. cc @rullzer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmmm lets think about that... because in general I think the abstraction of the share manager is pretty nice.. But I see the use case