From 18c0c28bce86b01c4c626b7c02312fb50757a5df Mon Sep 17 00:00:00 2001 From: yemkareems Date: Fri, 18 Oct 2024 14:04:34 +0530 Subject: fix: add PasswordConfirmationRequired to the eternal storages mentioned in review Signed-off-by: yemkareems --- apps/files_external/lib/Controller/GlobalStoragesController.php | 3 +++ apps/files_external/lib/Controller/StoragesController.php | 2 ++ apps/files_external/lib/Controller/UserGlobalStoragesController.php | 2 ++ 3 files changed, 7 insertions(+) (limited to 'apps') diff --git a/apps/files_external/lib/Controller/GlobalStoragesController.php b/apps/files_external/lib/Controller/GlobalStoragesController.php index 05cfd4684d8..85d765d268b 100644 --- a/apps/files_external/lib/Controller/GlobalStoragesController.php +++ b/apps/files_external/lib/Controller/GlobalStoragesController.php @@ -9,6 +9,7 @@ namespace OCA\Files_External\Controller; use OCA\Files_External\NotFoundException; use OCA\Files_External\Service\GlobalStoragesService; use OCP\AppFramework\Http; +use OCP\AppFramework\Http\Attribute\PasswordConfirmationRequired; use OCP\AppFramework\Http\DataResponse; use OCP\IConfig; use OCP\IGroupManager; @@ -69,6 +70,7 @@ class GlobalStoragesController extends StoragesController { * * @return DataResponse */ + #[PasswordConfirmationRequired] public function create( $mountPoint, $backend, @@ -134,6 +136,7 @@ class GlobalStoragesController extends StoragesController { * * @return DataResponse */ + #[PasswordConfirmationRequired] public function update( $id, $mountPoint, diff --git a/apps/files_external/lib/Controller/StoragesController.php b/apps/files_external/lib/Controller/StoragesController.php index 9144b766d5d..acd4446cde6 100644 --- a/apps/files_external/lib/Controller/StoragesController.php +++ b/apps/files_external/lib/Controller/StoragesController.php @@ -15,6 +15,7 @@ use OCA\Files_External\NotFoundException; use OCA\Files_External\Service\StoragesService; use OCP\AppFramework\Controller; use OCP\AppFramework\Http; +use OCP\AppFramework\Http\Attribute\PasswordConfirmationRequired; use OCP\AppFramework\Http\DataResponse; use OCP\Files\StorageNotAvailableException; use OCP\IConfig; @@ -301,6 +302,7 @@ abstract class StoragesController extends Controller { * * @return DataResponse */ + #[PasswordConfirmationRequired] public function destroy($id) { try { $this->service->removeStorage($id); diff --git a/apps/files_external/lib/Controller/UserGlobalStoragesController.php b/apps/files_external/lib/Controller/UserGlobalStoragesController.php index 60159e1bc54..bcb439a7357 100644 --- a/apps/files_external/lib/Controller/UserGlobalStoragesController.php +++ b/apps/files_external/lib/Controller/UserGlobalStoragesController.php @@ -15,6 +15,7 @@ use OCA\Files_External\Lib\StorageConfig; use OCA\Files_External\NotFoundException; use OCA\Files_External\Service\UserGlobalStoragesService; use OCP\AppFramework\Http; +use OCP\AppFramework\Http\Attribute\PasswordConfirmationRequired; use OCP\AppFramework\Http\Attribute\NoAdminRequired; use OCP\AppFramework\Http\DataResponse; use OCP\IConfig; @@ -136,6 +137,7 @@ class UserGlobalStoragesController extends StoragesController { * @return DataResponse */ #[NoAdminRequired] + #[PasswordConfirmationRequired] public function update( $id, $backendOptions, -- cgit v1.2.3