diff --git a/l10n/de.js b/l10n/de.js index 8598186822ec82419536dc37c527d485f0a6b221..1bfab173f73b3e143ad2c6b5f035e18f11a7a306 100644 --- a/l10n/de.js +++ b/l10n/de.js @@ -83,6 +83,7 @@ OC.L10N.register( "Recovery email address is already taken.": "Die E-Mail-Adresse für die Wiederherstellung ist bereits vergeben.", "You cannot set an email address with a Murena domain as recovery email address.": "Sie können keine E-Mail-Adresse mit einer Murena-Domäne als Wiederherstellungs-E-Mail-Adresse festlegen.", "Captcha is not verified!": "Captcha wird nicht überprüft!", - "A server-side error occurred while processing your request! Please try again later.": "Ein serverseitiger Fehler ist bei der Bearbeitung Ihrer Anfrage aufgetreten! Bitte versuchen Sie es später noch einmal." + "A server-side error occurred while processing your request! Please try again later.": "Ein serverseitiger Fehler ist bei der Bearbeitung Ihrer Anfrage aufgetreten! Bitte versuchen Sie es später noch einmal.", + "An error occurred while creating your account!": "Beim Anlegen Ihres Kontos ist ein Fehler aufgetreten!" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/de.json b/l10n/de.json index 93a91342e433e42322ad0406582f34d1b4847639..2c366a49d06ada033ec4cb46899676998df776ef 100644 --- a/l10n/de.json +++ b/l10n/de.json @@ -81,7 +81,8 @@ "Recovery email address is already taken.": "Die E-Mail-Adresse für die Wiederherstellung ist bereits vergeben.", "You cannot set an email address with a Murena domain as recovery email address.": "Sie können keine E-Mail-Adresse mit einer Murena-Domäne als Wiederherstellungs-E-Mail-Adresse festlegen.", "Captcha is not verified!": "Captcha wird nicht überprüft!", - "A server-side error occurred while processing your request! Please try again later.": "Ein serverseitiger Fehler ist bei der Bearbeitung Ihrer Anfrage aufgetreten! Bitte versuchen Sie es später noch einmal." + "A server-side error occurred while processing your request! Please try again later.": "Ein serverseitiger Fehler ist bei der Bearbeitung Ihrer Anfrage aufgetreten! Bitte versuchen Sie es später noch einmal.", + "An error occurred while creating your account!": "Beim Anlegen Ihres Kontos ist ein Fehler aufgetreten!" }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/en.js b/l10n/en.js index 70409d73331a319537989f5395c0093877f5dc5c..6f8b11605efb339b94877289cd4509e87d3e1dd8 100644 --- a/l10n/en.js +++ b/l10n/en.js @@ -87,6 +87,7 @@ OC.L10N.register( "Recovery email address is already taken.": "Recovery email address is already taken.", "You cannot set an email address with a Murena domain as recovery email address.": "You cannot set an email address with a Murena domain as recovery email address.", "Captcha is not verified!": "Captcha is not verified!", - "A server-side error occurred while processing your request! Please try again later.": "A server-side error occurred while processing your request! Please try again later." + "A server-side error occurred while processing your request! Please try again later.": "A server-side error occurred while processing your request! Please try again later.", + "An error occurred while creating your account!": "An error occurred while creating your account!" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/en.json b/l10n/en.json index cb4466117c30babd0aa6eb1d32b420ab9aeb1cd0..218c52744873f26e7d1529ee4e11152ec57bc497 100644 --- a/l10n/en.json +++ b/l10n/en.json @@ -83,7 +83,8 @@ "Recovery email address is already taken.": "Recovery email address is already taken.", "You cannot set an email address with a Murena domain as recovery email address.": "You cannot set an email address with a Murena domain as recovery email address.", "Captcha is not verified!": "Captcha is not verified!", - "A server-side error occurred while processing your request! Please try again later.": "A server-side error occurred while processing your request! Please try again later." + "A server-side error occurred while processing your request! Please try again later.": "A server-side error occurred while processing your request! Please try again later.", + "An error occurred while creating your account!": "An error occurred while creating your account!" }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/es.js b/l10n/es.js index 619717cb9ae36c425e95fc44c8977c1df13f9fde..95703173aba8d355dd36668376378465a8752f2f 100644 --- a/l10n/es.js +++ b/l10n/es.js @@ -85,6 +85,7 @@ OC.L10N.register( "Recovery email address is already taken.": "La dirección de correo electrónico de recuperación ya está ocupada.", "You cannot set an email address with a Murena domain as recovery email address.": "No puede establecer una dirección de correo electrónico con un dominio de Murena como dirección de correo electrónico de recuperación.", "Captcha is not verified!": "¡Captcha no está verificado!", - "A server-side error occurred while processing your request! Please try again later.": "Hubo un error en el servidor al procesar tu solicitud. Por favor, inténtalo más tarde." + "A server-side error occurred while processing your request! Please try again later.": "Hubo un error en el servidor al procesar tu solicitud. Por favor, inténtalo más tarde.", + "An error occurred while creating your account!": "¡Hubo un error creando tu cuenta!" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/es.json b/l10n/es.json index 13871c869920d97b294cfe01d0175c30697aa70e..399c0553ba3fad59e0df2cb67821052490667d1b 100644 --- a/l10n/es.json +++ b/l10n/es.json @@ -84,7 +84,8 @@ "Recovery email address is already taken.": "La dirección de correo electrónico de recuperación ya está ocupada.", "You cannot set an email address with a Murena domain as recovery email address.": "No puede establecer una dirección de correo electrónico con un dominio de Murena como dirección de correo electrónico de recuperación.", "Captcha is not verified!": "¡Captcha no está verificado!", - "A server-side error occurred while processing your request! Please try again later.": "Hubo un error en el servidor al procesar tu solicitud. Por favor, inténtalo más tarde." + "A server-side error occurred while processing your request! Please try again later.": "Hubo un error en el servidor al procesar tu solicitud. Por favor, inténtalo más tarde.", + "An error occurred while creating your account!": "¡Hubo un error creando tu cuenta!" }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/fr.js b/l10n/fr.js index 2c4914e00b1230b4a04de37a5330540c8cdbaaf4..2f4e72f97d599cf69eba82eb244cb16eba3b9a18 100644 --- a/l10n/fr.js +++ b/l10n/fr.js @@ -84,6 +84,7 @@ OC.L10N.register( "Recovery email address is already taken.": "L'adresse électronique de récupération est déjà prise.", "You cannot set an email address with a Murena domain as recovery email address.": "Vous ne pouvez pas définir une adresse électronique avec un domaine Murena comme adresse électronique de récupération.", "Captcha is not verified!": "Captcha n'est pas vérifié !", - "A server-side error occurred while processing your request! Please try again later.": "Erreur du serveur dans la gestion de votre demande ! Merci d'essayer ultérieurement." + "A server-side error occurred while processing your request! Please try again later.": "Erreur du serveur dans la gestion de votre demande ! Merci d'essayer ultérieurement.", + "An error occurred while creating your account!": "Une erreur s'est produite lors de la création de votre compte!" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/fr.json b/l10n/fr.json index 60e11c06121b9a637af2e4ba8ef532ecb5638ca8..6f7697ec7002be4c5f3cfe2570f06c6bb61fa77f 100644 --- a/l10n/fr.json +++ b/l10n/fr.json @@ -83,7 +83,8 @@ "Recovery email address is already taken.": "L'adresse électronique de récupération est déjà prise.", "You cannot set an email address with a Murena domain as recovery email address.": "Vous ne pouvez pas définir une adresse électronique avec un domaine Murena comme adresse électronique de récupération.", "Captcha is not verified!": "Captcha n'est pas vérifié !", - "A server-side error occurred while processing your request! Please try again later.": "Erreur du serveur dans la gestion de votre demande ! Merci d'essayer ultérieurement." + "A server-side error occurred while processing your request! Please try again later.": "Erreur du serveur dans la gestion de votre demande ! Merci d'essayer ultérieurement.", + "An error occurred while creating your account!": "Une erreur s'est produite lors de la création de votre compte!" }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/it.js b/l10n/it.js index 7a246e1e80d3161fd8888874ba040d9b8af666bf..b65ec70513b817fba82881f3e6f4154ec8fb3749 100644 --- a/l10n/it.js +++ b/l10n/it.js @@ -84,6 +84,7 @@ OC.L10N.register( "Recovery email address is already taken.": "L'indirizzo e-mail di recupero è già stato preso.", "You cannot set an email address with a Murena domain as recovery email address.": "Non è possibile impostare un indirizzo e-mail con un dominio Murena come indirizzo e-mail di recupero.", "Captcha is not verified!": "Il Captcha non è verificato!", - "A server-side error occurred while processing your request! Please try again later.": "Si è verificato un errore lato server nel processare la tua richiesta! Ritenta più tardi." + "A server-side error occurred while processing your request! Please try again later.": "Si è verificato un errore lato server nel processare la tua richiesta! Ritenta più tardi.", + "An error occurred while creating your account!": "Si è verificato un errore nella creazione dell'account!" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/it.json b/l10n/it.json index a62613bd7e57b08bdc54d89c8496138fbce24634..0f03e188057ba79fb7d4f4f4a423d0f89896e248 100644 --- a/l10n/it.json +++ b/l10n/it.json @@ -79,7 +79,8 @@ "Recovery email address is already taken.": "L'indirizzo e-mail di recupero è già stato preso.", "You cannot set an email address with a Murena domain as recovery email address.": "Non è possibile impostare un indirizzo e-mail con un dominio Murena come indirizzo e-mail di recupero.", "Captcha is not verified!": "Il Captcha non è verificato!", - "A server-side error occurred while processing your request! Please try again later.": "Si è verificato un errore lato server nel processare la tua richiesta! Ritenta più tardi." + "A server-side error occurred while processing your request! Please try again later.": "Si è verificato un errore lato server nel processare la tua richiesta! Ritenta più tardi.", + "An error occurred while creating your account!": "Si è verificato un errore nella creazione dell'account!" }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/lib/Controller/AccountController.php b/lib/Controller/AccountController.php index 18a1613a76a62d7c36f1913618a6d9ec74d5b766..17d6e4c923ee18a5a2d396e290e005d553c4a4e5 100644 --- a/lib/Controller/AccountController.php +++ b/lib/Controller/AccountController.php @@ -169,7 +169,8 @@ class AccountController extends Controller { $response->setData(['message' => 'A server-side error occurred while processing your request! Please try again later.', 'success' => false]); $response->setStatus(500); } catch (Exception $e) { - $response->setData(['message' => $e->getMessage(), 'success' => false]); + $this->logger->logException($e, ['app' => Application::APP_ID]); + $response->setData(['message' => 'An error occurred while creating your account!', 'success' => false]); $response->setStatus(500); } diff --git a/lib/Service/UserService.php b/lib/Service/UserService.php index 5b3d20556d78a06b1a213fe5bd2140556e64108a..3cb2b910ceb07dbba940a516b3413ed040e944aa 100644 --- a/lib/Service/UserService.php +++ b/lib/Service/UserService.php @@ -126,6 +126,7 @@ class UserService { $this->config->setUserValue($uid, 'hide-my-email', 'email-aliases', $aliases); return true; } catch (UnexpectedValueException $e) { + $this->logger->error("Error adding HME alias '$alias' to config for user with UID: $uid. Error: " . $e->getMessage()); return false; } } @@ -247,13 +248,12 @@ class UserService { public function registerUser(string $displayname, string $recoveryEmail, string $username, string $userEmail, string $password): array { if ($this->userExists($username)) { - throw new Exception("Username is already taken."); + throw new Exception("Username '$username' is already taken."); } if (!empty($recoveryEmail)) { $this->validateRecoveryEmail($recoveryEmail); } return $this->addNewUserToLDAP($displayname, $recoveryEmail, $username, $userEmail, $password); - } /** * Validates the recovery email address. @@ -285,7 +285,7 @@ class UserService { * @return array Information about the added user. * @throws LDAPUserCreationException If there is an error adding new entry to LDAP store */ - private function addNewUserToLDAP(string $displayname, string $recoveryEmail, string $username, string $userEmail, string $password): ?array { + private function addNewUserToLDAP(string $displayName, string $recoveryEmail, string $username, string $userEmail, string $password): ?array { $connection = $this->LDAPConnectionService->getLDAPConnection(); $base = $this->LDAPConnectionService->getLDAPBaseUsers()[0]; @@ -296,7 +296,7 @@ class UserService { 'username' => $username, 'usernameWithoutDomain' => $username, 'userPassword' => $password, - 'displayName' => $displayname, + 'displayName' => $displayName, 'quota' => $quota, 'recoveryMailAddress' => $recoveryEmail, 'active' => 'TRUE', @@ -394,8 +394,10 @@ class UserService { if($hmeAlias != '') { $hmeAliasAdded = $this->addHMEAliasInConfig($username, $hmeAlias); if (!$hmeAliasAdded) { - $this->logger->error('Error adding HME Alias in config.'); + $this->logger->error("Failed to add HME Alias '$hmeAlias' for username '$username' in config."); } + } else { + $this->logger->error("Failed to create HME Alias for username '$username'. Response: " . json_encode($result)); } } /** @@ -426,6 +428,9 @@ class UserService { $result = $this->curl->post($url, $data, $headers); $result = json_decode($result, true); + if ($this->curl->getLastStatusCode() !== 200) { + $this->logger->error("Failed to create new domain alias '$username' for email '$userEmail'."); + } return $result; } /** @@ -440,10 +445,8 @@ class UserService { public function setAccountDataLocally(string $uid, string $mailAddress, string $quota): void { $user = $this->getUser($uid); if (is_null($user)) { - $this->logger->error('User not found'); - return; + throw new Exception("User with username '$uid' not found."); } - // Set the email address for the user $user->setEMailAddress($mailAddress); @@ -477,8 +480,7 @@ class UserService { if ($statusCode === 200) { return true; } - - throw new Exception("Error checking if username is taken at common source, status code: " . (string) $statusCode); + throw new Exception("Error checking if username '$username' is taken at common source, status code: " . (string) $statusCode); } public function addUsernameToCommonDataStore(string $username) : void { @@ -503,7 +505,7 @@ class UserService { $this->curl->post($url, $params, $headers); if ($this->curl->getLastStatusCode() !== 200) { - throw new Exception('Error adding username ' . $username . ' to common data store'); + throw new Exception("Error adding username '$username' to common data store."); } } }