diff --git a/src/main/java/stirling/software/SPDF/config/security/UserService.java b/src/main/java/stirling/software/SPDF/config/security/UserService.java index 60b3ebef..666baa93 100644 --- a/src/main/java/stirling/software/SPDF/config/security/UserService.java +++ b/src/main/java/stirling/software/SPDF/config/security/UserService.java @@ -176,6 +176,10 @@ public class UserService implements UserServiceInterface { return userRepository.findByUsername(username); } + public Optional findByUsernameIgnoreCase(String username) { + return userRepository.findByUsernameIgnoreCase(username); + } + public void changeUsername(User user, String newUsername) { user.setUsername(newUsername); userRepository.save(user); @@ -194,4 +198,8 @@ public class UserService implements UserServiceInterface { public boolean isPasswordCorrect(User user, String currentPassword) { return passwordEncoder.matches(currentPassword, user.getPassword()); } + + public boolean isUsernameValid(String username) { + return username.matches("[a-zA-Z0-9]+"); + } } diff --git a/src/main/java/stirling/software/SPDF/controller/api/UserController.java b/src/main/java/stirling/software/SPDF/controller/api/UserController.java index 07c4b934..e5c0b114 100644 --- a/src/main/java/stirling/software/SPDF/controller/api/UserController.java +++ b/src/main/java/stirling/software/SPDF/controller/api/UserController.java @@ -61,11 +61,16 @@ public class UserController { HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) { + + if (!userService.isUsernameValid(newUsername)) { + return new RedirectView("/account?messageType=invalidUsername"); + } + if (principal == null) { return new RedirectView("/account?messageType=notAuthenticated"); } - Optional userOpt = userService.findByUsername(principal.getName()); + Optional userOpt = userService.findByUsernameIgnoreCase(principal.getName()); if (userOpt == null || userOpt.isEmpty()) { return new RedirectView("/account?messageType=userNotFound"); @@ -73,6 +78,10 @@ public class UserController { User user = userOpt.get(); + if (user.getUsername().equals(newUsername)) { + return new RedirectView("/account?messageType=usernameExists"); + } + if (!userService.isPasswordCorrect(user, currentPassword)) { return new RedirectView("/account?messageType=incorrectPassword"); } @@ -186,6 +195,18 @@ public class UserController { @RequestParam(name = "forceChange", required = false, defaultValue = "false") boolean forceChange) { + if (!userService.isUsernameValid(username)) { + return new RedirectView("/addUsers?messageType=invalidUsername"); + } + + Optional userOpt = userService.findByUsernameIgnoreCase(username); + + if (userOpt.isPresent()) { + User user = userOpt.get(); + if (user != null && user.getUsername().equalsIgnoreCase(username)) { + return new RedirectView("/addUsers?messageType=usernameExists"); + } + } if (userService.usernameExists(username)) { return new RedirectView("/addUsers?messageType=usernameExists"); } diff --git a/src/main/java/stirling/software/SPDF/repository/UserRepository.java b/src/main/java/stirling/software/SPDF/repository/UserRepository.java index d63c4cba..faa11fcc 100644 --- a/src/main/java/stirling/software/SPDF/repository/UserRepository.java +++ b/src/main/java/stirling/software/SPDF/repository/UserRepository.java @@ -3,10 +3,14 @@ package stirling.software.SPDF.repository; import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; import stirling.software.SPDF.model.User; public interface UserRepository extends JpaRepository { + Optional findByUsernameIgnoreCase(String username); + Optional findByUsername(String username); User findByApiKey(String apiKey); diff --git a/src/main/resources/messages_ar_AR.properties b/src/main/resources/messages_ar_AR.properties index aef98de5..63a459a4 100644 --- a/src/main/resources/messages_ar_AR.properties +++ b/src/main/resources/messages_ar_AR.properties @@ -53,6 +53,7 @@ notAuthenticatedMessage=User not authenticated. userNotFoundMessage=User not found. incorrectPasswordMessage=Current password is incorrect. usernameExistsMessage=New Username already exists. +invalidUsernameMessage=Invalid username, Username must only contain alphabet characters and numbers. deleteCurrentUserMessage=Cannot delete currently logged in user. deleteUsernameExistsMessage=The username does not exist and cannot be deleted. @@ -145,6 +146,7 @@ adminUserSettings.header=Admin User Control Settings adminUserSettings.admin=Admin adminUserSettings.user=User adminUserSettings.addUser=Add New User +adminUserSettings.usernameInfo=Username must only contain letters and numbers, no spaces or special characters. adminUserSettings.roles=Roles adminUserSettings.role=Role adminUserSettings.actions=Actions diff --git a/src/main/resources/messages_bg_BG.properties b/src/main/resources/messages_bg_BG.properties index f85f53cc..4428a68b 100644 --- a/src/main/resources/messages_bg_BG.properties +++ b/src/main/resources/messages_bg_BG.properties @@ -53,6 +53,7 @@ notAuthenticatedMessage=Потребителят не е автентикира userNotFoundMessage=Потребителят не е намерен incorrectPasswordMessage=Текущата парола е неправилна. usernameExistsMessage=Новият потребител вече съществува. +invalidUsernameMessage=Invalid username, Username must only contain alphabet characters and numbers. deleteCurrentUserMessage=Cannot delete currently logged in user. deleteUsernameExistsMessage=The username does not exist and cannot be deleted. @@ -145,6 +146,7 @@ adminUserSettings.header=Настройки за администраторск adminUserSettings.admin=Администратор adminUserSettings.user=Потребител adminUserSettings.addUser=Добавяне на нов потребител +adminUserSettings.usernameInfo=Username must only contain letters and numbers, no spaces or special characters. adminUserSettings.roles=Роли adminUserSettings.role=Роля adminUserSettings.actions=Действия diff --git a/src/main/resources/messages_ca_CA.properties b/src/main/resources/messages_ca_CA.properties index e76b5b4d..a97f6604 100644 --- a/src/main/resources/messages_ca_CA.properties +++ b/src/main/resources/messages_ca_CA.properties @@ -53,6 +53,7 @@ notAuthenticatedMessage=User not authenticated. userNotFoundMessage=User not found. incorrectPasswordMessage=Current password is incorrect. usernameExistsMessage=New Username already exists. +invalidUsernameMessage=Invalid username, Username must only contain alphabet characters and numbers. deleteCurrentUserMessage=Cannot delete currently logged in user. deleteUsernameExistsMessage=The username does not exist and cannot be deleted. @@ -145,6 +146,7 @@ adminUserSettings.header=Usuari Admin Opcions Control adminUserSettings.admin=Admin adminUserSettings.user=Usuari adminUserSettings.addUser=Afegir Usuari +adminUserSettings.usernameInfo=Username must only contain letters and numbers, no spaces or special characters. adminUserSettings.roles=Rols adminUserSettings.role=Rol adminUserSettings.actions=Accions diff --git a/src/main/resources/messages_de_DE.properties b/src/main/resources/messages_de_DE.properties index 7a783db5..3340a306 100644 --- a/src/main/resources/messages_de_DE.properties +++ b/src/main/resources/messages_de_DE.properties @@ -53,6 +53,7 @@ notAuthenticatedMessage=Benutzer nicht authentifiziert. userNotFoundMessage=Benutzer nicht gefunden. incorrectPasswordMessage=Das Passwort ist falsch. usernameExistsMessage=Neuer Benutzername existiert bereits. +invalidUsernameMessage=Ungültiger Benutzername. Der Benutzername darf nur Buchstaben und Zahlen enthalten. deleteCurrentUserMessage=Der aktuell angemeldete Benutzer kann nicht gelöscht werden. deleteUsernameExistsMessage=Der Benutzername existiert nicht und kann nicht gelöscht werden. @@ -145,6 +146,7 @@ adminUserSettings.header=Administrator-Benutzerkontrolle adminUserSettings.admin=Admin adminUserSettings.user=Benutzer adminUserSettings.addUser=Neuen Benutzer hinzufügen +adminUserSettings.usernameInfo=Der Benutzername darf nur Buchstaben und Zahlen enthalten, keine Leerzeichen oder Sonderzeichen. adminUserSettings.roles=Rollen adminUserSettings.role=Rolle adminUserSettings.actions=Aktion @@ -416,7 +418,7 @@ login.title=Anmelden login.header=Anmelden login.signin=Anmelden login.rememberme=Angemeldet bleiben -login.invalid=Ungültiger Benutzername oder Passwort. +login.invalid=Benutzername oder Passwort ungültig. login.locked=Ihr Konto wurde gesperrt. login.signinTitle=Bitte melden Sie sich an diff --git a/src/main/resources/messages_el_GR.properties b/src/main/resources/messages_el_GR.properties index 8f96f8b8..b3531514 100644 --- a/src/main/resources/messages_el_GR.properties +++ b/src/main/resources/messages_el_GR.properties @@ -53,6 +53,7 @@ notAuthenticatedMessage=\u039F \u03C7\u03C1\u03AE\u03C3\u03C4\u03B7\u03C2 \u03B4 userNotFoundMessage=\u039F \u03C7\u03C1\u03AE\u03C3\u03C4\u03B7\u03C2 \u03B4\u03B5\u03BD \u03B2\u03C1\u03AD\u03B8\u03B7\u03BA\u03B5. incorrectPasswordMessage=\u039F \u03C4\u03C1\u03AD\u03C7\u03C9\u03BD \u03BA\u03C9\u03B4\u03B9\u03BA\u03CC\u03C2 \u03C0\u03C1\u03CC\u03C3\u03B2\u03B1\u03C3\u03B7\u03C2 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03BB\u03B1\u03BD\u03B8\u03B1\u03C3\u03BC\u03AD\u03BD\u03BF\u03C2. usernameExistsMessage=\u03A4\u03BF \u03BD\u03AD\u03BF \u03CC\u03BD\u03BF\u03BC\u03B1 \u03C7\u03C1\u03AE\u03C3\u03C4\u03B7 \u03C5\u03C0\u03AC\u03C1\u03C7\u03B5\u03B9 \u03AE\u03B4\u03B7. +invalidUsernameMessage=Invalid username, Username must only contain alphabet characters and numbers. deleteCurrentUserMessage=Cannot delete currently logged in user. deleteUsernameExistsMessage=The username does not exist and cannot be deleted. @@ -145,6 +146,7 @@ adminUserSettings.header=\u03A1\u03C5\u03B8\u03BC\u03AF\u03C3\u03B5\u03B9\u03C2 adminUserSettings.admin=\u0394\u03B9\u03B1\u03C7\u03B5\u03B9\u03C1\u03B9\u03C3\u03C4\u03AE\u03C2 adminUserSettings.user=\u03A7\u03C1\u03AE\u03C3\u03C4\u03B7\u03C2 adminUserSettings.addUser=\u03A0\u03C1\u03BF\u03C3\u03B8\u03AE\u03BA\u03B7 \u03BD\u03AD\u03BF\u03C5 \u03A7\u03C1\u03AE\u03C3\u03C4\u03B7 +adminUserSettings.usernameInfo=Username must only contain letters and numbers, no spaces or special characters. adminUserSettings.roles=\u03A1\u03CC\u03BB\u03BF\u03B9 adminUserSettings.role=\u03A1\u03CC\u03BB\u03BF\u03C2 adminUserSettings.actions=\u0395\u03BD\u03AD\u03C1\u03B3\u03B5\u03B9\u03B5\u03C2 diff --git a/src/main/resources/messages_en_GB.properties b/src/main/resources/messages_en_GB.properties index 3f982b2d..41c9f30a 100644 --- a/src/main/resources/messages_en_GB.properties +++ b/src/main/resources/messages_en_GB.properties @@ -53,6 +53,7 @@ notAuthenticatedMessage=User not authenticated. userNotFoundMessage=User not found. incorrectPasswordMessage=Current password is incorrect. usernameExistsMessage=New Username already exists. +invalidUsernameMessage=Invalid username, Username must only contain alphabet characters and numbers. deleteCurrentUserMessage=Cannot delete currently logged in user. deleteUsernameExistsMessage=The username does not exist and cannot be deleted. @@ -145,6 +146,7 @@ adminUserSettings.header=Admin User Control Settings adminUserSettings.admin=Admin adminUserSettings.user=User adminUserSettings.addUser=Add New User +adminUserSettings.usernameInfo=Username must only contain letters and numbers, no spaces or special characters. adminUserSettings.roles=Roles adminUserSettings.role=Role adminUserSettings.actions=Actions diff --git a/src/main/resources/messages_en_US.properties b/src/main/resources/messages_en_US.properties index e430630a..2d7524f5 100644 --- a/src/main/resources/messages_en_US.properties +++ b/src/main/resources/messages_en_US.properties @@ -53,6 +53,7 @@ notAuthenticatedMessage=User not authenticated. userNotFoundMessage=User not found. incorrectPasswordMessage=Current password is incorrect. usernameExistsMessage=New Username already exists. +invalidUsernameMessage=Invalid username, Username must only contain alphabet characters and numbers. deleteCurrentUserMessage=Cannot delete currently logged in user. deleteUsernameExistsMessage=The username does not exist and cannot be deleted. @@ -145,6 +146,7 @@ adminUserSettings.header=Admin User Control Settings adminUserSettings.admin=Admin adminUserSettings.user=User adminUserSettings.addUser=Add New User +adminUserSettings.usernameInfo=Username must only contain letters and numbers, no spaces or special characters. adminUserSettings.roles=Roles adminUserSettings.role=Role adminUserSettings.actions=Actions diff --git a/src/main/resources/messages_es_ES.properties b/src/main/resources/messages_es_ES.properties index 9be5f90a..adaab7de 100644 --- a/src/main/resources/messages_es_ES.properties +++ b/src/main/resources/messages_es_ES.properties @@ -53,6 +53,7 @@ notAuthenticatedMessage=Usuario no autentificado. userNotFoundMessage=Usuario no encontrado. incorrectPasswordMessage=La contraseña actual no es correcta. usernameExistsMessage=El nuevo nombre de usuario está en uso. +invalidUsernameMessage=Invalid username, Username must only contain alphabet characters and numbers. deleteCurrentUserMessage=Cannot delete currently logged in user. deleteUsernameExistsMessage=The username does not exist and cannot be deleted. @@ -145,6 +146,7 @@ adminUserSettings.header=Configuración de control de usuario administrador adminUserSettings.admin=Administrador adminUserSettings.user=Usuario adminUserSettings.addUser=Añadir Nuevo Usuario +adminUserSettings.usernameInfo=Username must only contain letters and numbers, no spaces or special characters. adminUserSettings.roles=Roles adminUserSettings.role=Rol adminUserSettings.actions=Acciones diff --git a/src/main/resources/messages_eu_ES.properties b/src/main/resources/messages_eu_ES.properties index e67214c2..e24e3a7d 100644 --- a/src/main/resources/messages_eu_ES.properties +++ b/src/main/resources/messages_eu_ES.properties @@ -53,6 +53,7 @@ notAuthenticatedMessage=User not authenticated. userNotFoundMessage=User not found. incorrectPasswordMessage=Current password is incorrect. usernameExistsMessage=New Username already exists. +invalidUsernameMessage=Invalid username, Username must only contain alphabet characters and numbers. deleteCurrentUserMessage=Cannot delete currently logged in user. deleteUsernameExistsMessage=The username does not exist and cannot be deleted. @@ -145,6 +146,7 @@ adminUserSettings.header=Admin Erabiltzailearen Ezarpenen Kontrolak adminUserSettings.admin=Admin adminUserSettings.user=Erabiltzaile adminUserSettings.addUser=Erabiltzaile berria +adminUserSettings.usernameInfo=Username must only contain letters and numbers, no spaces or special characters. adminUserSettings.roles=Rolak adminUserSettings.role=Rol adminUserSettings.actions=Ekintzak diff --git a/src/main/resources/messages_fr_FR.properties b/src/main/resources/messages_fr_FR.properties index 628792ae..809612d1 100644 --- a/src/main/resources/messages_fr_FR.properties +++ b/src/main/resources/messages_fr_FR.properties @@ -53,6 +53,7 @@ notAuthenticatedMessage=Utilisateur non authentifié. userNotFoundMessage=Utilisateur non trouvé. incorrectPasswordMessage=Le mot de passe actuel est incorrect. usernameExistsMessage=Le nouveau nom d\u2019utilisateur existe déjà. +invalidUsernameMessage=Invalid username, Username must only contain alphabet characters and numbers. deleteCurrentUserMessage=Cannot delete currently logged in user. deleteUsernameExistsMessage=The username does not exist and cannot be deleted. @@ -145,6 +146,7 @@ adminUserSettings.header=Administration des paramètres des utilisateurs adminUserSettings.admin=Administateur adminUserSettings.user=Utilisateur adminUserSettings.addUser=Ajouter un utilisateur +adminUserSettings.usernameInfo=Username must only contain letters and numbers, no spaces or special characters. adminUserSettings.roles=Rôles adminUserSettings.role=Rôle adminUserSettings.actions=Actions diff --git a/src/main/resources/messages_hi_IN.properties b/src/main/resources/messages_hi_IN.properties index 8487dc81..ab08aa3c 100644 --- a/src/main/resources/messages_hi_IN.properties +++ b/src/main/resources/messages_hi_IN.properties @@ -53,6 +53,7 @@ notAuthenticatedMessage=उपयोगकर्ता प्रमाणित userNotFoundMessage=उपयोगकर्ता नहीं मिला। incorrectPasswordMessage=वर्तमान पासवर्ड गलत है। usernameExistsMessage=नया उपयोगकर्ता नाम पहले से मौजूद है। +invalidUsernameMessage=Invalid username, Username must only contain alphabet characters and numbers. deleteCurrentUserMessage=Cannot delete currently logged in user. deleteUsernameExistsMessage=The username does not exist and cannot be deleted. @@ -145,6 +146,7 @@ adminUserSettings.header=व्यवस्थापक उपयोगकर् adminUserSettings.admin=व्यवस्थापक adminUserSettings.user=उपयोगकर्ता adminUserSettings.addUser=नया उपयोगकर्ता जोड़ें +adminUserSettings.usernameInfo=Username must only contain letters and numbers, no spaces or special characters. adminUserSettings.roles=रोल्स adminUserSettings.role=रोल adminUserSettings.actions=क्रियाएँ diff --git a/src/main/resources/messages_hu_HU.properties b/src/main/resources/messages_hu_HU.properties index 97ed6630..c6ef560a 100644 --- a/src/main/resources/messages_hu_HU.properties +++ b/src/main/resources/messages_hu_HU.properties @@ -53,6 +53,7 @@ notAuthenticatedMessage=Felhasználó nincs hitelesítve. userNotFoundMessage=A felhasználó nem található. incorrectPasswordMessage=A jelenlegi jelszó helytelen. usernameExistsMessage=Az új felhasználónév már létezik. +invalidUsernameMessage=Invalid username, Username must only contain alphabet characters and numbers. deleteCurrentUserMessage=Cannot delete currently logged in user. deleteUsernameExistsMessage=The username does not exist and cannot be deleted. @@ -145,6 +146,7 @@ adminUserSettings.header=Adminisztrátori Felhasználói Vezérlési Beállítá adminUserSettings.admin=Adminisztrátor adminUserSettings.user=Felhasználó adminUserSettings.addUser=Új felhasználó hozzáadása +adminUserSettings.usernameInfo=Username must only contain letters and numbers, no spaces or special characters. adminUserSettings.roles=Szerepek adminUserSettings.role=Szerep adminUserSettings.actions=Műveletek diff --git a/src/main/resources/messages_id_ID.properties b/src/main/resources/messages_id_ID.properties index 57f79f0c..96e77082 100644 --- a/src/main/resources/messages_id_ID.properties +++ b/src/main/resources/messages_id_ID.properties @@ -53,6 +53,7 @@ notAuthenticatedMessage=Pengguna tidak ter-autentikasi. userNotFoundMessage=Pengguna tidak ditemukan. incorrectPasswordMessage=Kata sandi saat ini salah. usernameExistsMessage=Nama pengguna baru sudah ada. +invalidUsernameMessage=Invalid username, Username must only contain alphabet characters and numbers. deleteCurrentUserMessage=Cannot delete currently logged in user. deleteUsernameExistsMessage=The username does not exist and cannot be deleted. @@ -145,6 +146,7 @@ adminUserSettings.header=Pengaturan Kontrol Admin adminUserSettings.admin=Admin adminUserSettings.user=Pengguna adminUserSettings.addUser=Tambahkan Pengguna Baru +adminUserSettings.usernameInfo=Username must only contain letters and numbers, no spaces or special characters. adminUserSettings.roles=Peran adminUserSettings.role=Peran adminUserSettings.actions=Tindakan diff --git a/src/main/resources/messages_it_IT.properties b/src/main/resources/messages_it_IT.properties index bebce2bd..524c98cd 100644 --- a/src/main/resources/messages_it_IT.properties +++ b/src/main/resources/messages_it_IT.properties @@ -53,6 +53,7 @@ notAuthenticatedMessage=Utente non autenticato. userNotFoundMessage=Utente non trovato. incorrectPasswordMessage=La password attuale non è corretta. usernameExistsMessage=Il nuovo nome utente esiste già. +invalidUsernameMessage=Invalid username, Username must only contain alphabet characters and numbers. deleteCurrentUserMessage=Impossibile eliminare l'utente attualmente connesso. deleteUsernameExistsMessage=Il nome utente non esiste e non può essere eliminato. @@ -145,6 +146,7 @@ adminUserSettings.header=Impostazioni di controllo utente amministratore adminUserSettings.admin=Amministratore adminUserSettings.user=Utente adminUserSettings.addUser=Aggiungi un nuovo Utente +adminUserSettings.usernameInfo=Username must only contain letters and numbers, no spaces or special characters. adminUserSettings.roles=Ruoli adminUserSettings.role=Ruolo adminUserSettings.actions=Azioni diff --git a/src/main/resources/messages_ja_JP.properties b/src/main/resources/messages_ja_JP.properties index 09611c97..956f9562 100644 --- a/src/main/resources/messages_ja_JP.properties +++ b/src/main/resources/messages_ja_JP.properties @@ -53,6 +53,7 @@ notAuthenticatedMessage=ユーザーが認証されていません。 userNotFoundMessage=ユーザーが見つかりません。 incorrectPasswordMessage=現在のパスワードが正しくありません。 usernameExistsMessage=新しいユーザー名はすでに存在します。 +invalidUsernameMessage=Invalid username, Username must only contain alphabet characters and numbers. deleteCurrentUserMessage=Cannot delete currently logged in user. deleteUsernameExistsMessage=The username does not exist and cannot be deleted. @@ -145,6 +146,7 @@ adminUserSettings.header=管理者ユーザー制御設定 adminUserSettings.admin=管理者 adminUserSettings.user=ユーザー adminUserSettings.addUser=新しいユーザを追加 +adminUserSettings.usernameInfo=Username must only contain letters and numbers, no spaces or special characters. adminUserSettings.roles=役割 adminUserSettings.role=役割 adminUserSettings.actions=アクション diff --git a/src/main/resources/messages_ko_KR.properties b/src/main/resources/messages_ko_KR.properties index 45d943e7..aa10e3c4 100644 --- a/src/main/resources/messages_ko_KR.properties +++ b/src/main/resources/messages_ko_KR.properties @@ -53,6 +53,7 @@ notAuthenticatedMessage=User not authenticated. userNotFoundMessage=사용자를 찾을 수 없습니다. incorrectPasswordMessage=현재 비밀번호가 틀립니다. usernameExistsMessage=새 사용자명이 이미 존재합니다. +invalidUsernameMessage=Invalid username, Username must only contain alphabet characters and numbers. deleteCurrentUserMessage=Cannot delete currently logged in user. deleteUsernameExistsMessage=The username does not exist and cannot be deleted. @@ -145,6 +146,7 @@ adminUserSettings.header=사용자 관리 adminUserSettings.admin=관리자 adminUserSettings.user=사용자 adminUserSettings.addUser=새 사용자 추가 +adminUserSettings.usernameInfo=Username must only contain letters and numbers, no spaces or special characters. adminUserSettings.roles=역할 adminUserSettings.role=역할 adminUserSettings.actions=동작 diff --git a/src/main/resources/messages_nl_NL.properties b/src/main/resources/messages_nl_NL.properties index dbc23d01..887a6813 100644 --- a/src/main/resources/messages_nl_NL.properties +++ b/src/main/resources/messages_nl_NL.properties @@ -53,6 +53,7 @@ notAuthenticatedMessage=Gebruiker niet ingelogd. userNotFoundMessage=Gebruiker niet gevonden. incorrectPasswordMessage=Huidige wachtwoord is onjuist. usernameExistsMessage=Nieuwe gebruikersnaam bestaat al. +invalidUsernameMessage=Invalid username, Username must only contain alphabet characters and numbers. deleteCurrentUserMessage=Cannot delete currently logged in user. deleteUsernameExistsMessage=The username does not exist and cannot be deleted. @@ -145,6 +146,7 @@ adminUserSettings.header=Beheer gebruikers adminUserSettings.admin=Beheerder adminUserSettings.user=Gebruiker adminUserSettings.addUser=Voeg nieuwe gebruiker toe +adminUserSettings.usernameInfo=Username must only contain letters and numbers, no spaces or special characters. adminUserSettings.roles=Rollen adminUserSettings.role=Rol adminUserSettings.actions=Acties diff --git a/src/main/resources/messages_pl_PL.properties b/src/main/resources/messages_pl_PL.properties index 14d9c741..5ffccb4d 100644 --- a/src/main/resources/messages_pl_PL.properties +++ b/src/main/resources/messages_pl_PL.properties @@ -53,6 +53,7 @@ notAuthenticatedMessage=User not authenticated. userNotFoundMessage=User not found. incorrectPasswordMessage=Current password is incorrect. usernameExistsMessage=New Username already exists. +invalidUsernameMessage=Invalid username, Username must only contain alphabet characters and numbers. deleteCurrentUserMessage=Cannot delete currently logged in user. deleteUsernameExistsMessage=The username does not exist and cannot be deleted. @@ -145,6 +146,7 @@ adminUserSettings.header=Admin User Control Settings adminUserSettings.admin=Admin adminUserSettings.user=User adminUserSettings.addUser=Add New User +adminUserSettings.usernameInfo=Username must only contain letters and numbers, no spaces or special characters. adminUserSettings.roles=Roles adminUserSettings.role=Role adminUserSettings.actions=Actions diff --git a/src/main/resources/messages_pt_BR.properties b/src/main/resources/messages_pt_BR.properties index 74cf8196..83171291 100644 --- a/src/main/resources/messages_pt_BR.properties +++ b/src/main/resources/messages_pt_BR.properties @@ -53,6 +53,7 @@ notAuthenticatedMessage=User not authenticated. userNotFoundMessage=User not found. incorrectPasswordMessage=Current password is incorrect. usernameExistsMessage=New Username already exists. +invalidUsernameMessage=Invalid username, Username must only contain alphabet characters and numbers. deleteCurrentUserMessage=Cannot delete currently logged in user. deleteUsernameExistsMessage=The username does not exist and cannot be deleted. @@ -145,6 +146,7 @@ adminUserSettings.header=Admin User Control Settings adminUserSettings.admin=Admin adminUserSettings.user=User adminUserSettings.addUser=Add New User +adminUserSettings.usernameInfo=Username must only contain letters and numbers, no spaces or special characters. adminUserSettings.roles=Roles adminUserSettings.role=Role adminUserSettings.actions=Actions diff --git a/src/main/resources/messages_pt_PT.properties b/src/main/resources/messages_pt_PT.properties index 7d4da27f..06d33860 100644 --- a/src/main/resources/messages_pt_PT.properties +++ b/src/main/resources/messages_pt_PT.properties @@ -53,6 +53,7 @@ notAuthenticatedMessage=Utilizador não autenticado. userNotFoundMessage=Utilizador inexistente. incorrectPasswordMessage=Senha incorreta. usernameExistsMessage=Esse utilizador já existe. +invalidUsernameMessage=Invalid username, Username must only contain alphabet characters and numbers. deleteCurrentUserMessage=Cannot delete currently logged in user. deleteUsernameExistsMessage=The username does not exist and cannot be deleted. @@ -145,6 +146,7 @@ adminUserSettings.header=Admin User Control Settings adminUserSettings.admin=Admin adminUserSettings.user=User adminUserSettings.addUser=Add New User +adminUserSettings.usernameInfo=Username must only contain letters and numbers, no spaces or special characters. adminUserSettings.roles=Roles adminUserSettings.role=Role adminUserSettings.actions=Actions diff --git a/src/main/resources/messages_ro_RO.properties b/src/main/resources/messages_ro_RO.properties index a28585db..66639555 100644 --- a/src/main/resources/messages_ro_RO.properties +++ b/src/main/resources/messages_ro_RO.properties @@ -53,6 +53,7 @@ notAuthenticatedMessage=User not authenticated. userNotFoundMessage=User not found. incorrectPasswordMessage=Current password is incorrect. usernameExistsMessage=New Username already exists. +invalidUsernameMessage=Invalid username, Username must only contain alphabet characters and numbers. deleteCurrentUserMessage=Cannot delete currently logged in user. deleteUsernameExistsMessage=The username does not exist and cannot be deleted. @@ -145,6 +146,7 @@ adminUserSettings.header=Admin User Control Settings adminUserSettings.admin=Admin adminUserSettings.user=User adminUserSettings.addUser=Add New User +adminUserSettings.usernameInfo=Username must only contain letters and numbers, no spaces or special characters. adminUserSettings.roles=Roles adminUserSettings.role=Role adminUserSettings.actions=Actions diff --git a/src/main/resources/messages_ru_RU.properties b/src/main/resources/messages_ru_RU.properties index eeba0fea..5826ceef 100644 --- a/src/main/resources/messages_ru_RU.properties +++ b/src/main/resources/messages_ru_RU.properties @@ -53,6 +53,7 @@ notAuthenticatedMessage=User not authenticated. userNotFoundMessage=User not found. incorrectPasswordMessage=Current password is incorrect. usernameExistsMessage=New Username already exists. +invalidUsernameMessage=Invalid username, Username must only contain alphabet characters and numbers. deleteCurrentUserMessage=Cannot delete currently logged in user. deleteUsernameExistsMessage=The username does not exist and cannot be deleted. @@ -145,6 +146,7 @@ adminUserSettings.header=Admin User Control Settings adminUserSettings.admin=Admin adminUserSettings.user=User adminUserSettings.addUser=Add New User +adminUserSettings.usernameInfo=Username must only contain letters and numbers, no spaces or special characters. adminUserSettings.roles=Roles adminUserSettings.role=Role adminUserSettings.actions=Actions diff --git a/src/main/resources/messages_sr_LATN_RS.properties b/src/main/resources/messages_sr_LATN_RS.properties index db33348b..0b195bcb 100644 --- a/src/main/resources/messages_sr_LATN_RS.properties +++ b/src/main/resources/messages_sr_LATN_RS.properties @@ -53,6 +53,7 @@ notAuthenticatedMessage=Korisnik nije autentifikovan. userNotFoundMessage=Korisnik nije pronađen. incorrectPasswordMessage=Trenutna šifra je netačna. usernameExistsMessage=Novi korisnik već postoji +invalidUsernameMessage=Invalid username, Username must only contain alphabet characters and numbers. deleteCurrentUserMessage=Cannot delete currently logged in user. deleteUsernameExistsMessage=The username does not exist and cannot be deleted. @@ -145,6 +146,7 @@ adminUserSettings.header=Podešavanja kontrole korisnika za administratora adminUserSettings.admin=Administrator adminUserSettings.user=Korisnik adminUserSettings.addUser=Dodaj novog korisnika +adminUserSettings.usernameInfo=Username must only contain letters and numbers, no spaces or special characters. adminUserSettings.roles=Uloge adminUserSettings.role=Uloga adminUserSettings.actions=Akcije diff --git a/src/main/resources/messages_sv_SE.properties b/src/main/resources/messages_sv_SE.properties index 9799dcf7..6adb3302 100644 --- a/src/main/resources/messages_sv_SE.properties +++ b/src/main/resources/messages_sv_SE.properties @@ -53,6 +53,7 @@ notAuthenticatedMessage=User not authenticated. userNotFoundMessage=User not found. incorrectPasswordMessage=Current password is incorrect. usernameExistsMessage=New Username already exists. +invalidUsernameMessage=Invalid username, Username must only contain alphabet characters and numbers. deleteCurrentUserMessage=Cannot delete currently logged in user. deleteUsernameExistsMessage=The username does not exist and cannot be deleted. @@ -145,6 +146,7 @@ adminUserSettings.header=Admin User Control Settings adminUserSettings.admin=Admin adminUserSettings.user=User adminUserSettings.addUser=Add New User +adminUserSettings.usernameInfo=Username must only contain letters and numbers, no spaces or special characters. adminUserSettings.roles=Roles adminUserSettings.role=Role adminUserSettings.actions=Actions diff --git a/src/main/resources/messages_tr_TR.properties b/src/main/resources/messages_tr_TR.properties index 309c8286..0b50c054 100644 --- a/src/main/resources/messages_tr_TR.properties +++ b/src/main/resources/messages_tr_TR.properties @@ -53,6 +53,7 @@ notAuthenticatedMessage=Kullanıcı doğrulanmadı. userNotFoundMessage=Kullanıcı bulunamadı. incorrectPasswordMessage=Mevcut şifre yanlış. usernameExistsMessage=Yeni Kullanıcı Adı zaten var. +invalidUsernameMessage=Invalid username, Username must only contain alphabet characters and numbers. deleteCurrentUserMessage=Cannot delete currently logged in user. deleteUsernameExistsMessage=The username does not exist and cannot be deleted. @@ -145,6 +146,7 @@ adminUserSettings.header=Yönetici Kullanıcı Kontrol Ayarları adminUserSettings.admin=Yönetici adminUserSettings.user=Kullanıcı adminUserSettings.addUser=Yeni Kullanıcı Ekle +adminUserSettings.usernameInfo=Username must only contain letters and numbers, no spaces or special characters. adminUserSettings.roles=Roller adminUserSettings.role=Rol adminUserSettings.actions=Eylemler diff --git a/src/main/resources/messages_zh_CN.properties b/src/main/resources/messages_zh_CN.properties index 60ea640c..80a0d028 100644 --- a/src/main/resources/messages_zh_CN.properties +++ b/src/main/resources/messages_zh_CN.properties @@ -53,6 +53,7 @@ notAuthenticatedMessage=用户未经过身份验证。 userNotFoundMessage=未找到用户。 incorrectPasswordMessage=当前密码不正确。 usernameExistsMessage=新用户名已存在。 +invalidUsernameMessage=Invalid username, Username must only contain alphabet characters and numbers. deleteCurrentUserMessage=Cannot delete currently logged in user. deleteUsernameExistsMessage=The username does not exist and cannot be deleted. @@ -145,6 +146,7 @@ adminUserSettings.header=管理员用户控制设置 adminUserSettings.admin=管理员 adminUserSettings.user=用户 adminUserSettings.addUser=添加新用户 +adminUserSettings.usernameInfo=Username must only contain letters and numbers, no spaces or special characters. adminUserSettings.roles=角色 adminUserSettings.role=角色 adminUserSettings.actions=操作 diff --git a/src/main/resources/messages_zh_TW.properties b/src/main/resources/messages_zh_TW.properties index 099b5ff5..cbf50e0e 100644 --- a/src/main/resources/messages_zh_TW.properties +++ b/src/main/resources/messages_zh_TW.properties @@ -53,6 +53,7 @@ notAuthenticatedMessage=使用者未認證。 userNotFoundMessage=找不到使用者。 incorrectPasswordMessage=目前密碼不正確。 usernameExistsMessage=新使用者名稱已存在。 +invalidUsernameMessage=Invalid username, Username must only contain alphabet characters and numbers. deleteCurrentUserMessage=Cannot delete currently logged in user. deleteUsernameExistsMessage=The username does not exist and cannot be deleted. @@ -145,6 +146,7 @@ adminUserSettings.header=管理使用者控制設定 adminUserSettings.admin=管理員 adminUserSettings.user=使用者 adminUserSettings.addUser=新增使用者 +adminUserSettings.usernameInfo=Username must only contain letters and numbers, no spaces or special characters. adminUserSettings.roles=角色 adminUserSettings.role=角色 adminUserSettings.actions=操作 diff --git a/src/main/resources/templates/account.html b/src/main/resources/templates/account.html index 4398891d..20501413 100644 --- a/src/main/resources/templates/account.html +++ b/src/main/resources/templates/account.html @@ -30,6 +30,9 @@
Default message if not found
+
+ Default message if not found +

User!

diff --git a/src/main/resources/templates/addUsers.html b/src/main/resources/templates/addUsers.html index 5e4f5f68..397b054a 100644 --- a/src/main/resources/templates/addUsers.html +++ b/src/main/resources/templates/addUsers.html @@ -42,13 +42,14 @@

Add New User

-
- Default message if not found +
+ Default message if not found + Default message if not found
- +