From 74ce175a7b0aee1306afeeb5050f9b7d45e87d5b Mon Sep 17 00:00:00 2001 From: Akhil Date: Wed, 12 Feb 2025 18:07:01 +0530 Subject: [PATCH 1/2] Remove addition to FilesEnabled group --- appinfo/info.xml | 2 +- lib/Controller/AccountController.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index e32120fc..a22a42fc 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -10,7 +10,7 @@ - 9.0.0 + 9.0.1 agpl Murena SAS EcloudAccounts diff --git a/lib/Controller/AccountController.php b/lib/Controller/AccountController.php index 774e9122..8fab6f27 100644 --- a/lib/Controller/AccountController.php +++ b/lib/Controller/AccountController.php @@ -213,8 +213,7 @@ class AccountController extends Controller { $this->session->remove(self::CAPTCHA_VERIFIED_CHECK); $ipAddress = $this->request->getRemoteAddress(); $this->userService->addUsernameToCommonDataStore($username, $ipAddress, $recoveryEmail); - // temporary fix to add user in 'files-enabled' group - $this->fsService->addUserInFilesEnabledGroup($username); + $response->setStatus(200); $response->setData(['success' => true]); -- GitLab From a2e4e7d7ddf8886db4287a2cfa8f1ed126dd98c8 Mon Sep 17 00:00:00 2001 From: Akhil Date: Wed, 12 Feb 2025 18:18:38 +0530 Subject: [PATCH 2/2] Remove filesystem service file --- lib/Controller/AccountController.php | 4 -- lib/Service/FilesystemService.php | 61 ---------------------------- 2 files changed, 65 deletions(-) delete mode 100644 lib/Service/FilesystemService.php diff --git a/lib/Controller/AccountController.php b/lib/Controller/AccountController.php index 8fab6f27..b8e8c037 100644 --- a/lib/Controller/AccountController.php +++ b/lib/Controller/AccountController.php @@ -12,7 +12,6 @@ use OCA\EcloudAccounts\Exception\AddUsernameToCommonStoreException; use OCA\EcloudAccounts\Exception\LDAPUserCreationException; use OCA\EcloudAccounts\Exception\RecoveryEmailValidationException; use OCA\EcloudAccounts\Service\CaptchaService; -use OCA\EcloudAccounts\Service\FilesystemService; use OCA\EcloudAccounts\Service\HCaptchaService; use OCA\EcloudAccounts\Service\NewsLetterService; use OCA\EcloudAccounts\Service\UserService; @@ -46,7 +45,6 @@ class AccountController extends Controller { private IConfig $config; private IInitialState $initialState; private IAppData $appData; - private FilesystemService $fsService; private const SESSION_VERIFIED_USERNAME = 'verified_username'; private const SESSION_VERIFIED_DISPLAYNAME = 'verified_displayname'; private const CAPTCHA_VERIFIED_CHECK = 'captcha_verified'; @@ -72,7 +70,6 @@ class AccountController extends Controller { ILogger $logger, IInitialState $initialState, IAppData $appData, - FilesystemService $fsService ) { parent::__construct($AppName, $request); $this->appName = $AppName; @@ -89,7 +86,6 @@ class AccountController extends Controller { $this->request = $request; $this->initialState = $initialState; $this->appData = $appData; - $this->fsService = $fsService; } /** diff --git a/lib/Service/FilesystemService.php b/lib/Service/FilesystemService.php deleted file mode 100644 index 3ac7f25b..00000000 --- a/lib/Service/FilesystemService.php +++ /dev/null @@ -1,61 +0,0 @@ -userManager = $userManager; - $this->config = $config; - $this->logger = $logger; - $this->groupManager = $groupManager; - } - - public function addUserInFilesEnabledGroup($username): bool { - $user = $this->userManager->get($username); - if (!$user) { - return false; - } - - $groupName = $this->config->getSystemValue('files_access_group_name', ''); - if (!$this->groupManager->groupExists($groupName)) { - $this->logger->error("$groupName group not exist."); - return false; - } - - $group = $this->groupManager->get($groupName); - $group->addUser($user); - return true; - } - - public function checkFilesGroupAccess($username): bool { - $groupName = $this->config->getSystemValue('files_access_group_name', ''); - - if (!$this->groupManager->groupExists($groupName)) { - $this->logger->error("$groupName group not exist."); - return false; - } - - if ($this->groupManager->isInGroup($username, $groupName)) { - return true; - } - - return false; - } - -} -- GitLab