Loading lib/Controller/AccountController.php +8 −8 Original line number Diff line number Diff line Loading @@ -8,7 +8,6 @@ namespace OCA\EcloudAccounts\Controller; use Exception; use OCA\EcloudAccounts\AppInfo\Application; use OCA\EcloudAccounts\Exception\AddUsernameToCommonStoreException; use OCA\EcloudAccounts\Exception\LDAPUserCreationException; use OCA\EcloudAccounts\Exception\RecoveryEmailValidationException; use OCA\EcloudAccounts\Service\CaptchaService; Loading Loading @@ -190,7 +189,14 @@ class AccountController extends Controller { $userEmail = $username.'@'.$mainDomain; $this->userService->registerUser($displayname, $recoveryEmail, $username, $userEmail, $password, $language); sleep(5); try { // Don't want this operation to block the rest of registration logic // so we need a nested try-catch $ipAddress = $this->request->getRemoteAddress(); $this->userService->addUsernameToCommonDataStore($username, $ipAddress, $recoveryEmail); } catch (\Throwable $e) { $this->logger->logException($e, ['app' => Application::APP_ID]); } $this->userService->setAccountDataLocally($username, $userEmail); $this->userService->createHMEAlias($username, $userEmail); $this->userService->createNewDomainAlias($username, $userEmail); Loading @@ -207,8 +213,6 @@ class AccountController extends Controller { $this->session->remove(self::SESSION_VERIFIED_USERNAME); $this->session->remove(self::SESSION_VERIFIED_DISPLAYNAME); $this->session->remove(self::CAPTCHA_VERIFIED_CHECK); $ipAddress = $this->request->getRemoteAddress(); $this->userService->addUsernameToCommonDataStore($username, $ipAddress, $recoveryEmail); $response->setStatus(200); $response->setData(['success' => true]); Loading @@ -221,10 +225,6 @@ class AccountController extends Controller { $this->logger->logException($e, ['app' => Application::APP_ID]); $response->setData(['message' => $e->getMessage(), 'success' => false]); $response->setStatus(400); } catch (AddUsernameToCommonStoreException $e) { $this->logger->logException($e, ['app' => Application::APP_ID]); $response->setStatus(200); $response->setData(['success' => true]); } catch (Exception $e) { $this->logger->logException($e, ['app' => Application::APP_ID]); $response->setData(['message' => 'An error occurred while creating your account!', 'success' => false]); Loading Loading
lib/Controller/AccountController.php +8 −8 Original line number Diff line number Diff line Loading @@ -8,7 +8,6 @@ namespace OCA\EcloudAccounts\Controller; use Exception; use OCA\EcloudAccounts\AppInfo\Application; use OCA\EcloudAccounts\Exception\AddUsernameToCommonStoreException; use OCA\EcloudAccounts\Exception\LDAPUserCreationException; use OCA\EcloudAccounts\Exception\RecoveryEmailValidationException; use OCA\EcloudAccounts\Service\CaptchaService; Loading Loading @@ -190,7 +189,14 @@ class AccountController extends Controller { $userEmail = $username.'@'.$mainDomain; $this->userService->registerUser($displayname, $recoveryEmail, $username, $userEmail, $password, $language); sleep(5); try { // Don't want this operation to block the rest of registration logic // so we need a nested try-catch $ipAddress = $this->request->getRemoteAddress(); $this->userService->addUsernameToCommonDataStore($username, $ipAddress, $recoveryEmail); } catch (\Throwable $e) { $this->logger->logException($e, ['app' => Application::APP_ID]); } $this->userService->setAccountDataLocally($username, $userEmail); $this->userService->createHMEAlias($username, $userEmail); $this->userService->createNewDomainAlias($username, $userEmail); Loading @@ -207,8 +213,6 @@ class AccountController extends Controller { $this->session->remove(self::SESSION_VERIFIED_USERNAME); $this->session->remove(self::SESSION_VERIFIED_DISPLAYNAME); $this->session->remove(self::CAPTCHA_VERIFIED_CHECK); $ipAddress = $this->request->getRemoteAddress(); $this->userService->addUsernameToCommonDataStore($username, $ipAddress, $recoveryEmail); $response->setStatus(200); $response->setData(['success' => true]); Loading @@ -221,10 +225,6 @@ class AccountController extends Controller { $this->logger->logException($e, ['app' => Application::APP_ID]); $response->setData(['message' => $e->getMessage(), 'success' => false]); $response->setStatus(400); } catch (AddUsernameToCommonStoreException $e) { $this->logger->logException($e, ['app' => Application::APP_ID]); $response->setStatus(200); $response->setData(['success' => true]); } catch (Exception $e) { $this->logger->logException($e, ['app' => Application::APP_ID]); $response->setData(['message' => 'An error occurred while creating your account!', 'success' => false]); Loading