diff options
author | Juan Pablo Villafáñez <jvillafanez@solidgear.es> | 2016-06-07 16:53:16 +0200 |
---|---|---|
committer | Juan Pablo Villafáñez <jvillafanez@solidgear.es> | 2016-06-07 16:53:16 +0200 |
commit | 8526bbb347a7b1ea18b225b4dda40029534636db (patch) | |
tree | 7600c448bbde5b8501ed35f23fbc8b50ede29de3 /apps/files_external/lib | |
parent | f28f6ad2df59b8faa9589bffbc9d2c53b03a2840 (diff) | |
download | nextcloud-server-8526bbb347a7b1ea18b225b4dda40029534636db.tar.gz nextcloud-server-8526bbb347a7b1ea18b225b4dda40029534636db.zip |
Add support to know where the storage test comes from
Diffstat (limited to 'apps/files_external/lib')
5 files changed, 19 insertions, 15 deletions
diff --git a/apps/files_external/lib/Controller/GlobalStoragesController.php b/apps/files_external/lib/Controller/GlobalStoragesController.php index 6f9278ce6f1..af71a4831cd 100644 --- a/apps/files_external/lib/Controller/GlobalStoragesController.php +++ b/apps/files_external/lib/Controller/GlobalStoragesController.php @@ -139,7 +139,8 @@ class GlobalStoragesController extends StoragesController { $mountOptions, $applicableUsers, $applicableGroups, - $priority + $priority, + $origin = null ) { $storage = $this->createStorage( $mountPoint, @@ -172,7 +173,7 @@ class GlobalStoragesController extends StoragesController { ); } - $this->updateStorageStatus($storage); + $this->updateStorageStatus($storage, $origin); return new DataResponse( $storage, diff --git a/apps/files_external/lib/Controller/StoragesController.php b/apps/files_external/lib/Controller/StoragesController.php index aa6a04ecb8d..213518ff4a0 100644 --- a/apps/files_external/lib/Controller/StoragesController.php +++ b/apps/files_external/lib/Controller/StoragesController.php @@ -238,7 +238,7 @@ abstract class StoragesController extends Controller { * * @param StorageConfig $storage storage configuration */ - protected function updateStorageStatus(StorageConfig &$storage) { + protected function updateStorageStatus(StorageConfig &$storage, $origin = null) { try { $this->manipulateStorageConfig($storage); @@ -249,7 +249,8 @@ abstract class StoragesController extends Controller { \OC_Mount_Config::getBackendStatus( $backend->getStorageClass(), $storage->getBackendOptions(), - false + false, + $origin ) ); } catch (InsufficientDataForMeaningfulAnswerException $e) { @@ -293,11 +294,11 @@ abstract class StoragesController extends Controller { * * @return DataResponse */ - public function show($id) { + public function show($id, $origin = null) { try { $storage = $this->service->getStorage($id); - $this->updateStorageStatus($storage); + $this->updateStorageStatus($storage, $origin); } catch (NotFoundException $e) { return new DataResponse( [ diff --git a/apps/files_external/lib/Controller/UserGlobalStoragesController.php b/apps/files_external/lib/Controller/UserGlobalStoragesController.php index 1c94a1e9635..5050962a52e 100644 --- a/apps/files_external/lib/Controller/UserGlobalStoragesController.php +++ b/apps/files_external/lib/Controller/UserGlobalStoragesController.php @@ -111,11 +111,11 @@ class UserGlobalStoragesController extends StoragesController { * * @NoAdminRequired */ - public function show($id) { + public function show($id, $origin = null) { try { $storage = $this->service->getStorage($id); - $this->updateStorageStatus($storage); + $this->updateStorageStatus($storage, $origin); } catch (NotFoundException $e) { return new DataResponse( [ @@ -146,7 +146,8 @@ class UserGlobalStoragesController extends StoragesController { */ public function update( $id, - $backendOptions + $backendOptions, + $origin = null ) { try { $storage = $this->service->getStorage($id); diff --git a/apps/files_external/lib/Controller/UserStoragesController.php b/apps/files_external/lib/Controller/UserStoragesController.php index 936da7ec5e2..73f7178b142 100644 --- a/apps/files_external/lib/Controller/UserStoragesController.php +++ b/apps/files_external/lib/Controller/UserStoragesController.php @@ -101,8 +101,8 @@ class UserStoragesController extends StoragesController { * * {@inheritdoc} */ - public function show($id) { - return parent::show($id); + public function show($id, $origin = null) { + return parent::show($id, $origin); } /** @@ -170,7 +170,8 @@ class UserStoragesController extends StoragesController { $backend, $authMechanism, $backendOptions, - $mountOptions + $mountOptions, + $origin = null ) { $storage = $this->createStorage( $mountPoint, @@ -200,7 +201,7 @@ class UserStoragesController extends StoragesController { ); } - $this->updateStorageStatus($storage); + $this->updateStorageStatus($storage, $origin); return new DataResponse( $storage, diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index 86aafcf5770..51d62449782 100644 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -215,7 +215,7 @@ class OC_Mount_Config { * @return int see self::STATUS_* * @throws Exception */ - public static function getBackendStatus($class, $options, $isPersonal) { + public static function getBackendStatus($class, $options, $isPersonal, $origin = null) { if (self::$skipTest) { return StorageNotAvailableException::STATUS_SUCCESS; } @@ -228,7 +228,7 @@ class OC_Mount_Config { $storage = new $class($options); try { - $result = $storage->test($isPersonal); + $result = $storage->test($isPersonal, $origin); $storage->setAvailability($result); if ($result) { return StorageNotAvailableException::STATUS_SUCCESS; |