Loading appinfo/routes.php +1 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ return ['routes' => [ ['name' => 'user#set_account_data', 'url' => '/api/set_account_data', 'verb' => 'POST'], ['name' => 'user#user_exists', 'url' => '/api/user_exists', 'verb' => 'POST'], [ 'name' => 'user#preflighted_cors', 'url' => '/api/{path}', 'verb' => 'OPTIONS', 'requirements' => array('path' => '.+') Loading lib/Controller/UserController.php +21 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,23 @@ class UserController extends ApiController $this->userService = $userService; } /** * @CORS * @PublicPage * @NoCSRFRequired */ public function userExists(string $token, string $uid): DataResponse { $response = new DataResponse(); if (!$this->checkAppCredentials($token)) { $response->setStatus(401); return $response; } $response->setData($this->userService->userExists($uid)); return $response; } /** * @CORS * @PublicPage Loading Loading @@ -56,7 +73,10 @@ class UserController extends ApiController return $this->getErrorResponse($response, 'error_setting_recovery', 400); } $createdFolder = true; if ($this->userService->isShardingEnabled()) { $createdFolder = $this->userService->createUserFolder($uid); } if (!$createdFolder) { $response->setStatus(500); } Loading lib/Service/UserService.php +1 −5 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ class UserService $this->appConfig = $this->config->getSystemValue($appName); } private function isShardingEnabled(): bool public function isShardingEnabled(): bool { $shardingEnabled = $this->config->getSystemValue('user_folder_sharding', false); return $shardingEnabled; Loading Loading @@ -65,10 +65,6 @@ class UserService public function createUserFolder(string $uid): bool { // return true as creation can be handled at login if sharding disabled if (!$this->isShardingEnabled()) { return true; } $realDataDir = $this->getConfigValue('realdatadirectory'); $ncDataDir = $this->config->getSystemValue('datadirectory'); Loading Loading
appinfo/routes.php +1 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ return ['routes' => [ ['name' => 'user#set_account_data', 'url' => '/api/set_account_data', 'verb' => 'POST'], ['name' => 'user#user_exists', 'url' => '/api/user_exists', 'verb' => 'POST'], [ 'name' => 'user#preflighted_cors', 'url' => '/api/{path}', 'verb' => 'OPTIONS', 'requirements' => array('path' => '.+') Loading
lib/Controller/UserController.php +21 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,23 @@ class UserController extends ApiController $this->userService = $userService; } /** * @CORS * @PublicPage * @NoCSRFRequired */ public function userExists(string $token, string $uid): DataResponse { $response = new DataResponse(); if (!$this->checkAppCredentials($token)) { $response->setStatus(401); return $response; } $response->setData($this->userService->userExists($uid)); return $response; } /** * @CORS * @PublicPage Loading Loading @@ -56,7 +73,10 @@ class UserController extends ApiController return $this->getErrorResponse($response, 'error_setting_recovery', 400); } $createdFolder = true; if ($this->userService->isShardingEnabled()) { $createdFolder = $this->userService->createUserFolder($uid); } if (!$createdFolder) { $response->setStatus(500); } Loading
lib/Service/UserService.php +1 −5 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ class UserService $this->appConfig = $this->config->getSystemValue($appName); } private function isShardingEnabled(): bool public function isShardingEnabled(): bool { $shardingEnabled = $this->config->getSystemValue('user_folder_sharding', false); return $shardingEnabled; Loading Loading @@ -65,10 +65,6 @@ class UserService public function createUserFolder(string $uid): bool { // return true as creation can be handled at login if sharding disabled if (!$this->isShardingEnabled()) { return true; } $realDataDir = $this->getConfigValue('realdatadirectory'); $ncDataDir = $this->config->getSystemValue('datadirectory'); Loading