From e19f384f5ec644558300d91faa11190677db7442 Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Thu, 5 Sep 2024 18:41:07 +0530 Subject: [PATCH 01/21] Username validation while checking for username --- lib/Controller/AccountController.php | 10 ++++++++++ src/signup/RegistrationForm.vue | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/Controller/AccountController.php b/lib/Controller/AccountController.php index b6aab241..b3771b6a 100644 --- a/lib/Controller/AccountController.php +++ b/lib/Controller/AccountController.php @@ -255,6 +255,16 @@ class AccountController extends Controller { if (empty($username)) { return $response; } + $inputData = [ + 'username' => ['value' => $username, 'maxLength' => 30] + ]; + + $validationError = $this->validateInput('username', $username, 30); + if ($validationError !== null) { + $response->setData(['message' => $validationError, 'success' => false]); + $response->setStatus(403); + return $response; + } try { $username = mb_strtolower($username, 'UTF-8'); diff --git a/src/signup/RegistrationForm.vue b/src/signup/RegistrationForm.vue index 34d85342..59d461fd 100644 --- a/src/signup/RegistrationForm.vue +++ b/src/signup/RegistrationForm.vue @@ -284,7 +284,9 @@ export default { this.isUsernameAvailable = true } catch (error) { this.validation.isUsernameNotValid = true - if (error.response && error.response.status === 400) { + if (error.response && error.response.status === 403) { + this.usernameValidationMessage = t(this.appName, error.response.message) + } if (error.response && error.response.status === 400) { this.usernameValidationMessage = t(this.appName, 'Username is already taken.') } else { this.usernameValidationMessage = t(this.appName, 'Something went wrong.') -- GitLab From 02cf2cf6029158b08a03c37eb1df1910f60f684b Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Thu, 5 Sep 2024 18:47:34 +0530 Subject: [PATCH 02/21] allow dot in username --- lib/Controller/AccountController.php | 5 +---- src/signup/RegistrationForm.vue | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/Controller/AccountController.php b/lib/Controller/AccountController.php index b3771b6a..b6206b32 100644 --- a/lib/Controller/AccountController.php +++ b/lib/Controller/AccountController.php @@ -255,10 +255,7 @@ class AccountController extends Controller { if (empty($username)) { return $response; } - $inputData = [ - 'username' => ['value' => $username, 'maxLength' => 30] - ]; - + $validationError = $this->validateInput('username', $username, 30); if ($validationError !== null) { $response->setData(['message' => $validationError, 'success' => false]); diff --git a/src/signup/RegistrationForm.vue b/src/signup/RegistrationForm.vue index 59d461fd..d6c96a08 100644 --- a/src/signup/RegistrationForm.vue +++ b/src/signup/RegistrationForm.vue @@ -259,7 +259,7 @@ export default { this.validation.isUsernameNotValid = false this.usernameValidationMessage = '' this.isUsernameAvailable = false - const usernamePattern = /^[a-zA-Z0-9_-]+$/ + const usernamePattern = /^[a-zA-Z0-9._-]+$/ const minCharacterCount = 3 const isValidUsername = usernamePattern.test(this.formData.username) const isEnoughCharacters = this.formData.username.length >= minCharacterCount -- GitLab From 984fb47cf202806a4bc8f006c201885d52abb5cc Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Thu, 5 Sep 2024 18:53:24 +0530 Subject: [PATCH 03/21] temp error --- lib/Controller/AccountController.php | 2 +- src/signup/RegistrationForm.vue | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Controller/AccountController.php b/lib/Controller/AccountController.php index b6206b32..ca3cf59e 100644 --- a/lib/Controller/AccountController.php +++ b/lib/Controller/AccountController.php @@ -231,7 +231,7 @@ class AccountController extends Controller { } if ($maxLength !== null && strlen($value) > $maxLength) { - return "$inputName is too large."; + return ucwords($inputName)." is too large."; } return null; // Validation passed diff --git a/src/signup/RegistrationForm.vue b/src/signup/RegistrationForm.vue index d6c96a08..d04d71a1 100644 --- a/src/signup/RegistrationForm.vue +++ b/src/signup/RegistrationForm.vue @@ -283,6 +283,7 @@ export default { await Axios.post(url, data) this.isUsernameAvailable = true } catch (error) { + console.error(error) this.validation.isUsernameNotValid = true if (error.response && error.response.status === 403) { this.usernameValidationMessage = t(this.appName, error.response.message) -- GitLab From 68aa855841a3fc9f232a846e72214e0b61023932 Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Thu, 5 Sep 2024 19:04:49 +0530 Subject: [PATCH 04/21] changes --- src/signup/RegistrationForm.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/signup/RegistrationForm.vue b/src/signup/RegistrationForm.vue index d04d71a1..95e81623 100644 --- a/src/signup/RegistrationForm.vue +++ b/src/signup/RegistrationForm.vue @@ -286,7 +286,7 @@ export default { console.error(error) this.validation.isUsernameNotValid = true if (error.response && error.response.status === 403) { - this.usernameValidationMessage = t(this.appName, error.response.message) + this.usernameValidationMessage = t(this.appName, error.response.data.message) } if (error.response && error.response.status === 400) { this.usernameValidationMessage = t(this.appName, 'Username is already taken.') } else { -- GitLab From 190996b91f3621d34ca8a7713e6a828e99a355e2 Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Thu, 5 Sep 2024 19:12:18 +0530 Subject: [PATCH 05/21] console error --- src/signup/RegistrationForm.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/signup/RegistrationForm.vue b/src/signup/RegistrationForm.vue index 95e81623..40dfe37c 100644 --- a/src/signup/RegistrationForm.vue +++ b/src/signup/RegistrationForm.vue @@ -283,7 +283,8 @@ export default { await Axios.post(url, data) this.isUsernameAvailable = true } catch (error) { - console.error(error) + console.error(error.response) + console.error(error.response.status) this.validation.isUsernameNotValid = true if (error.response && error.response.status === 403) { this.usernameValidationMessage = t(this.appName, error.response.data.message) -- GitLab From f45fe4dadf4cb35d59d15a3a03a1e28ffb3cb362 Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Thu, 5 Sep 2024 19:51:48 +0530 Subject: [PATCH 06/21] else if change --- src/signup/RegistrationForm.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/signup/RegistrationForm.vue b/src/signup/RegistrationForm.vue index 40dfe37c..f97b8cb2 100644 --- a/src/signup/RegistrationForm.vue +++ b/src/signup/RegistrationForm.vue @@ -288,7 +288,7 @@ export default { this.validation.isUsernameNotValid = true if (error.response && error.response.status === 403) { this.usernameValidationMessage = t(this.appName, error.response.data.message) - } if (error.response && error.response.status === 400) { + } else if (error.response && error.response.status === 400) { this.usernameValidationMessage = t(this.appName, 'Username is already taken.') } else { this.usernameValidationMessage = t(this.appName, 'Something went wrong.') -- GitLab From 0771ab62d4880a7a040c6a3c00d2f37915deff97 Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Thu, 5 Sep 2024 19:53:04 +0530 Subject: [PATCH 07/21] cs fixer --- lib/Controller/AccountController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Controller/AccountController.php b/lib/Controller/AccountController.php index ca3cf59e..f9060343 100644 --- a/lib/Controller/AccountController.php +++ b/lib/Controller/AccountController.php @@ -227,7 +227,7 @@ class AccountController extends Controller { */ private function validateInput(string $inputName, string $value, ?int $maxLength = null) : ?string { if ($value === '') { - return "$inputName is required."; + return ucwords($inputName)." is required."; } if ($maxLength !== null && strlen($value) > $maxLength) { -- GitLab From e57803a56b293371267d908a0eedc42cec16b6fb Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Thu, 5 Sep 2024 20:01:06 +0530 Subject: [PATCH 08/21] Translations added --- l10n/de.js | 5 +++-- l10n/de.json | 5 +++-- l10n/de_DE.js | 5 +++-- l10n/de_DE.json | 5 +++-- l10n/en.js | 5 +++-- l10n/en.json | 5 +++-- l10n/es.js | 5 +++-- l10n/es.json | 5 +++-- l10n/fr.js | 5 +++-- l10n/fr.json | 5 +++-- l10n/it.js | 5 +++-- l10n/it.json | 5 +++-- src/signup/RegistrationForm.vue | 2 +- 13 files changed, 37 insertions(+), 25 deletions(-) diff --git a/l10n/de.js b/l10n/de.js index cc5a45d0..0dcdc43b 100644 --- a/l10n/de.js +++ b/l10n/de.js @@ -59,7 +59,7 @@ OC.L10N.register( "Recovery Email": "Wiederherstellung E-Mail", "Display name is required.": "Anzeigename ist erforderlich.", "Username is required.": "Der Benutzername ist erforderlich.", - "Username must consist of letters, numbers, hyphens, and underscores only.": "Der Benutzername darf nur aus Buchstaben, Zahlen, Bindestrichen und Unterstrichen bestehen.", + "Username must consist of letters, numbers, hyphens, dots and underscores only.": "Der Benutzername darf nur aus Buchstaben, Zahlen, Bindestrichen, Punkten und Unterstrichen bestehen.", "Username must be at least 3 characters long.": "Der Benutzername muss mindestens 3 Zeichen lang sein.", "Username is already taken.": "Benutzername ist bereits vergeben.", "Password is required.": "Passwort ist erforderlich.", @@ -82,6 +82,7 @@ OC.L10N.register( "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.", "An error occurred while creating your account!": "Beim Anlegen Ihres Kontos ist ein Fehler aufgetreten!", - "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Wenn Sie eine Nachricht sehen, die besagt \"Google hasn't verified this app\", können Sie diese ignorieren, indem Sie auf \"Advanced\" klicken. Wir arbeiten derzeit daran, die erforderliche Zertifizierung von Google zu erhalten, um diese Nachricht zu entfernen." + "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Wenn Sie eine Nachricht sehen, die besagt \"Google hasn't verified this app\", können Sie diese ignorieren, indem Sie auf \"Advanced\" klicken. Wir arbeiten derzeit daran, die erforderliche Zertifizierung von Google zu erhalten, um diese Nachricht zu entfernen.", + "Username is too large.": "Der Benutzername ist zu groß." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/de.json b/l10n/de.json index a026300f..2e4b14a8 100644 --- a/l10n/de.json +++ b/l10n/de.json @@ -58,7 +58,7 @@ "Recovery Email": "Wiederherstellung E-Mail", "Display name is required.": "Anzeigename ist erforderlich.", "Username is required.": "Der Benutzername ist erforderlich.", - "Username must consist of letters, numbers, hyphens, and underscores only.": "Der Benutzername darf nur aus Buchstaben, Zahlen, Bindestrichen und Unterstrichen bestehen.", + "Username must consist of letters, numbers, hyphens, dots and underscores only.": "Der Benutzername darf nur aus Buchstaben, Zahlen, Bindestrichen, Punkten und Unterstrichen bestehen.", "Username must be at least 3 characters long.": "Der Benutzername muss mindestens 3 Zeichen lang sein.", "Username is already taken.": "Benutzername ist bereits vergeben.", "Password is required.": "Passwort ist erforderlich.", @@ -80,7 +80,8 @@ "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.", "An error occurred while creating your account!": "Beim Anlegen Ihres Kontos ist ein Fehler aufgetreten!", - "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Wenn Sie eine Nachricht sehen, die besagt \"Google hasn't verified this app\", können Sie diese ignorieren, indem Sie auf \"Advanced\" tippen. Wir arbeiten derzeit daran, die erforderliche Zertifizierung von Google zu erhalten, um diese Fehlermeldung zu beseitigen." + "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Wenn Sie eine Nachricht sehen, die besagt \"Google hasn't verified this app\", können Sie diese ignorieren, indem Sie auf \"Advanced\" tippen. Wir arbeiten derzeit daran, die erforderliche Zertifizierung von Google zu erhalten, um diese Fehlermeldung zu beseitigen.", + "Username is too large.": "Der Benutzername ist zu groß." }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/de_DE.js b/l10n/de_DE.js index 4a2393cd..b8a8836e 100644 --- a/l10n/de_DE.js +++ b/l10n/de_DE.js @@ -59,7 +59,7 @@ OC.L10N.register( "Recovery Email": "Wiederherstellung E-Mail", "Display name is required.": "Anzeigename ist erforderlich.", "Username is required.": "Der Benutzername ist erforderlich.", - "Username must consist of letters, numbers, hyphens, and underscores only.": "Der Benutzername darf nur aus Buchstaben, Zahlen, Bindestrichen und Unterstrichen bestehen.", + "Username must consist of letters, numbers, hyphens, dots and underscores only.": "Der Benutzername darf nur aus Buchstaben, Zahlen, Bindestrichen, Punkten und Unterstrichen bestehen.", "Username must be at least 3 characters long.": "Der Benutzername muss mindestens 3 Zeichen lang sein.", "Username is already taken.": "Benutzername ist bereits vergeben.", "Password is required.": "Passwort ist erforderlich.", @@ -82,6 +82,7 @@ OC.L10N.register( "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.", "An error occurred while creating your account!": "Beim Anlegen Ihres Kontos ist ein Fehler aufgetreten!", - "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Wenn du eine Nachricht siehst, die besagt \"Google hasn't verified this app\", kannst du sie ignorieren, indem du auf \"Advanced\" klickst. Wir arbeiten derzeit daran, die erforderliche Zertifizierung von Google zu erhalten, um diese Nachricht zu entfernen." + "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Wenn du eine Nachricht siehst, die besagt \"Google hasn't verified this app\", kannst du sie ignorieren, indem du auf \"Advanced\" klickst. Wir arbeiten derzeit daran, die erforderliche Zertifizierung von Google zu erhalten, um diese Nachricht zu entfernen.", + "Username is too large.": "Der Benutzername ist zu groß." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/de_DE.json b/l10n/de_DE.json index fffb2d93..3071e5ed 100644 --- a/l10n/de_DE.json +++ b/l10n/de_DE.json @@ -58,7 +58,7 @@ "Recovery Email": "Wiederherstellung E-Mail", "Display name is required.": "Anzeigename ist erforderlich.", "Username is required.": "Der Benutzername ist erforderlich.", - "Username must consist of letters, numbers, hyphens, and underscores only.": "Der Benutzername darf nur aus Buchstaben, Zahlen, Bindestrichen und Unterstrichen bestehen.", + "Username must consist of letters, numbers, hyphens, dots and underscores only.": "Der Benutzername darf nur aus Buchstaben, Zahlen, Bindestrichen, Punkten und Unterstrichen bestehen.", "Username must be at least 3 characters long.": "Der Benutzername muss mindestens 3 Zeichen lang sein.", "Username is already taken.": "Benutzername ist bereits vergeben.", "Password is required.": "Passwort ist erforderlich.", @@ -80,7 +80,8 @@ "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.", "An error occurred while creating your account!": "Beim Anlegen Ihres Kontos ist ein Fehler aufgetreten!", - "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Wenn du eine Nachricht siehst, die besagt \"Google hasn't verified this app\", kannst du sie ignorieren, indem du auf \"Advanced\" tippst. Wir arbeiten derzeit daran, die erforderliche Zertifizierung von Google zu erhalten, um diese Fehlermeldung zu beseitigen." + "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Wenn du eine Nachricht siehst, die besagt \"Google hasn't verified this app\", kannst du sie ignorieren, indem du auf \"Advanced\" tippst. Wir arbeiten derzeit daran, die erforderliche Zertifizierung von Google zu erhalten, um diese Fehlermeldung zu beseitigen.", + "Username is too large.": "Der Benutzername ist zu groß." }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/en.js b/l10n/en.js index 0532b2a7..77dc15ce 100644 --- a/l10n/en.js +++ b/l10n/en.js @@ -62,7 +62,7 @@ OC.L10N.register( "Recovery Email": "Recovery Email", "Display name is required.": "Display name is required.", "Username is required.": "Username is required.", - "Username must consist of letters, numbers, hyphens, and underscores only.": "Username must consist of letters, numbers, hyphens, and underscores only.", + "Username must consist of letters, numbers, hyphens, dots and underscores only.": "Username must consist of letters, numbers, hyphens, dots and underscores only.", "Username must be at least 3 characters long.": "Username must be at least 3 characters long.", "Username is already taken.": "Username is already taken.", "Password is required.": "Password is required.", @@ -85,6 +85,7 @@ OC.L10N.register( "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.", "An error occurred while creating your account!": "An error occurred while creating your account!", - "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message." + "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.", + "Username is too large.": "Username is too large." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/en.json b/l10n/en.json index 9fd48d10..14051ad5 100644 --- a/l10n/en.json +++ b/l10n/en.json @@ -59,7 +59,7 @@ "Recovery Email": "Recovery Email", "Display name is required.": "Display name is required.", "Username is required.": "Username is required.", - "Username must consist of letters, numbers, hyphens, and underscores only.": "Username must consist of letters, numbers, hyphens, and underscores only.", + "Username must consist of letters, numbers, hyphens, dots and underscores only.": "Username must consist of letters, numbers, hyphens, dots and underscores only.", "Username must be at least 3 characters long.": "Username must be at least 3 characters long.", "Username is already taken.": "Username is already taken.", "Password is required.": "Password is required.", @@ -82,7 +82,8 @@ "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.", "An error occurred while creating your account!": "An error occurred while creating your account!", - "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message." + "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.", + "Username is too large.": "Username is too large." }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/es.js b/l10n/es.js index b287c5fd..eaa93f9a 100644 --- a/l10n/es.js +++ b/l10n/es.js @@ -61,7 +61,7 @@ OC.L10N.register( "Recovery Email": "Correo electrónico de recuperación", "Display name is required.": "El nombre para mostrar es obligatorio.", "Username is required.": "Nombre de usuario obligatorio.", - "Username must consist of letters, numbers, hyphens, and underscores only.": "El nombre de usuario debe estar compuesto únicamente por letras, números, guiones y guiones bajos.", + "Username must consist of letters, numbers, hyphens, dots and underscores only.": "El nombre de usuario debe estar compuesto únicamente por letras, números, guiones, puntos y guiones bajos.", "Username must be at least 3 characters long.": "El nombre de usuario debe tener al menos 3 caracteres.", "Username is already taken.": "El nombre de usuario ya está ocupado.", "Password is required.": "Se requiere contraseña.", @@ -84,6 +84,7 @@ OC.L10N.register( "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.", "An error occurred while creating your account!": "¡Hubo un error creando tu cuenta!", - "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Si ves un mensaje que dice \"Google hasn't verified this app\", puedes omitirlo haciendo clic en \"Advanced\". Actualmente estamos trabajando para obtener la certificación que Google exige para eliminar este mensaje." + "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Si ves un mensaje que dice \"Google hasn't verified this app\", puedes omitirlo haciendo clic en \"Advanced\". Actualmente estamos trabajando para obtener la certificación que Google exige para eliminar este mensaje.", + "Username is too large.": "El nombre de usuario es demasiado grande." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/es.json b/l10n/es.json index 38fed6a9..7fa1cb29 100644 --- a/l10n/es.json +++ b/l10n/es.json @@ -60,7 +60,7 @@ "Recovery Email": "Correo electrónico de recuperación", "Display name is required.": "El nombre para mostrar es obligatorio.", "Username is required.": "Nombre de usuario obligatorio.", - "Username must consist of letters, numbers, hyphens, and underscores only.": "El nombre de usuario debe estar compuesto únicamente por letras, números, guiones y guiones bajos.", + "Username must consist of letters, numbers, hyphens, dots and underscores only.": "El nombre de usuario debe estar compuesto únicamente por letras, números, guiones, puntos y guiones bajos.", "Username must be at least 3 characters long.": "El nombre de usuario debe tener al menos 3 caracteres.", "Username is already taken.": "El nombre de usuario ya está ocupado.", "Password is required.": "Se requiere contraseña.", @@ -83,7 +83,8 @@ "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.", "An error occurred while creating your account!": "¡Hubo un error creando tu cuenta!", - "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Si ves un mensaje que dice \"Google hasn't verified this app\", puedes omitirlo haciendo clic en \"Advanced\". Actualmente estamos trabajando para obtener la certificación que Google exige para eliminar este mensaje." + "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Si ves un mensaje que dice \"Google hasn't verified this app\", puedes omitirlo haciendo clic en \"Advanced\". Actualmente estamos trabajando para obtener la certificación que Google exige para eliminar este mensaje.", + "Username is too large.": "El nombre de usuario es demasiado grande." }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/fr.js b/l10n/fr.js index 78c2c1b4..83b45555 100644 --- a/l10n/fr.js +++ b/l10n/fr.js @@ -60,7 +60,7 @@ OC.L10N.register( "Recovery Email": "Récupération de l'email", "Display name is required.": "Le nom d'affichage est obligatoire.", "Username is required.": "Le nom d'utilisateur est requis.", - "Username must consist of letters, numbers, hyphens, and underscores only.": "Le nom d'utilisateur doit être composé uniquement de lettres, de chiffres, de traits d'union et de traits de soulignement.", + "Username must consist of letters, numbers, hyphens, dots and underscores only.": "Le nom d'utilisateur doit être composé uniquement de lettres, de chiffres, de traits d'union, de points et de traits de soulignement.", "Username must be at least 3 characters long.": "Le nom d'utilisateur doit comporter au moins 3 caractères.", "Username is already taken.": "Le nom d'utilisateur est déjà pris.", "Password is required.": "Le mot de passe est requis.", @@ -83,6 +83,7 @@ OC.L10N.register( "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.", "An error occurred while creating your account!": "Une erreur s'est produite lors de la création de votre compte!", - "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Si vous voyez un message disant \"Google hasn't verified this app\" vous pouvez le contourner en cliquant sur \"Advanced\". Nous travaillons actuellement sur l'obtention de la certification exigée par Google pour se débarrasser de ce message." + "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Si vous voyez un message disant \"Google hasn't verified this app\" vous pouvez le contourner en cliquant sur \"Advanced\". Nous travaillons actuellement sur l'obtention de la certification exigée par Google pour se débarrasser de ce message.", + "Username is too large.": "Le nom d'utilisateur est trop grand." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/fr.json b/l10n/fr.json index 4e9a17d4..1a9996fa 100644 --- a/l10n/fr.json +++ b/l10n/fr.json @@ -59,7 +59,7 @@ "Recovery Email": "Récupération de l'email", "Display name is required.": "Le nom d'affichage est obligatoire.", "Username is required.": "Le nom d'utilisateur est requis.", - "Username must consist of letters, numbers, hyphens, and underscores only.": "Le nom d'utilisateur doit être composé uniquement de lettres, de chiffres, de traits d'union et de traits de soulignement.", + "Username must consist of letters, numbers, hyphens, dots and underscores only.": "Le nom d'utilisateur doit être composé uniquement de lettres, de chiffres, de traits d'union, de points et de traits de soulignement.", "Username must be at least 3 characters long.": "Le nom d'utilisateur doit comporter au moins 3 caractères.", "Username is already taken.": "Le nom d'utilisateur est déjà pris.", "Password is required.": "Le mot de passe est requis.", @@ -82,7 +82,8 @@ "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.", "An error occurred while creating your account!": "Une erreur s'est produite lors de la création de votre compte!", - "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Si vous voyez un message disant \"Google hasn't verified this app\" vous pouvez le contourner en cliquant sur \"Advanced\". Nous travaillons actuellement sur l'obtention de la certification exigée par Google pour se débarrasser de ce message." + "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Si vous voyez un message disant \"Google hasn't verified this app\" vous pouvez le contourner en cliquant sur \"Advanced\". Nous travaillons actuellement sur l'obtention de la certification exigée par Google pour se débarrasser de ce message.", + "Username is too large.": "Le nom d'utilisateur est trop grand." }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/it.js b/l10n/it.js index e9f75b05..004a6a81 100644 --- a/l10n/it.js +++ b/l10n/it.js @@ -60,7 +60,7 @@ OC.L10N.register( "Recovery Email": "Recupero e-mail", "Display name is required.": "Il nome visualizzato è obbligatorio.", "Username is required.": "Il nome utente è necessario.", - "Username must consist of letters, numbers, hyphens, and underscores only.": "Il nome utente deve essere composto esclusivamente da lettere, numeri, trattini e trattini bassi.", + "Username must consist of letters, numbers, hyphens, dots and underscores only.": "Il nome utente deve essere composto esclusivamente da lettere, numeri, trattini, punti e trattini bassi.", "Username must be at least 3 characters long.": "Il nome utente deve essere lungo almeno 3 caratteri.", "Username is already taken.": "Il nome utente è già stato preso.", "Password is required.": "La password è necessaria.", @@ -83,6 +83,7 @@ OC.L10N.register( "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.", "An error occurred while creating your account!": "Si è verificato un errore nella creazione dell'account!", - "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Se vedi un messaggio che dice \"Google hasn't verified this app\", puoi ignorarlo facendo clic su \"Advanced\". Attualmente stiamo lavorando per ottenere la certificazione richiesta da Google per eliminare questo messaggio." + "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Se vedi un messaggio che dice \"Google hasn't verified this app\", puoi ignorarlo facendo clic su \"Advanced\". Attualmente stiamo lavorando per ottenere la certificazione richiesta da Google per eliminare questo messaggio.", + "Username is too large.": "Il nome utente è troppo grande." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/it.json b/l10n/it.json index 9e9d9d1a..322cbd51 100644 --- a/l10n/it.json +++ b/l10n/it.json @@ -59,7 +59,7 @@ "Recovery Email": "Recupero e-mail", "Display name is required.": "Il nome visualizzato è obbligatorio.", "Username is required.": "Il nome utente è necessario.", - "Username must consist of letters, numbers, hyphens, and underscores only.": "Il nome utente deve essere composto esclusivamente da lettere, numeri, trattini e trattini bassi.", + "Username must consist of letters, numbers, hyphens, dots and underscores only.": "Il nome utente deve essere composto esclusivamente da lettere, numeri, trattini, punti e trattini bassi.", "Username must be at least 3 characters long.": "Il nome utente deve essere lungo almeno 3 caratteri.", "Username is already taken.": "Il nome utente è già stato preso.", "Password is required.": "La password è necessaria.", @@ -78,7 +78,8 @@ "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.", "An error occurred while creating your account!": "Si è verificato un errore nella creazione dell'account!", - "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Se vedi un messaggio che dice \"Google hasn't verified this app\", puoi ignorarlo cliccando su \"Advanced\". Attualmente stiamo lavorando per ottenere la certificazione richiesta da Google per eliminare questo messaggio." + "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Se vedi un messaggio che dice \"Google hasn't verified this app\", puoi ignorarlo cliccando su \"Advanced\". Attualmente stiamo lavorando per ottenere la certificazione richiesta da Google per eliminare questo messaggio.", + "Username is too large.": "Il nome utente è troppo grande." }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/src/signup/RegistrationForm.vue b/src/signup/RegistrationForm.vue index f97b8cb2..0fb7a76a 100644 --- a/src/signup/RegistrationForm.vue +++ b/src/signup/RegistrationForm.vue @@ -265,7 +265,7 @@ export default { const isEnoughCharacters = this.formData.username.length >= minCharacterCount if (!isValidUsername) { - this.usernameValidationMessage = t(this.appName, 'Username must consist of letters, numbers, hyphens, and underscores only.') + this.usernameValidationMessage = t(this.appName, 'Username must consist of letters, numbers, hyphens, dots and underscores only.') this.validation.isUsernameNotValid = true } else if (!isEnoughCharacters) { this.usernameValidationMessage = t(this.appName, 'Username must be at least 3 characters long.') -- GitLab From 82948a50823d0b15465e5ae7e0979ce5e9e303db Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Mon, 9 Sep 2024 20:15:09 +0530 Subject: [PATCH 09/21] translations added --- l10n/de.js | 3 ++- l10n/de.json | 3 ++- l10n/de_DE.js | 3 ++- l10n/de_DE.json | 3 ++- l10n/en.js | 3 ++- l10n/en.json | 3 ++- l10n/es.js | 3 ++- l10n/es.json | 3 ++- l10n/fr.js | 3 ++- l10n/fr.json | 3 ++- l10n/it.js | 3 ++- l10n/it.json | 3 ++- src/signup/RegistrationForm.vue | 15 +++++++++++++++ 13 files changed, 39 insertions(+), 12 deletions(-) diff --git a/l10n/de.js b/l10n/de.js index 0dcdc43b..14a5579d 100644 --- a/l10n/de.js +++ b/l10n/de.js @@ -83,6 +83,7 @@ OC.L10N.register( "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!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Wenn Sie eine Nachricht sehen, die besagt \"Google hasn't verified this app\", können Sie diese ignorieren, indem Sie auf \"Advanced\" klicken. Wir arbeiten derzeit daran, die erforderliche Zertifizierung von Google zu erhalten, um diese Nachricht zu entfernen.", - "Username is too large.": "Der Benutzername ist zu groß." + "Username is too large.": "Der Benutzername ist zu groß.", + "Display name is too large.": "Der Anzeigename ist zu groß." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/de.json b/l10n/de.json index 2e4b14a8..c3dd2ba5 100644 --- a/l10n/de.json +++ b/l10n/de.json @@ -81,7 +81,8 @@ "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!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Wenn Sie eine Nachricht sehen, die besagt \"Google hasn't verified this app\", können Sie diese ignorieren, indem Sie auf \"Advanced\" tippen. Wir arbeiten derzeit daran, die erforderliche Zertifizierung von Google zu erhalten, um diese Fehlermeldung zu beseitigen.", - "Username is too large.": "Der Benutzername ist zu groß." + "Username is too large.": "Der Benutzername ist zu groß.", + "Display name is too large.": "Der Anzeigename ist zu groß." }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/de_DE.js b/l10n/de_DE.js index b8a8836e..4754fe0e 100644 --- a/l10n/de_DE.js +++ b/l10n/de_DE.js @@ -83,6 +83,7 @@ OC.L10N.register( "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!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Wenn du eine Nachricht siehst, die besagt \"Google hasn't verified this app\", kannst du sie ignorieren, indem du auf \"Advanced\" klickst. Wir arbeiten derzeit daran, die erforderliche Zertifizierung von Google zu erhalten, um diese Nachricht zu entfernen.", - "Username is too large.": "Der Benutzername ist zu groß." + "Username is too large.": "Der Benutzername ist zu groß.", + "Display name is too large.": "Der Anzeigename ist zu groß." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/de_DE.json b/l10n/de_DE.json index 3071e5ed..2f526340 100644 --- a/l10n/de_DE.json +++ b/l10n/de_DE.json @@ -81,7 +81,8 @@ "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!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Wenn du eine Nachricht siehst, die besagt \"Google hasn't verified this app\", kannst du sie ignorieren, indem du auf \"Advanced\" tippst. Wir arbeiten derzeit daran, die erforderliche Zertifizierung von Google zu erhalten, um diese Fehlermeldung zu beseitigen.", - "Username is too large.": "Der Benutzername ist zu groß." + "Username is too large.": "Der Benutzername ist zu groß.", + "Display name is too large.": "Der Anzeigename ist zu groß." }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/en.js b/l10n/en.js index 77dc15ce..d7c570df 100644 --- a/l10n/en.js +++ b/l10n/en.js @@ -86,6 +86,7 @@ OC.L10N.register( "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!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.", - "Username is too large.": "Username is too large." + "Username is too large.": "Username is too large.", + "Display name is too large.": "Display name is too large." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/en.json b/l10n/en.json index 14051ad5..7568e3f8 100644 --- a/l10n/en.json +++ b/l10n/en.json @@ -83,7 +83,8 @@ "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!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.", - "Username is too large.": "Username is too large." + "Username is too large.": "Username is too large.", + "Display name is too large.": "Display name is too large." }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/es.js b/l10n/es.js index eaa93f9a..c97769b9 100644 --- a/l10n/es.js +++ b/l10n/es.js @@ -85,6 +85,7 @@ OC.L10N.register( "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!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Si ves un mensaje que dice \"Google hasn't verified this app\", puedes omitirlo haciendo clic en \"Advanced\". Actualmente estamos trabajando para obtener la certificación que Google exige para eliminar este mensaje.", - "Username is too large.": "El nombre de usuario es demasiado grande." + "Username is too large.": "El nombre de usuario es demasiado grande.", + "Display name is too large.": "El nombre para mostrar es demasiado grande." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/es.json b/l10n/es.json index 7fa1cb29..fd22c863 100644 --- a/l10n/es.json +++ b/l10n/es.json @@ -84,7 +84,8 @@ "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!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Si ves un mensaje que dice \"Google hasn't verified this app\", puedes omitirlo haciendo clic en \"Advanced\". Actualmente estamos trabajando para obtener la certificación que Google exige para eliminar este mensaje.", - "Username is too large.": "El nombre de usuario es demasiado grande." + "Username is too large.": "El nombre de usuario es demasiado grande.", + "Display name is too large.": "El nombre para mostrar es demasiado grande." }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/fr.js b/l10n/fr.js index 83b45555..5a84aea7 100644 --- a/l10n/fr.js +++ b/l10n/fr.js @@ -84,6 +84,7 @@ OC.L10N.register( "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!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Si vous voyez un message disant \"Google hasn't verified this app\" vous pouvez le contourner en cliquant sur \"Advanced\". Nous travaillons actuellement sur l'obtention de la certification exigée par Google pour se débarrasser de ce message.", - "Username is too large.": "Le nom d'utilisateur est trop grand." + "Username is too large.": "Le nom d'utilisateur est trop grand.", + "Display name is too large.": "Le nom affiché est trop grand." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/fr.json b/l10n/fr.json index 1a9996fa..2b733b05 100644 --- a/l10n/fr.json +++ b/l10n/fr.json @@ -83,7 +83,8 @@ "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!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Si vous voyez un message disant \"Google hasn't verified this app\" vous pouvez le contourner en cliquant sur \"Advanced\". Nous travaillons actuellement sur l'obtention de la certification exigée par Google pour se débarrasser de ce message.", - "Username is too large.": "Le nom d'utilisateur est trop grand." + "Username is too large.": "Le nom d'utilisateur est trop grand.", + "Display name is too large.": "Le nom affiché est trop grand." }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/it.js b/l10n/it.js index 004a6a81..cbf1181e 100644 --- a/l10n/it.js +++ b/l10n/it.js @@ -84,6 +84,7 @@ OC.L10N.register( "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!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Se vedi un messaggio che dice \"Google hasn't verified this app\", puoi ignorarlo facendo clic su \"Advanced\". Attualmente stiamo lavorando per ottenere la certificazione richiesta da Google per eliminare questo messaggio.", - "Username is too large.": "Il nome utente è troppo grande." + "Username is too large.": "Il nome utente è troppo grande.", + "Display name is too large.": "Il nome del display è troppo grande." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/it.json b/l10n/it.json index 322cbd51..18307c2b 100644 --- a/l10n/it.json +++ b/l10n/it.json @@ -79,7 +79,8 @@ "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!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Se vedi un messaggio che dice \"Google hasn't verified this app\", puoi ignorarlo cliccando su \"Advanced\". Attualmente stiamo lavorando per ottenere la certificazione richiesta da Google per eliminare questo messaggio.", - "Username is too large.": "Il nome utente è troppo grande." + "Username is too large.": "Il nome utente è troppo grande.", + "Display name is too large.": "Il nome del display è troppo grande." }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/src/signup/RegistrationForm.vue b/src/signup/RegistrationForm.vue index 0fb7a76a..5c54f4bf 100644 --- a/src/signup/RegistrationForm.vue +++ b/src/signup/RegistrationForm.vue @@ -27,6 +27,9 @@

{{ t(appName,'Display name is required.') }}

+

+ {{ t(appName, 'Display name is too large.') }} +

@@ -56,6 +59,9 @@

{{ t(appName,'Available!') }}

+

+ {{ t(appName, 'Username is too large.') }} +

@@ -192,6 +198,8 @@ export default { isRepasswordEmpty: false, isRePasswordMatched: false, isAccepttnsEmpty: false, + isUsernameTooLong: false, + isDisplaynameTooLong: false, }, languages: [ { code: 'en', name: 'English' }, @@ -225,6 +233,13 @@ export default { validateForm(fieldsToValidate) { fieldsToValidate.forEach(field => { this.validation[`is${field.charAt(0).toUpperCase() + field.slice(1)}Empty`] = this.formData[field] === '' + if (field === 'username') { + this.validation.isUsernameTooLong = this.formData.username.length > 30 + } + + if (field === 'displayname') { + this.validation.isDisplaynameTooLong = this.formData.displayname.length > 30 + } }) if (fieldsToValidate.includes('password')) { this.passwordValidation() -- GitLab From a82838ca3073625c1b43f627e02f11fcba149d0f Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Mon, 9 Sep 2024 20:19:07 +0530 Subject: [PATCH 10/21] translations added --- src/signup/RegistrationForm.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/signup/RegistrationForm.vue b/src/signup/RegistrationForm.vue index 5c54f4bf..0718a1bd 100644 --- a/src/signup/RegistrationForm.vue +++ b/src/signup/RegistrationForm.vue @@ -298,8 +298,6 @@ export default { await Axios.post(url, data) this.isUsernameAvailable = true } catch (error) { - console.error(error.response) - console.error(error.response.status) this.validation.isUsernameNotValid = true if (error.response && error.response.status === 403) { this.usernameValidationMessage = t(this.appName, error.response.data.message) -- GitLab From 408eeabf0b293a0c9fd47267da59e14eca946089 Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Tue, 10 Sep 2024 15:08:40 +0530 Subject: [PATCH 11/21] Change made for common error --- lib/Controller/AccountController.php | 4 +++- src/signup/RegistrationForm.vue | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Controller/AccountController.php b/lib/Controller/AccountController.php index f9060343..a6fab362 100644 --- a/lib/Controller/AccountController.php +++ b/lib/Controller/AccountController.php @@ -253,13 +253,13 @@ class AccountController extends Controller { $response->setStatus(400); if (empty($username)) { + $response->setData(['message' => 'Username is required.', 'success' => false]); return $response; } $validationError = $this->validateInput('username', $username, 30); if ($validationError !== null) { $response->setData(['message' => $validationError, 'success' => false]); - $response->setStatus(403); return $response; } @@ -268,6 +268,8 @@ class AccountController extends Controller { if (!$this->userService->userExists($username) && !$this->userService->isUsernameTaken($username)) { $response->setStatus(200); $this->session->set(self::SESSION_USERNAME_CHECK, true); + } else { + $response->setData(['message' => 'Username is already taken.', 'success' => false]); } } catch (Exception $e) { $this->logger->logException($e, ['app' => Application::APP_ID ]); diff --git a/src/signup/RegistrationForm.vue b/src/signup/RegistrationForm.vue index 0718a1bd..b429fc22 100644 --- a/src/signup/RegistrationForm.vue +++ b/src/signup/RegistrationForm.vue @@ -299,10 +299,8 @@ export default { this.isUsernameAvailable = true } catch (error) { this.validation.isUsernameNotValid = true - if (error.response && error.response.status === 403) { + if (error.response && error.response.status === 400) { this.usernameValidationMessage = t(this.appName, error.response.data.message) - } else if (error.response && error.response.status === 400) { - this.usernameValidationMessage = t(this.appName, 'Username is already taken.') } else { this.usernameValidationMessage = t(this.appName, 'Something went wrong.') } -- GitLab From ce1e5d988339a0d5df189a41602ae44864e0e431 Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Tue, 10 Sep 2024 15:20:33 +0530 Subject: [PATCH 12/21] display name added --- appinfo/routes.php | 2 +- lib/Controller/AccountController.php | 15 +++++++++++++-- src/signup/RegistrationForm.vue | 9 +++++---- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/appinfo/routes.php b/appinfo/routes.php index eeeec68a..90b0f6f7 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -30,6 +30,6 @@ return ['routes' => [ ['name' => 'account#create', 'url' => '/accounts/create', 'verb' => 'POST'], ['name' => 'account#captcha', 'url' => '/accounts/captcha', 'verb' => 'GET'], ['name' => 'account#verify_captcha', 'url' => '/accounts/verify_captcha', 'verb' => 'POST'], - ['name' => 'account#check_username_available', 'url' => '/accounts/check_username_available', 'verb' => 'POST'], + ['name' => 'account#validate_fields', 'url' => '/accounts/validate_fields', 'verb' => 'POST'], ]]; diff --git a/lib/Controller/AccountController.php b/lib/Controller/AccountController.php index a6fab362..d7d0e074 100644 --- a/lib/Controller/AccountController.php +++ b/lib/Controller/AccountController.php @@ -237,17 +237,18 @@ class AccountController extends Controller { return null; // Validation passed } /** - * Check if a username is available. + * Check if a username and displayname is valid or not. * * @NoAdminRequired * @PublicPage * @NoCSRFRequired * * @param string $username The username to check. + * @param string $displayname The displayname to check. * * @return \OCP\AppFramework\Http\DataResponse */ - public function checkUsernameAvailable(string $username) : DataResponse { + public function validateFields(string $username, string $displayname) : DataResponse { $this->session->remove(self::SESSION_USERNAME_CHECK); $response = new DataResponse(); $response->setStatus(400); @@ -256,7 +257,17 @@ class AccountController extends Controller { $response->setData(['message' => 'Username is required.', 'success' => false]); return $response; } + if (empty($displayname)) { + $response->setData(['message' => 'Display name is required.', 'success' => false]); + return $response; + } + $validationError = $this->validateInput('displayname', $displayname, 30); + if ($validationError !== null) { + $response->setData(['message' => $validationError, 'success' => false]); + return $response; + } + $validationError = $this->validateInput('username', $username, 30); if ($validationError !== null) { $response->setData(['message' => $validationError, 'success' => false]); diff --git a/src/signup/RegistrationForm.vue b/src/signup/RegistrationForm.vue index b429fc22..c5cff737 100644 --- a/src/signup/RegistrationForm.vue +++ b/src/signup/RegistrationForm.vue @@ -288,18 +288,19 @@ export default { } }, - async checkUsername() { + async validateFields() { const data = { username: this.formData.username, + displayname: this.formData.displayname, } - const url = generateUrl(`/apps/${this.appName}/accounts/check_username_available`) + const url = generateUrl(`/apps/${this.appName}/accounts/validate_fields`) try { await Axios.post(url, data) this.isUsernameAvailable = true } catch (error) { this.validation.isUsernameNotValid = true - if (error.response && error.response.status === 400) { + if (error.response && error.response.status === 400) { this.usernameValidationMessage = t(this.appName, error.response.data.message) } else { this.usernameValidationMessage = t(this.appName, 'Something went wrong.') @@ -309,7 +310,7 @@ export default { async submitRegistrationForm() { this.processing = true this.validateForm(['displayname', 'username', 'password', 'repassword', 'termsandservices']) - await this.checkUsername() + await this.validateFields() const isFormValid = Object.values(this.validation).every(value => !value) if (isFormValid) { -- GitLab From 0fdbbbfbba08be30c86e0fcc7ff94d419937d67c Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Tue, 10 Sep 2024 15:22:22 +0530 Subject: [PATCH 13/21] display name added --- lib/Controller/AccountController.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/Controller/AccountController.php b/lib/Controller/AccountController.php index d7d0e074..5ba6c16d 100644 --- a/lib/Controller/AccountController.php +++ b/lib/Controller/AccountController.php @@ -262,16 +262,18 @@ class AccountController extends Controller { return $response; } - $validationError = $this->validateInput('displayname', $displayname, 30); - if ($validationError !== null) { - $response->setData(['message' => $validationError, 'success' => false]); - return $response; - } + $inputData = [ + 'username' => ['value' => $username, 'maxLength' => 30], + 'displayname' => ['value' => $displayname, 'maxLength' => 30] + ]; - $validationError = $this->validateInput('username', $username, 30); - if ($validationError !== null) { - $response->setData(['message' => $validationError, 'success' => false]); - return $response; + foreach ($inputData as $inputName => $inputInfo) { + $validationError = $this->validateInput($inputName, $inputInfo['value'], $inputInfo['maxLength']); + if ($validationError !== null) { + $response->setData(['message' => $validationError, 'success' => false]); + $response->setStatus(400); + return $response; + } } try { -- GitLab From 12fef4c427c3c4d1ac2c2dc71205a66dfec464aa Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Tue, 10 Sep 2024 15:23:49 +0530 Subject: [PATCH 14/21] lint --- src/signup/RegistrationForm.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/signup/RegistrationForm.vue b/src/signup/RegistrationForm.vue index c5cff737..64f42d79 100644 --- a/src/signup/RegistrationForm.vue +++ b/src/signup/RegistrationForm.vue @@ -300,7 +300,7 @@ export default { this.isUsernameAvailable = true } catch (error) { this.validation.isUsernameNotValid = true - if (error.response && error.response.status === 400) { + if (error.response && error.response.status === 400) { this.usernameValidationMessage = t(this.appName, error.response.data.message) } else { this.usernameValidationMessage = t(this.appName, 'Something went wrong.') -- GitLab From 02a081b6d3ceffed2ceca6a6da7c6930ec38a851 Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Tue, 10 Sep 2024 15:40:13 +0530 Subject: [PATCH 15/21] client side removed --- lib/Controller/AccountController.php | 8 ++++---- src/signup/RegistrationForm.vue | 26 +++++++++++--------------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/lib/Controller/AccountController.php b/lib/Controller/AccountController.php index 5ba6c16d..e4a0d42b 100644 --- a/lib/Controller/AccountController.php +++ b/lib/Controller/AccountController.php @@ -254,11 +254,11 @@ class AccountController extends Controller { $response->setStatus(400); if (empty($username)) { - $response->setData(['message' => 'Username is required.', 'success' => false]); + $response->setData(['message' => 'Username is required.', 'field' => 'username', 'success' => false]); return $response; } if (empty($displayname)) { - $response->setData(['message' => 'Display name is required.', 'success' => false]); + $response->setData(['message' => 'Display name is required.', 'field' => 'displayname', 'success' => false]); return $response; } @@ -270,7 +270,7 @@ class AccountController extends Controller { foreach ($inputData as $inputName => $inputInfo) { $validationError = $this->validateInput($inputName, $inputInfo['value'], $inputInfo['maxLength']); if ($validationError !== null) { - $response->setData(['message' => $validationError, 'success' => false]); + $response->setData(['message' => $validationError, 'field' => $inputName, 'success' => false]); $response->setStatus(400); return $response; } @@ -282,7 +282,7 @@ class AccountController extends Controller { $response->setStatus(200); $this->session->set(self::SESSION_USERNAME_CHECK, true); } else { - $response->setData(['message' => 'Username is already taken.', 'success' => false]); + $response->setData(['message' => 'Username is already taken.', 'field' => 'username', 'success' => false]); } } catch (Exception $e) { $this->logger->logException($e, ['app' => Application::APP_ID ]); diff --git a/src/signup/RegistrationForm.vue b/src/signup/RegistrationForm.vue index 64f42d79..90f1b92a 100644 --- a/src/signup/RegistrationForm.vue +++ b/src/signup/RegistrationForm.vue @@ -27,8 +27,8 @@

{{ t(appName,'Display name is required.') }}

-

- {{ t(appName, 'Display name is too large.') }} +

+ {{ t(appName, displaynameValidationMessage) }}

@@ -59,9 +59,6 @@

{{ t(appName,'Available!') }}

-

- {{ t(appName, 'Username is too large.') }} -

@@ -188,6 +185,7 @@ export default { return { appName: APPLICATION_NAME, usernameValidationMessage: '', + displaynameValidationMessage: '', domain: window.location.host, validation: { isDisplaynameEmpty: false, @@ -198,8 +196,7 @@ export default { isRepasswordEmpty: false, isRePasswordMatched: false, isAccepttnsEmpty: false, - isUsernameTooLong: false, - isDisplaynameTooLong: false, + isDisplaynameNotValid: false, }, languages: [ { code: 'en', name: 'English' }, @@ -233,13 +230,6 @@ export default { validateForm(fieldsToValidate) { fieldsToValidate.forEach(field => { this.validation[`is${field.charAt(0).toUpperCase() + field.slice(1)}Empty`] = this.formData[field] === '' - if (field === 'username') { - this.validation.isUsernameTooLong = this.formData.username.length > 30 - } - - if (field === 'displayname') { - this.validation.isDisplaynameTooLong = this.formData.displayname.length > 30 - } }) if (fieldsToValidate.includes('password')) { this.passwordValidation() @@ -301,7 +291,13 @@ export default { } catch (error) { this.validation.isUsernameNotValid = true if (error.response && error.response.status === 400) { - this.usernameValidationMessage = t(this.appName, error.response.data.message) + if (error.response.data.field === 'username') { + this.usernameValidationMessage = t(this.appName, error.response.data.message) + } + if (error.response.data.field === 'displayname') { + this.validation.isDisplaynameNotValid = true + this.displaynameValidationMessage = t(this.appName, error.response.data.message) + } } else { this.usernameValidationMessage = t(this.appName, 'Something went wrong.') } -- GitLab From 99f9e3c7debe472a33eb56e8f50ba7028bc6e422 Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Tue, 10 Sep 2024 15:41:35 +0530 Subject: [PATCH 16/21] client side removed --- src/signup/RegistrationForm.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/signup/RegistrationForm.vue b/src/signup/RegistrationForm.vue index 90f1b92a..76f06f78 100644 --- a/src/signup/RegistrationForm.vue +++ b/src/signup/RegistrationForm.vue @@ -289,9 +289,9 @@ export default { await Axios.post(url, data) this.isUsernameAvailable = true } catch (error) { - this.validation.isUsernameNotValid = true if (error.response && error.response.status === 400) { if (error.response.data.field === 'username') { + this.validation.isUsernameNotValid = true this.usernameValidationMessage = t(this.appName, error.response.data.message) } if (error.response.data.field === 'displayname') { @@ -299,6 +299,7 @@ export default { this.displaynameValidationMessage = t(this.appName, error.response.data.message) } } else { + this.validation.isUsernameNotValid = true this.usernameValidationMessage = t(this.appName, 'Something went wrong.') } } -- GitLab From d0ca8a5ddd69e4952db9bb43a689d741228e5ee2 Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Tue, 10 Sep 2024 15:48:03 +0530 Subject: [PATCH 17/21] client side removed --- l10n/de.js | 2 +- l10n/de.json | 2 +- l10n/de_DE.js | 2 +- l10n/de_DE.json | 2 +- l10n/en.js | 2 +- l10n/en.json | 2 +- l10n/es.js | 2 +- l10n/es.json | 2 +- l10n/fr.js | 2 +- l10n/fr.json | 2 +- l10n/it.js | 2 +- l10n/it.json | 2 +- lib/Controller/AccountController.php | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/l10n/de.js b/l10n/de.js index 14a5579d..60072052 100644 --- a/l10n/de.js +++ b/l10n/de.js @@ -84,6 +84,6 @@ OC.L10N.register( "An error occurred while creating your account!": "Beim Anlegen Ihres Kontos ist ein Fehler aufgetreten!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Wenn Sie eine Nachricht sehen, die besagt \"Google hasn't verified this app\", können Sie diese ignorieren, indem Sie auf \"Advanced\" klicken. Wir arbeiten derzeit daran, die erforderliche Zertifizierung von Google zu erhalten, um diese Nachricht zu entfernen.", "Username is too large.": "Der Benutzername ist zu groß.", - "Display name is too large.": "Der Anzeigename ist zu groß." + "Displayname is too large.": "Der Anzeigename ist zu groß." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/de.json b/l10n/de.json index c3dd2ba5..64839dbc 100644 --- a/l10n/de.json +++ b/l10n/de.json @@ -82,7 +82,7 @@ "An error occurred while creating your account!": "Beim Anlegen Ihres Kontos ist ein Fehler aufgetreten!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Wenn Sie eine Nachricht sehen, die besagt \"Google hasn't verified this app\", können Sie diese ignorieren, indem Sie auf \"Advanced\" tippen. Wir arbeiten derzeit daran, die erforderliche Zertifizierung von Google zu erhalten, um diese Fehlermeldung zu beseitigen.", "Username is too large.": "Der Benutzername ist zu groß.", - "Display name is too large.": "Der Anzeigename ist zu groß." + "Displayname is too large.": "Der Anzeigename ist zu groß." }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/de_DE.js b/l10n/de_DE.js index 4754fe0e..87c226ae 100644 --- a/l10n/de_DE.js +++ b/l10n/de_DE.js @@ -84,6 +84,6 @@ OC.L10N.register( "An error occurred while creating your account!": "Beim Anlegen Ihres Kontos ist ein Fehler aufgetreten!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Wenn du eine Nachricht siehst, die besagt \"Google hasn't verified this app\", kannst du sie ignorieren, indem du auf \"Advanced\" klickst. Wir arbeiten derzeit daran, die erforderliche Zertifizierung von Google zu erhalten, um diese Nachricht zu entfernen.", "Username is too large.": "Der Benutzername ist zu groß.", - "Display name is too large.": "Der Anzeigename ist zu groß." + "Displayname is too large.": "Der Anzeigename ist zu groß." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/de_DE.json b/l10n/de_DE.json index 2f526340..b8a8d0b9 100644 --- a/l10n/de_DE.json +++ b/l10n/de_DE.json @@ -82,7 +82,7 @@ "An error occurred while creating your account!": "Beim Anlegen Ihres Kontos ist ein Fehler aufgetreten!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Wenn du eine Nachricht siehst, die besagt \"Google hasn't verified this app\", kannst du sie ignorieren, indem du auf \"Advanced\" tippst. Wir arbeiten derzeit daran, die erforderliche Zertifizierung von Google zu erhalten, um diese Fehlermeldung zu beseitigen.", "Username is too large.": "Der Benutzername ist zu groß.", - "Display name is too large.": "Der Anzeigename ist zu groß." + "Displayname is too large.": "Der Anzeigename ist zu groß." }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/en.js b/l10n/en.js index d7c570df..182353a7 100644 --- a/l10n/en.js +++ b/l10n/en.js @@ -87,6 +87,6 @@ OC.L10N.register( "An error occurred while creating your account!": "An error occurred while creating your account!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.", "Username is too large.": "Username is too large.", - "Display name is too large.": "Display name is too large." + "Displayname is too large.": "Displayname is too large." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/en.json b/l10n/en.json index 7568e3f8..d3e031bc 100644 --- a/l10n/en.json +++ b/l10n/en.json @@ -84,7 +84,7 @@ "An error occurred while creating your account!": "An error occurred while creating your account!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.", "Username is too large.": "Username is too large.", - "Display name is too large.": "Display name is too large." + "Displayname is too large.": "Displayname is too large." }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/es.js b/l10n/es.js index c97769b9..ee08fa2f 100644 --- a/l10n/es.js +++ b/l10n/es.js @@ -86,6 +86,6 @@ OC.L10N.register( "An error occurred while creating your account!": "¡Hubo un error creando tu cuenta!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Si ves un mensaje que dice \"Google hasn't verified this app\", puedes omitirlo haciendo clic en \"Advanced\". Actualmente estamos trabajando para obtener la certificación que Google exige para eliminar este mensaje.", "Username is too large.": "El nombre de usuario es demasiado grande.", - "Display name is too large.": "El nombre para mostrar es demasiado grande." + "Displayname is too large.": "El nombre para mostrar es demasiado grande." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/es.json b/l10n/es.json index fd22c863..e63fdd62 100644 --- a/l10n/es.json +++ b/l10n/es.json @@ -85,7 +85,7 @@ "An error occurred while creating your account!": "¡Hubo un error creando tu cuenta!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Si ves un mensaje que dice \"Google hasn't verified this app\", puedes omitirlo haciendo clic en \"Advanced\". Actualmente estamos trabajando para obtener la certificación que Google exige para eliminar este mensaje.", "Username is too large.": "El nombre de usuario es demasiado grande.", - "Display name is too large.": "El nombre para mostrar es demasiado grande." + "Displayname is too large.": "El nombre para mostrar es demasiado grande." }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/fr.js b/l10n/fr.js index 5a84aea7..55d4cd46 100644 --- a/l10n/fr.js +++ b/l10n/fr.js @@ -85,6 +85,6 @@ OC.L10N.register( "An error occurred while creating your account!": "Une erreur s'est produite lors de la création de votre compte!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Si vous voyez un message disant \"Google hasn't verified this app\" vous pouvez le contourner en cliquant sur \"Advanced\". Nous travaillons actuellement sur l'obtention de la certification exigée par Google pour se débarrasser de ce message.", "Username is too large.": "Le nom d'utilisateur est trop grand.", - "Display name is too large.": "Le nom affiché est trop grand." + "Displayname is too large.": "Le nom affiché est trop grand." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/fr.json b/l10n/fr.json index 2b733b05..539e1ea8 100644 --- a/l10n/fr.json +++ b/l10n/fr.json @@ -84,7 +84,7 @@ "An error occurred while creating your account!": "Une erreur s'est produite lors de la création de votre compte!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Si vous voyez un message disant \"Google hasn't verified this app\" vous pouvez le contourner en cliquant sur \"Advanced\". Nous travaillons actuellement sur l'obtention de la certification exigée par Google pour se débarrasser de ce message.", "Username is too large.": "Le nom d'utilisateur est trop grand.", - "Display name is too large.": "Le nom affiché est trop grand." + "Displayname is too large.": "Le nom affiché est trop grand." }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/it.js b/l10n/it.js index cbf1181e..6fb3826b 100644 --- a/l10n/it.js +++ b/l10n/it.js @@ -85,6 +85,6 @@ OC.L10N.register( "An error occurred while creating your account!": "Si è verificato un errore nella creazione dell'account!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Se vedi un messaggio che dice \"Google hasn't verified this app\", puoi ignorarlo facendo clic su \"Advanced\". Attualmente stiamo lavorando per ottenere la certificazione richiesta da Google per eliminare questo messaggio.", "Username is too large.": "Il nome utente è troppo grande.", - "Display name is too large.": "Il nome del display è troppo grande." + "Displayname is too large.": "Il nome del display è troppo grande." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/it.json b/l10n/it.json index 18307c2b..e33dd991 100644 --- a/l10n/it.json +++ b/l10n/it.json @@ -80,7 +80,7 @@ "An error occurred while creating your account!": "Si è verificato un errore nella creazione dell'account!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Se vedi un messaggio che dice \"Google hasn't verified this app\", puoi ignorarlo cliccando su \"Advanced\". Attualmente stiamo lavorando per ottenere la certificazione richiesta da Google per eliminare questo messaggio.", "Username is too large.": "Il nome utente è troppo grande.", - "Display name is too large.": "Il nome del display è troppo grande." + "Displayname is too large.": "Il nome del display è troppo grande." }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/lib/Controller/AccountController.php b/lib/Controller/AccountController.php index e4a0d42b..a9da9e0a 100644 --- a/lib/Controller/AccountController.php +++ b/lib/Controller/AccountController.php @@ -258,7 +258,7 @@ class AccountController extends Controller { return $response; } if (empty($displayname)) { - $response->setData(['message' => 'Display name is required.', 'field' => 'displayname', 'success' => false]); + $response->setData(['message' => 'Displayname is required.', 'field' => 'displayname', 'success' => false]); return $response; } -- GitLab From 82df91d38aac423b22acd7c4cd972488ef97d15c Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Tue, 10 Sep 2024 15:53:30 +0530 Subject: [PATCH 18/21] php fix --- l10n/de.js | 2 +- l10n/de.json | 2 +- l10n/de_DE.js | 2 +- l10n/de_DE.json | 2 +- l10n/en.js | 2 +- l10n/en.json | 2 +- l10n/es.js | 2 +- l10n/es.json | 2 +- l10n/fr.js | 2 +- l10n/fr.json | 2 +- l10n/it.js | 2 +- l10n/it.json | 2 +- lib/Controller/AccountController.php | 11 +++++------ 13 files changed, 17 insertions(+), 18 deletions(-) diff --git a/l10n/de.js b/l10n/de.js index 60072052..14a5579d 100644 --- a/l10n/de.js +++ b/l10n/de.js @@ -84,6 +84,6 @@ OC.L10N.register( "An error occurred while creating your account!": "Beim Anlegen Ihres Kontos ist ein Fehler aufgetreten!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Wenn Sie eine Nachricht sehen, die besagt \"Google hasn't verified this app\", können Sie diese ignorieren, indem Sie auf \"Advanced\" klicken. Wir arbeiten derzeit daran, die erforderliche Zertifizierung von Google zu erhalten, um diese Nachricht zu entfernen.", "Username is too large.": "Der Benutzername ist zu groß.", - "Displayname is too large.": "Der Anzeigename ist zu groß." + "Display name is too large.": "Der Anzeigename ist zu groß." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/de.json b/l10n/de.json index 64839dbc..c3dd2ba5 100644 --- a/l10n/de.json +++ b/l10n/de.json @@ -82,7 +82,7 @@ "An error occurred while creating your account!": "Beim Anlegen Ihres Kontos ist ein Fehler aufgetreten!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Wenn Sie eine Nachricht sehen, die besagt \"Google hasn't verified this app\", können Sie diese ignorieren, indem Sie auf \"Advanced\" tippen. Wir arbeiten derzeit daran, die erforderliche Zertifizierung von Google zu erhalten, um diese Fehlermeldung zu beseitigen.", "Username is too large.": "Der Benutzername ist zu groß.", - "Displayname is too large.": "Der Anzeigename ist zu groß." + "Display name is too large.": "Der Anzeigename ist zu groß." }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/de_DE.js b/l10n/de_DE.js index 87c226ae..4754fe0e 100644 --- a/l10n/de_DE.js +++ b/l10n/de_DE.js @@ -84,6 +84,6 @@ OC.L10N.register( "An error occurred while creating your account!": "Beim Anlegen Ihres Kontos ist ein Fehler aufgetreten!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Wenn du eine Nachricht siehst, die besagt \"Google hasn't verified this app\", kannst du sie ignorieren, indem du auf \"Advanced\" klickst. Wir arbeiten derzeit daran, die erforderliche Zertifizierung von Google zu erhalten, um diese Nachricht zu entfernen.", "Username is too large.": "Der Benutzername ist zu groß.", - "Displayname is too large.": "Der Anzeigename ist zu groß." + "Display name is too large.": "Der Anzeigename ist zu groß." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/de_DE.json b/l10n/de_DE.json index b8a8d0b9..2f526340 100644 --- a/l10n/de_DE.json +++ b/l10n/de_DE.json @@ -82,7 +82,7 @@ "An error occurred while creating your account!": "Beim Anlegen Ihres Kontos ist ein Fehler aufgetreten!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Wenn du eine Nachricht siehst, die besagt \"Google hasn't verified this app\", kannst du sie ignorieren, indem du auf \"Advanced\" tippst. Wir arbeiten derzeit daran, die erforderliche Zertifizierung von Google zu erhalten, um diese Fehlermeldung zu beseitigen.", "Username is too large.": "Der Benutzername ist zu groß.", - "Displayname is too large.": "Der Anzeigename ist zu groß." + "Display name is too large.": "Der Anzeigename ist zu groß." }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/en.js b/l10n/en.js index 182353a7..d7c570df 100644 --- a/l10n/en.js +++ b/l10n/en.js @@ -87,6 +87,6 @@ OC.L10N.register( "An error occurred while creating your account!": "An error occurred while creating your account!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.", "Username is too large.": "Username is too large.", - "Displayname is too large.": "Displayname is too large." + "Display name is too large.": "Display name is too large." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/en.json b/l10n/en.json index d3e031bc..7568e3f8 100644 --- a/l10n/en.json +++ b/l10n/en.json @@ -84,7 +84,7 @@ "An error occurred while creating your account!": "An error occurred while creating your account!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.", "Username is too large.": "Username is too large.", - "Displayname is too large.": "Displayname is too large." + "Display name is too large.": "Display name is too large." }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/es.js b/l10n/es.js index ee08fa2f..c97769b9 100644 --- a/l10n/es.js +++ b/l10n/es.js @@ -86,6 +86,6 @@ OC.L10N.register( "An error occurred while creating your account!": "¡Hubo un error creando tu cuenta!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Si ves un mensaje que dice \"Google hasn't verified this app\", puedes omitirlo haciendo clic en \"Advanced\". Actualmente estamos trabajando para obtener la certificación que Google exige para eliminar este mensaje.", "Username is too large.": "El nombre de usuario es demasiado grande.", - "Displayname is too large.": "El nombre para mostrar es demasiado grande." + "Display name is too large.": "El nombre para mostrar es demasiado grande." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/es.json b/l10n/es.json index e63fdd62..fd22c863 100644 --- a/l10n/es.json +++ b/l10n/es.json @@ -85,7 +85,7 @@ "An error occurred while creating your account!": "¡Hubo un error creando tu cuenta!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Si ves un mensaje que dice \"Google hasn't verified this app\", puedes omitirlo haciendo clic en \"Advanced\". Actualmente estamos trabajando para obtener la certificación que Google exige para eliminar este mensaje.", "Username is too large.": "El nombre de usuario es demasiado grande.", - "Displayname is too large.": "El nombre para mostrar es demasiado grande." + "Display name is too large.": "El nombre para mostrar es demasiado grande." }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/fr.js b/l10n/fr.js index 55d4cd46..5a84aea7 100644 --- a/l10n/fr.js +++ b/l10n/fr.js @@ -85,6 +85,6 @@ OC.L10N.register( "An error occurred while creating your account!": "Une erreur s'est produite lors de la création de votre compte!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Si vous voyez un message disant \"Google hasn't verified this app\" vous pouvez le contourner en cliquant sur \"Advanced\". Nous travaillons actuellement sur l'obtention de la certification exigée par Google pour se débarrasser de ce message.", "Username is too large.": "Le nom d'utilisateur est trop grand.", - "Displayname is too large.": "Le nom affiché est trop grand." + "Display name is too large.": "Le nom affiché est trop grand." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/fr.json b/l10n/fr.json index 539e1ea8..2b733b05 100644 --- a/l10n/fr.json +++ b/l10n/fr.json @@ -84,7 +84,7 @@ "An error occurred while creating your account!": "Une erreur s'est produite lors de la création de votre compte!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Si vous voyez un message disant \"Google hasn't verified this app\" vous pouvez le contourner en cliquant sur \"Advanced\". Nous travaillons actuellement sur l'obtention de la certification exigée par Google pour se débarrasser de ce message.", "Username is too large.": "Le nom d'utilisateur est trop grand.", - "Displayname is too large.": "Le nom affiché est trop grand." + "Display name is too large.": "Le nom affiché est trop grand." }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/it.js b/l10n/it.js index 6fb3826b..cbf1181e 100644 --- a/l10n/it.js +++ b/l10n/it.js @@ -85,6 +85,6 @@ OC.L10N.register( "An error occurred while creating your account!": "Si è verificato un errore nella creazione dell'account!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Se vedi un messaggio che dice \"Google hasn't verified this app\", puoi ignorarlo facendo clic su \"Advanced\". Attualmente stiamo lavorando per ottenere la certificazione richiesta da Google per eliminare questo messaggio.", "Username is too large.": "Il nome utente è troppo grande.", - "Displayname is too large.": "Il nome del display è troppo grande." + "Display name is too large.": "Il nome del display è troppo grande." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/it.json b/l10n/it.json index e33dd991..18307c2b 100644 --- a/l10n/it.json +++ b/l10n/it.json @@ -80,7 +80,7 @@ "An error occurred while creating your account!": "Si è verificato un errore nella creazione dell'account!", "If you see a \"Google hasn't verified this app\" message you can bypass it by clicking \"Advanced\". We're currently working on passing the certification Google demands to get rid of this message.":"Se vedi un messaggio che dice \"Google hasn't verified this app\", puoi ignorarlo cliccando su \"Advanced\". Attualmente stiamo lavorando per ottenere la certificazione richiesta da Google per eliminare questo messaggio.", "Username is too large.": "Il nome utente è troppo grande.", - "Displayname is too large.": "Il nome del display è troppo grande." + "Display name is too large.": "Il nome del display è troppo grande." }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/lib/Controller/AccountController.php b/lib/Controller/AccountController.php index a9da9e0a..682a5b03 100644 --- a/lib/Controller/AccountController.php +++ b/lib/Controller/AccountController.php @@ -156,7 +156,7 @@ class AccountController extends Controller { $inputData = [ 'username' => ['value' => $username, 'maxLength' => 30], - 'displayname' => ['value' => $displayname, 'maxLength' => 30], + 'display name' => ['value' => $displayname, 'maxLength' => 30], 'password' => ['value' => $password, 'maxLength' => 1024], ]; @@ -227,11 +227,10 @@ class AccountController extends Controller { */ private function validateInput(string $inputName, string $value, ?int $maxLength = null) : ?string { if ($value === '') { - return ucwords($inputName)." is required."; + return ucfirst(strtolower($inputName))." is required."; } - if ($maxLength !== null && strlen($value) > $maxLength) { - return ucwords($inputName)." is too large."; + return ucfirst(strtolower($inputName))." is too large."; } return null; // Validation passed @@ -258,13 +257,13 @@ class AccountController extends Controller { return $response; } if (empty($displayname)) { - $response->setData(['message' => 'Displayname is required.', 'field' => 'displayname', 'success' => false]); + $response->setData(['message' => 'Display name is required.', 'field' => 'displayname', 'success' => false]); return $response; } $inputData = [ 'username' => ['value' => $username, 'maxLength' => 30], - 'displayname' => ['value' => $displayname, 'maxLength' => 30] + 'display name' => ['value' => $displayname, 'maxLength' => 30] ]; foreach ($inputData as $inputName => $inputInfo) { -- GitLab From 62a7f3511fff1cd9b10aa8a0fbf6516c36bda357 Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Tue, 10 Sep 2024 16:01:55 +0530 Subject: [PATCH 19/21] lint fix --- lib/Controller/AccountController.php | 2 +- src/signup/RegistrationForm.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Controller/AccountController.php b/lib/Controller/AccountController.php index 682a5b03..9fc434ce 100644 --- a/lib/Controller/AccountController.php +++ b/lib/Controller/AccountController.php @@ -257,7 +257,7 @@ class AccountController extends Controller { return $response; } if (empty($displayname)) { - $response->setData(['message' => 'Display name is required.', 'field' => 'displayname', 'success' => false]); + $response->setData(['message' => 'Display name is required.', 'field' => 'display name', 'success' => false]); return $response; } diff --git a/src/signup/RegistrationForm.vue b/src/signup/RegistrationForm.vue index 76f06f78..7efb114c 100644 --- a/src/signup/RegistrationForm.vue +++ b/src/signup/RegistrationForm.vue @@ -294,7 +294,7 @@ export default { this.validation.isUsernameNotValid = true this.usernameValidationMessage = t(this.appName, error.response.data.message) } - if (error.response.data.field === 'displayname') { + if (error.response.data.field === 'display name') { this.validation.isDisplaynameNotValid = true this.displaynameValidationMessage = t(this.appName, error.response.data.message) } -- GitLab From 030f7a8b662e4e3fee75d5a2a891b3009c4f8458 Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Tue, 10 Sep 2024 16:10:06 +0530 Subject: [PATCH 20/21] adding default false --- src/signup/RegistrationForm.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/signup/RegistrationForm.vue b/src/signup/RegistrationForm.vue index 7efb114c..7ae385ab 100644 --- a/src/signup/RegistrationForm.vue +++ b/src/signup/RegistrationForm.vue @@ -279,6 +279,8 @@ export default { }, async validateFields() { + this.validation.isUsernameNotValid = false + this.validation.isDisplaynameNotValid = false const data = { username: this.formData.username, displayname: this.formData.displayname, -- GitLab From 72d0ab3fcef6c326d6adb9933bb26641401cf896 Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Tue, 10 Sep 2024 20:52:55 +0530 Subject: [PATCH 21/21] preg match at backend side --- lib/Controller/AccountController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Controller/AccountController.php b/lib/Controller/AccountController.php index 9fc434ce..550e1a7d 100644 --- a/lib/Controller/AccountController.php +++ b/lib/Controller/AccountController.php @@ -274,7 +274,11 @@ class AccountController extends Controller { return $response; } } - + if (!preg_match('/^[a-zA-Z0-9._-]+$/', $username)) { + $response->setData(['message' => 'Username must consist of letters, numbers, hyphens, dots and underscores only.', 'field' => 'username', 'success' => false]); + $response->setStatus(403); + return $response; + } try { $username = mb_strtolower($username, 'UTF-8'); if (!$this->userService->userExists($username) && !$this->userService->isUsernameTaken($username)) { -- GitLab