Loading lib/Controller/UserController.php +13 −6 Original line number Diff line number Diff line Loading @@ -41,15 +41,22 @@ class UserController extends ApiController return $response; } $this->userService->setEmail($uid, $email); $this->userService->setQuota($uid, $quota); $recoveryEmailSuccess = $this->userService->setRecoveryEmail($uid, $recoveryEmail); if(!$recoveryEmailSuccess) { return $this->getErrorResponse($response, 'error_setting_recovery', 400); $user = $this->userService->getUser($uid); if(is_null($user)) { $response->setStatus(404); return $response; } $createdFolder = $this->userService->createUserFolder($uid); $user->setEMailAddress($email); $user->setQuota($quota); $recoveryEmailUpdated = $this->userService->setRecoveryEmail($uid, $recoveryEmail); if(!$recoveryEmailUpdated) { return $this->getErrorResponse($response, 'error_setting_recovery', 400); } $createdFolder = $this->userService->createUserFolder($uid); if(!$createdFolder){ return $this->getErrorResponse($response, 'error_creating_user_folder', 500); } Loading lib/Service/UserService.php +3 −12 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ declare(strict_types=1); namespace OCA\EcloudAccounts\Service; use OCP\IUserManager; use OCP\IUser; use OCP\IConfig; use UnexpectedValueException; Loading Loading @@ -46,18 +47,8 @@ class UserService return $this->userManager->userExists($uid); } public function setEmail(string $uid, string $email): void { $user = $this->userManager->get($uid); if (is_null($user)) return; $user->setEMailAddress($email); } public function setQuota(string $uid, string $quota): void { $user = $this->userManager->get($uid); if (is_null($user)) return; $user->setQuota($quota); public function getUser(string $uid) : ?IUser { return $this->userManager->get($uid); } public function setRecoveryEmail(string $uid, string $recoveryEmail) : bool { Loading Loading
lib/Controller/UserController.php +13 −6 Original line number Diff line number Diff line Loading @@ -41,15 +41,22 @@ class UserController extends ApiController return $response; } $this->userService->setEmail($uid, $email); $this->userService->setQuota($uid, $quota); $recoveryEmailSuccess = $this->userService->setRecoveryEmail($uid, $recoveryEmail); if(!$recoveryEmailSuccess) { return $this->getErrorResponse($response, 'error_setting_recovery', 400); $user = $this->userService->getUser($uid); if(is_null($user)) { $response->setStatus(404); return $response; } $createdFolder = $this->userService->createUserFolder($uid); $user->setEMailAddress($email); $user->setQuota($quota); $recoveryEmailUpdated = $this->userService->setRecoveryEmail($uid, $recoveryEmail); if(!$recoveryEmailUpdated) { return $this->getErrorResponse($response, 'error_setting_recovery', 400); } $createdFolder = $this->userService->createUserFolder($uid); if(!$createdFolder){ return $this->getErrorResponse($response, 'error_creating_user_folder', 500); } Loading
lib/Service/UserService.php +3 −12 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ declare(strict_types=1); namespace OCA\EcloudAccounts\Service; use OCP\IUserManager; use OCP\IUser; use OCP\IConfig; use UnexpectedValueException; Loading Loading @@ -46,18 +47,8 @@ class UserService return $this->userManager->userExists($uid); } public function setEmail(string $uid, string $email): void { $user = $this->userManager->get($uid); if (is_null($user)) return; $user->setEMailAddress($email); } public function setQuota(string $uid, string $quota): void { $user = $this->userManager->get($uid); if (is_null($user)) return; $user->setQuota($quota); public function getUser(string $uid) : ?IUser { return $this->userManager->get($uid); } public function setRecoveryEmail(string $uid, string $recoveryEmail) : bool { Loading