From 97472310f210327bbb41dea5b001c08ce472121c Mon Sep 17 00:00:00 2001 From: Ludy Date: Wed, 6 Mar 2024 23:14:02 +0100 Subject: [PATCH] Show the user roles as real names (#867) * Show the user roles as real names * Add error message * Update Role.java * default Language without translation * Update messages_el_GR.properties --- .../SPDF/controller/api/UserController.java | 10 +++-- .../controller/web/AccountWebController.java | 4 ++ .../stirling/software/SPDF/model/Role.java | 42 +++++++++++++++---- .../stirling/software/SPDF/model/User.java | 7 ++++ src/main/resources/messages_ar_AR.properties | 4 ++ src/main/resources/messages_bg_BG.properties | 4 ++ src/main/resources/messages_ca_CA.properties | 4 ++ src/main/resources/messages_de_DE.properties | 4 ++ src/main/resources/messages_el_GR.properties | 4 ++ src/main/resources/messages_en_GB.properties | 4 ++ src/main/resources/messages_en_US.properties | 4 ++ src/main/resources/messages_es_ES.properties | 4 ++ src/main/resources/messages_eu_ES.properties | 4 ++ src/main/resources/messages_fr_FR.properties | 4 ++ src/main/resources/messages_hi_IN.properties | 4 ++ src/main/resources/messages_hu_HU.properties | 4 ++ src/main/resources/messages_id_ID.properties | 4 ++ src/main/resources/messages_it_IT.properties | 4 ++ src/main/resources/messages_ja_JP.properties | 4 ++ src/main/resources/messages_ko_KR.properties | 4 ++ src/main/resources/messages_nl_NL.properties | 4 ++ src/main/resources/messages_pl_PL.properties | 4 ++ src/main/resources/messages_pt_BR.properties | 4 ++ src/main/resources/messages_pt_PT.properties | 4 ++ src/main/resources/messages_ro_RO.properties | 4 ++ src/main/resources/messages_ru_RU.properties | 4 ++ .../resources/messages_sr_LATN_RS.properties | 4 ++ src/main/resources/messages_sv_SE.properties | 4 ++ src/main/resources/messages_tr_TR.properties | 4 ++ src/main/resources/messages_zh_CN.properties | 4 ++ src/main/resources/messages_zh_TW.properties | 4 ++ src/main/resources/templates/addUsers.html | 12 +++--- 32 files changed, 166 insertions(+), 17 deletions(-) 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 c610759a..79064d5c 100644 --- a/src/main/java/stirling/software/SPDF/controller/api/UserController.java +++ b/src/main/java/stirling/software/SPDF/controller/api/UserController.java @@ -222,18 +222,22 @@ public class UserController { @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/admin/deleteUser/{username}") - public String deleteUser(@PathVariable String username, Authentication authentication) { + public RedirectView deleteUser(@PathVariable String username, Authentication authentication) { + + if (!userService.usernameExists(username)) { + return new RedirectView("/addUsers?messageType=deleteUsernameExists"); + } // Get the currently authenticated username String currentUsername = authentication.getName(); // Check if the provided username matches the current session's username if (currentUsername.equals(username)) { - throw new IllegalArgumentException("Cannot delete currently logined in user."); + return new RedirectView("/addUsers?messageType=deleteCurrentUser"); } invalidateUserSessions(username); userService.deleteUser(username); - return "redirect:/addUsers"; + return new RedirectView("/addUsers"); } @Autowired private SessionRegistry sessionRegistry; diff --git a/src/main/java/stirling/software/SPDF/controller/web/AccountWebController.java b/src/main/java/stirling/software/SPDF/controller/web/AccountWebController.java index a5b3d79e..d27f510a 100644 --- a/src/main/java/stirling/software/SPDF/controller/web/AccountWebController.java +++ b/src/main/java/stirling/software/SPDF/controller/web/AccountWebController.java @@ -2,6 +2,7 @@ package stirling.software.SPDF.controller.web; import java.util.Iterator; import java.util.List; +import java.util.Map; import java.util.Optional; import org.springframework.beans.factory.annotation.Autowired; @@ -55,6 +56,7 @@ public class AccountWebController { public String showAddUserForm(Model model, Authentication authentication) { List allUsers = userRepository.findAll(); Iterator iterator = allUsers.iterator(); + Map roleDetails = Role.getAllRoleDetails(); while (iterator.hasNext()) { User user = iterator.next(); @@ -62,6 +64,7 @@ public class AccountWebController { for (Authority authority : user.getAuthorities()) { if (authority.getAuthority().equals(Role.INTERNAL_API_USER.getRoleId())) { iterator.remove(); + roleDetails.remove(Role.INTERNAL_API_USER.getRoleId()); break; // Break out of the inner loop once the user is removed } } @@ -70,6 +73,7 @@ public class AccountWebController { model.addAttribute("users", allUsers); model.addAttribute("currentUsername", authentication.getName()); + model.addAttribute("roleDetails", roleDetails); return "addUsers"; } diff --git a/src/main/java/stirling/software/SPDF/model/Role.java b/src/main/java/stirling/software/SPDF/model/Role.java index 5100e9dd..d2650aee 100644 --- a/src/main/java/stirling/software/SPDF/model/Role.java +++ b/src/main/java/stirling/software/SPDF/model/Role.java @@ -1,34 +1,39 @@ package stirling.software.SPDF.model; +import java.util.LinkedHashMap; +import java.util.Map; + public enum Role { // Unlimited access - ADMIN("ROLE_ADMIN", Integer.MAX_VALUE, Integer.MAX_VALUE), + ADMIN("ROLE_ADMIN", Integer.MAX_VALUE, Integer.MAX_VALUE, "adminUserSettings.admin"), // Unlimited access - USER("ROLE_USER", Integer.MAX_VALUE, Integer.MAX_VALUE), + USER("ROLE_USER", Integer.MAX_VALUE, Integer.MAX_VALUE, "adminUserSettings.user"), // 40 API calls Per Day, 40 web calls - LIMITED_API_USER("ROLE_LIMITED_API_USER", 40, 40), + LIMITED_API_USER("ROLE_LIMITED_API_USER", 40, 40, "adminUserSettings.apiUser"), // 20 API calls Per Day, 20 web calls - EXTRA_LIMITED_API_USER("ROLE_EXTRA_LIMITED_API_USER", 20, 20), + EXTRA_LIMITED_API_USER("ROLE_EXTRA_LIMITED_API_USER", 20, 20, "adminUserSettings.extraApiUser"), // 0 API calls per day and 20 web calls - WEB_ONLY_USER("ROLE_WEB_ONLY_USER", 0, 20), + WEB_ONLY_USER("ROLE_WEB_ONLY_USER", 0, 20, "adminUserSettings.webOnlyUser"), - INTERNAL_API_USER("STIRLING-PDF-BACKEND-API-USER", Integer.MAX_VALUE, Integer.MAX_VALUE), + INTERNAL_API_USER("STIRLING-PDF-BACKEND-API-USER", Integer.MAX_VALUE, Integer.MAX_VALUE, "adminUserSettings.internalApiUser"), - DEMO_USER("ROLE_DEMO_USER", 100, 100); + DEMO_USER("ROLE_DEMO_USER", 100, 100, "adminUserSettings.demoUser"); private final String roleId; private final int apiCallsPerDay; private final int webCallsPerDay; + private final String roleName; - Role(String roleId, int apiCallsPerDay, int webCallsPerDay) { + Role(String roleId, int apiCallsPerDay, int webCallsPerDay, String roleName) { this.roleId = roleId; this.apiCallsPerDay = apiCallsPerDay; this.webCallsPerDay = webCallsPerDay; + this.roleName = roleName; } public String getRoleId() { @@ -43,6 +48,27 @@ public enum Role { return webCallsPerDay; } + public String getRoleName() { + return roleName; + } + + public static String getRoleNameByRoleId(String roleId) { + // Using the fromString method to get the Role enum based on the roleId + Role role = fromString(roleId); + // Return the roleName of the found Role enum + return role.getRoleName(); + } + + // Method to retrieve all role IDs and role names + public static Map getAllRoleDetails() { + // Using LinkedHashMap to preserve order + Map roleDetails = new LinkedHashMap<>(); + for (Role role : Role.values()) { + roleDetails.put(role.getRoleId(), role.getRoleName()); + } + return roleDetails; + } + public static Role fromString(String roleId) { for (Role role : Role.values()) { if (role.getRoleId().equalsIgnoreCase(roleId)) { diff --git a/src/main/java/stirling/software/SPDF/model/User.java b/src/main/java/stirling/software/SPDF/model/User.java index 253b33da..f6f9e532 100644 --- a/src/main/java/stirling/software/SPDF/model/User.java +++ b/src/main/java/stirling/software/SPDF/model/User.java @@ -44,6 +44,9 @@ public class User { @Column(name = "isFirstLogin") private Boolean isFirstLogin = false; + @Column(name = "roleName") + private String roleName; + @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, mappedBy = "user") private Set authorities = new HashSet<>(); @@ -53,6 +56,10 @@ public class User { @CollectionTable(name = "user_settings", joinColumns = @JoinColumn(name = "user_id")) private Map settings = new HashMap<>(); // Key-value pairs of settings. + public String getRoleName() { + return Role.getRoleNameByRoleId(getRolesAsString()); + } + public boolean isFirstLogin() { return isFirstLogin != null && isFirstLogin; } diff --git a/src/main/resources/messages_ar_AR.properties b/src/main/resources/messages_ar_AR.properties index c1784775..35d692e2 100644 --- a/src/main/resources/messages_ar_AR.properties +++ b/src/main/resources/messages_ar_AR.properties @@ -53,6 +53,8 @@ notAuthenticatedMessage=User not authenticated. userNotFoundMessage=User not found. incorrectPasswordMessage=Current password is incorrect. usernameExistsMessage=New Username already exists. +deleteCurrentUserMessage=Cannot delete currently logged in user. +deleteUsernameExistsMessage=The username does not exist and cannot be deleted. ############### @@ -147,8 +149,10 @@ adminUserSettings.roles=Roles adminUserSettings.role=Role adminUserSettings.actions=Actions adminUserSettings.apiUser=Limited API User +adminUserSettings.extraApiUser=Additional Limited API User adminUserSettings.webOnlyUser=Web Only User adminUserSettings.demoUser=Demo User (No custom settings) +adminUserSettings.internalApiUser=Internal API User adminUserSettings.forceChange=Force user to change username/password on login adminUserSettings.submit=Save User diff --git a/src/main/resources/messages_bg_BG.properties b/src/main/resources/messages_bg_BG.properties index 767fa50b..7d422be2 100644 --- a/src/main/resources/messages_bg_BG.properties +++ b/src/main/resources/messages_bg_BG.properties @@ -53,6 +53,8 @@ notAuthenticatedMessage=Потребителят не е автентикира userNotFoundMessage=Потребителят не е намерен incorrectPasswordMessage=Текущата парола е неправилна. usernameExistsMessage=Новият потребител вече съществува. +deleteCurrentUserMessage=Cannot delete currently logged in user. +deleteUsernameExistsMessage=The username does not exist and cannot be deleted. ############### @@ -147,8 +149,10 @@ adminUserSettings.roles=Роли adminUserSettings.role=Роля adminUserSettings.actions=Действия adminUserSettings.apiUser=Ограничен API потребител +adminUserSettings.extraApiUser=Additional Limited API User adminUserSettings.webOnlyUser=Само за уеб-потребител adminUserSettings.demoUser=Demo User (No custom settings) +adminUserSettings.internalApiUser=Internal API User adminUserSettings.forceChange=Принудете потребителя да промени потребителското име/парола при влизане adminUserSettings.submit=Съхранете потребителя diff --git a/src/main/resources/messages_ca_CA.properties b/src/main/resources/messages_ca_CA.properties index cbef48e1..5f5542a7 100644 --- a/src/main/resources/messages_ca_CA.properties +++ b/src/main/resources/messages_ca_CA.properties @@ -53,6 +53,8 @@ notAuthenticatedMessage=User not authenticated. userNotFoundMessage=User not found. incorrectPasswordMessage=Current password is incorrect. usernameExistsMessage=New Username already exists. +deleteCurrentUserMessage=Cannot delete currently logged in user. +deleteUsernameExistsMessage=The username does not exist and cannot be deleted. ############### @@ -147,8 +149,10 @@ adminUserSettings.roles=Rols adminUserSettings.role=Rol adminUserSettings.actions=Accions adminUserSettings.apiUser=Usuari amb API limitada +adminUserSettings.extraApiUser=Additional Limited API User adminUserSettings.webOnlyUser=Usuari només WEB adminUserSettings.demoUser=Demo User (No custom settings) +adminUserSettings.internalApiUser=Internal API User adminUserSettings.forceChange=Force user to change username/password on login adminUserSettings.submit=Desar Usuari diff --git a/src/main/resources/messages_de_DE.properties b/src/main/resources/messages_de_DE.properties index b3f3046d..3501880e 100644 --- a/src/main/resources/messages_de_DE.properties +++ b/src/main/resources/messages_de_DE.properties @@ -53,6 +53,8 @@ notAuthenticatedMessage=Benutzer nicht authentifiziert. userNotFoundMessage=Benutzer nicht gefunden. incorrectPasswordMessage=Das Passwort ist falsch. usernameExistsMessage=Neuer Benutzername existiert bereits. +deleteCurrentUserMessage=Der aktuell angemeldete Benutzer kann nicht gelöscht werden. +deleteUsernameExistsMessage=Der Benutzername existiert nicht und kann nicht gelöscht werden. ############### @@ -147,8 +149,10 @@ adminUserSettings.roles=Rollen adminUserSettings.role=Rolle adminUserSettings.actions=Aktion adminUserSettings.apiUser=Eingeschränkter API-Benutzer +adminUserSettings.extraApiUser=Zusätzlicher eingeschränkter API-Benutzer adminUserSettings.webOnlyUser=Nur Web-Benutzer adminUserSettings.demoUser=Demo-Benutzer (Keine benutzerdefinierten Einstellungen) +adminUserSettings.internalApiUser=Interner API-Benutzer adminUserSettings.forceChange=Benutzer dazu zwingen, Benutzernamen/Passwort bei der Anmeldung zu ändern adminUserSettings.submit=Benutzer speichern diff --git a/src/main/resources/messages_el_GR.properties b/src/main/resources/messages_el_GR.properties index 742be458..3ec33335 100644 --- a/src/main/resources/messages_el_GR.properties +++ b/src/main/resources/messages_el_GR.properties @@ -53,6 +53,8 @@ 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. +deleteCurrentUserMessage=Cannot delete currently logged in user. +deleteUsernameExistsMessage=The username does not exist and cannot be deleted. ############### @@ -147,8 +149,10 @@ 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 adminUserSettings.apiUser=\u03A0\u03B5\u03C1\u03B9\u03BF\u03C1\u03B9\u03C3\u03BC\u03AD\u03BD\u03BF\u03C2 \u03A7\u03C1\u03AE\u03C3\u03C4\u03B7\u03C2 \u03B3\u03B9\u03B1 \u03B4\u03B9\u03B5\u03C0\u03B1\u03C6\u03AE \u03C0\u03C1\u03BF\u03B3\u03C1\u03B1\u03BC\u03BC\u03B1\u03C4\u03B9\u03C3\u03BC\u03BF\u03CD \u03B5\u03C6\u03B1\u03C1\u03BC\u03BF\u03B3\u03CE\u03BD (API User) +adminUserSettings.extraApiUser=Additional Limited API User adminUserSettings.webOnlyUser=\u03A7\u03C1\u03AE\u03C3\u03C4\u03B7\u03C2 \u03BC\u03CC\u03BD\u03BF \u0399\u03C3\u03C4\u03BF\u03CD adminUserSettings.demoUser=Demo User (No custom settings) +adminUserSettings.internalApiUser=Internal API User adminUserSettings.forceChange=\u0391\u03BD\u03B1\u03B3\u03BA\u03AC\u03C3\u03C4\u03B5 \u03C4\u03BF\u03BD \u03C7\u03C1\u03AE\u03C3\u03C4\u03B7 \u03BD\u03B1 \u03B1\u03BB\u03BB\u03AC\u03BE\u03B5\u03B9 \u03C4\u03BF \u03CC\u03BD\u03BF\u03BC\u03B1 \u03C7\u03C1\u03AE\u03C3\u03C4\u03B7/\u03BA\u03C9\u03B4\u03B9\u03BA\u03CC \u03C0\u03C1\u03CC\u03C3\u03B2\u03B1\u03C3\u03B7\u03C2 \u03BA\u03B1\u03C4\u03AC \u03C4\u03B7 \u03C3\u03CD\u03BD\u03B4\u03B5\u03C3\u03B7 adminUserSettings.submit=\u0391\u03C0\u03BF\u03B8\u03AE\u03BA\u03B5\u03C5\u03C3\u03B7 \u03A7\u03C1\u03AE\u03C3\u03C4\u03B7 diff --git a/src/main/resources/messages_en_GB.properties b/src/main/resources/messages_en_GB.properties index 314174e8..3d41604c 100644 --- a/src/main/resources/messages_en_GB.properties +++ b/src/main/resources/messages_en_GB.properties @@ -53,6 +53,8 @@ notAuthenticatedMessage=User not authenticated. userNotFoundMessage=User not found. incorrectPasswordMessage=Current password is incorrect. usernameExistsMessage=New Username already exists. +deleteCurrentUserMessage=Cannot delete currently logged in user. +deleteUsernameExistsMessage=The username does not exist and cannot be deleted. ############### @@ -147,8 +149,10 @@ adminUserSettings.roles=Roles adminUserSettings.role=Role adminUserSettings.actions=Actions adminUserSettings.apiUser=Limited API User +adminUserSettings.extraApiUser=Additional Limited API User adminUserSettings.webOnlyUser=Web Only User adminUserSettings.demoUser=Demo User (No custom settings) +adminUserSettings.internalApiUser=Internal API User adminUserSettings.forceChange = Force user to change username/password on login adminUserSettings.submit=Save User diff --git a/src/main/resources/messages_en_US.properties b/src/main/resources/messages_en_US.properties index cfb0ab8c..8556d354 100644 --- a/src/main/resources/messages_en_US.properties +++ b/src/main/resources/messages_en_US.properties @@ -53,6 +53,8 @@ notAuthenticatedMessage=User not authenticated. userNotFoundMessage=User not found. incorrectPasswordMessage=Current password is incorrect. usernameExistsMessage=New Username already exists. +deleteCurrentUserMessage=Cannot delete currently logged in user. +deleteUsernameExistsMessage=The username does not exist and cannot be deleted. ############### @@ -147,8 +149,10 @@ adminUserSettings.roles=Roles adminUserSettings.role=Role adminUserSettings.actions=Actions adminUserSettings.apiUser=Limited API User +adminUserSettings.extraApiUser=Additional Limited API User adminUserSettings.webOnlyUser=Web Only User adminUserSettings.demoUser=Demo User (No custom settings) +adminUserSettings.internalApiUser=Internal API User adminUserSettings.forceChange=Force user to change username/password on login adminUserSettings.submit=Save User diff --git a/src/main/resources/messages_es_ES.properties b/src/main/resources/messages_es_ES.properties index a02d1c50..97653537 100644 --- a/src/main/resources/messages_es_ES.properties +++ b/src/main/resources/messages_es_ES.properties @@ -53,6 +53,8 @@ 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. +deleteCurrentUserMessage=Cannot delete currently logged in user. +deleteUsernameExistsMessage=The username does not exist and cannot be deleted. ############### @@ -147,8 +149,10 @@ adminUserSettings.roles=Roles adminUserSettings.role=Rol adminUserSettings.actions=Acciones adminUserSettings.apiUser=Usuario limitado de API +adminUserSettings.extraApiUser=Additional Limited API User adminUserSettings.webOnlyUser=Usuario solo web adminUserSettings.demoUser=Demo User (No custom settings) +adminUserSettings.internalApiUser=Internal API User adminUserSettings.forceChange=Forzar usuario a cambiar usuario/contraseña en el acceso adminUserSettings.submit=Guardar Usuario diff --git a/src/main/resources/messages_eu_ES.properties b/src/main/resources/messages_eu_ES.properties index af161353..be2e082c 100644 --- a/src/main/resources/messages_eu_ES.properties +++ b/src/main/resources/messages_eu_ES.properties @@ -53,6 +53,8 @@ notAuthenticatedMessage=User not authenticated. userNotFoundMessage=User not found. incorrectPasswordMessage=Current password is incorrect. usernameExistsMessage=New Username already exists. +deleteCurrentUserMessage=Cannot delete currently logged in user. +deleteUsernameExistsMessage=The username does not exist and cannot be deleted. ############### @@ -147,8 +149,10 @@ adminUserSettings.roles=Rolak adminUserSettings.role=Rol adminUserSettings.actions=Ekintzak adminUserSettings.apiUser=APIren erabiltzaile mugatua +adminUserSettings.extraApiUser=Additional Limited API User adminUserSettings.webOnlyUser=Web-erabiltzailea bakarrik adminUserSettings.demoUser=Demo User (No custom settings) +adminUserSettings.internalApiUser=Internal API User adminUserSettings.forceChange=Force user to change username/password on login adminUserSettings.submit=Gorde Erabiltzailea diff --git a/src/main/resources/messages_fr_FR.properties b/src/main/resources/messages_fr_FR.properties index 43653069..66cb7a3d 100644 --- a/src/main/resources/messages_fr_FR.properties +++ b/src/main/resources/messages_fr_FR.properties @@ -53,6 +53,8 @@ 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à. +deleteCurrentUserMessage=Cannot delete currently logged in user. +deleteUsernameExistsMessage=The username does not exist and cannot be deleted. ############### @@ -147,8 +149,10 @@ adminUserSettings.roles=Rôles adminUserSettings.role=Rôle adminUserSettings.actions=Actions adminUserSettings.apiUser=Utilisateur API limité +adminUserSettings.extraApiUser=Additional Limited API User adminUserSettings.webOnlyUser=Utilisateur Web uniquement adminUserSettings.demoUser=Demo User (Paramètres par défaut) +adminUserSettings.internalApiUser=Internal API User adminUserSettings.forceChange=Forcer l\u2019utilisateur à changer son nom d\u2019utilisateur/mot de passe lors de la connexion adminUserSettings.submit=Ajouter diff --git a/src/main/resources/messages_hi_IN.properties b/src/main/resources/messages_hi_IN.properties index 72011884..a05eeba0 100644 --- a/src/main/resources/messages_hi_IN.properties +++ b/src/main/resources/messages_hi_IN.properties @@ -53,6 +53,8 @@ notAuthenticatedMessage=उपयोगकर्ता प्रमाणित userNotFoundMessage=उपयोगकर्ता नहीं मिला। incorrectPasswordMessage=वर्तमान पासवर्ड गलत है। usernameExistsMessage=नया उपयोगकर्ता नाम पहले से मौजूद है। +deleteCurrentUserMessage=Cannot delete currently logged in user. +deleteUsernameExistsMessage=The username does not exist and cannot be deleted. ############### @@ -147,8 +149,10 @@ adminUserSettings.roles=रोल्स adminUserSettings.role=रोल adminUserSettings.actions=क्रियाएँ adminUserSettings.apiUser=सीमित API उपयोगकर्ता +adminUserSettings.extraApiUser=Additional Limited API User adminUserSettings.webOnlyUser=केवल वेब उपयोगकर्ता adminUserSettings.demoUser=Demo User (No custom settings) +adminUserSettings.internalApiUser=Internal API User adminUserSettings.forceChange=उपयोगकर्ता को लॉगिन पर उपयोगकर्ता नाम/पासवर्ड बदलने के लिए मजबूर करें adminUserSettings.submit=उपयोगकर्ता को सहेजें diff --git a/src/main/resources/messages_hu_HU.properties b/src/main/resources/messages_hu_HU.properties index 5d5df982..8b424c79 100644 --- a/src/main/resources/messages_hu_HU.properties +++ b/src/main/resources/messages_hu_HU.properties @@ -53,6 +53,8 @@ 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. +deleteCurrentUserMessage=Cannot delete currently logged in user. +deleteUsernameExistsMessage=The username does not exist and cannot be deleted. ############### @@ -147,8 +149,10 @@ adminUserSettings.roles=Szerepek adminUserSettings.role=Szerep adminUserSettings.actions=Műveletek adminUserSettings.apiUser=Korlátozott API-felhasználó +adminUserSettings.extraApiUser=Additional Limited API User adminUserSettings.webOnlyUser=Csak webes felhasználó adminUserSettings.demoUser=Demo User (No custom settings) +adminUserSettings.internalApiUser=Internal API User adminUserSettings.forceChange=Kényszerítse a felhasználót a felhasználónév/jelszó megváltoztatására bejelentkezéskor adminUserSettings.submit=Felhasználó mentése diff --git a/src/main/resources/messages_id_ID.properties b/src/main/resources/messages_id_ID.properties index ba8ff561..961021d6 100644 --- a/src/main/resources/messages_id_ID.properties +++ b/src/main/resources/messages_id_ID.properties @@ -53,6 +53,8 @@ notAuthenticatedMessage=Pengguna tidak ter-autentikasi. userNotFoundMessage=Pengguna tidak ditemukan. incorrectPasswordMessage=Kata sandi saat ini salah. usernameExistsMessage=Nama pengguna baru sudah ada. +deleteCurrentUserMessage=Cannot delete currently logged in user. +deleteUsernameExistsMessage=The username does not exist and cannot be deleted. ############### @@ -147,8 +149,10 @@ adminUserSettings.roles=Peran adminUserSettings.role=Peran adminUserSettings.actions=Tindakan adminUserSettings.apiUser=Pengguna API Terbatas +adminUserSettings.extraApiUser=Additional Limited API User adminUserSettings.webOnlyUser=Pengguna Khusus Web adminUserSettings.demoUser=Demo User (No custom settings) +adminUserSettings.internalApiUser=Internal API User adminUserSettings.forceChange=Memaksa pengguna untuk mengubah nama pengguna/kata sandi saat masuk adminUserSettings.submit=Simpan Pengguna diff --git a/src/main/resources/messages_it_IT.properties b/src/main/resources/messages_it_IT.properties index bc1e9cbc..95ff4439 100644 --- a/src/main/resources/messages_it_IT.properties +++ b/src/main/resources/messages_it_IT.properties @@ -53,6 +53,8 @@ notAuthenticatedMessage=Utente non autenticato. userNotFoundMessage=Utente non trovato. incorrectPasswordMessage=La password attuale non è corretta. usernameExistsMessage=Il nuovo nome utente esiste già. +deleteCurrentUserMessage=Cannot delete currently logged in user. +deleteUsernameExistsMessage=The username does not exist and cannot be deleted. ############### @@ -147,8 +149,10 @@ adminUserSettings.roles=Ruoli adminUserSettings.role=Ruolo adminUserSettings.actions=Azioni adminUserSettings.apiUser=Utente API limitato +adminUserSettings.extraApiUser=Additional Limited API User adminUserSettings.webOnlyUser=Utente solo Web adminUserSettings.demoUser=Utente demo (nessuna impostazione personalizzata) +adminUserSettings.internalApiUser=Internal API User adminUserSettings.forceChange=Forza l'utente a cambiare nome username/password all'accesso adminUserSettings.submit=Salva utente diff --git a/src/main/resources/messages_ja_JP.properties b/src/main/resources/messages_ja_JP.properties index f45db825..658daec0 100644 --- a/src/main/resources/messages_ja_JP.properties +++ b/src/main/resources/messages_ja_JP.properties @@ -53,6 +53,8 @@ notAuthenticatedMessage=ユーザーが認証されていません。 userNotFoundMessage=ユーザーが見つかりません。 incorrectPasswordMessage=現在のパスワードが正しくありません。 usernameExistsMessage=新しいユーザー名はすでに存在します。 +deleteCurrentUserMessage=Cannot delete currently logged in user. +deleteUsernameExistsMessage=The username does not exist and cannot be deleted. ############### @@ -147,8 +149,10 @@ adminUserSettings.roles=役割 adminUserSettings.role=役割 adminUserSettings.actions=アクション adminUserSettings.apiUser=限定されたAPIユーザー +adminUserSettings.extraApiUser=Additional Limited API User adminUserSettings.webOnlyUser=ウェブ専用ユーザー adminUserSettings.demoUser=Demo User (No custom settings) +adminUserSettings.internalApiUser=Internal API User adminUserSettings.forceChange=ログイン時にユーザー名/パスワードを強制的に変更する adminUserSettings.submit=ユーザーの保存 diff --git a/src/main/resources/messages_ko_KR.properties b/src/main/resources/messages_ko_KR.properties index 1386fb25..5c14c275 100644 --- a/src/main/resources/messages_ko_KR.properties +++ b/src/main/resources/messages_ko_KR.properties @@ -53,6 +53,8 @@ notAuthenticatedMessage=User not authenticated. userNotFoundMessage=사용자를 찾을 수 없습니다. incorrectPasswordMessage=현재 비밀번호가 틀립니다. usernameExistsMessage=새 사용자명이 이미 존재합니다. +deleteCurrentUserMessage=Cannot delete currently logged in user. +deleteUsernameExistsMessage=The username does not exist and cannot be deleted. ############### @@ -147,8 +149,10 @@ adminUserSettings.roles=역할 adminUserSettings.role=역할 adminUserSettings.actions=동작 adminUserSettings.apiUser=제한된 API 사용 +adminUserSettings.extraApiUser=Additional Limited API User adminUserSettings.webOnlyUser=웹 사용만 허용 adminUserSettings.demoUser=Demo User (No custom settings) +adminUserSettings.internalApiUser=Internal API User adminUserSettings.forceChange=다음 로그인 때 사용자명과 비밀번호를 변경하도록 강제 adminUserSettings.submit=사용자 저장 diff --git a/src/main/resources/messages_nl_NL.properties b/src/main/resources/messages_nl_NL.properties index 1731f5fa..21476a81 100644 --- a/src/main/resources/messages_nl_NL.properties +++ b/src/main/resources/messages_nl_NL.properties @@ -53,6 +53,8 @@ notAuthenticatedMessage=Gebruiker niet ingelogd. userNotFoundMessage=Gebruiker niet gevonden. incorrectPasswordMessage=Huidige wachtwoord is onjuist. usernameExistsMessage=Nieuwe gebruikersnaam bestaat al. +deleteCurrentUserMessage=Cannot delete currently logged in user. +deleteUsernameExistsMessage=The username does not exist and cannot be deleted. ############### @@ -147,8 +149,10 @@ adminUserSettings.roles=Rollen adminUserSettings.role=Rol adminUserSettings.actions=Acties adminUserSettings.apiUser=Beperkte API gebruiker +adminUserSettings.extraApiUser=Additional Limited API User adminUserSettings.webOnlyUser=Alleen web gebruiker adminUserSettings.demoUser=Demogebruiker (geen aangepaste instellingen) +adminUserSettings.internalApiUser=Internal API User adminUserSettings.forceChange=Forceer gebruiker om gebruikersnaam/wachtwoord te wijzigen bij inloggen adminUserSettings.submit=Gebruiker opslaan diff --git a/src/main/resources/messages_pl_PL.properties b/src/main/resources/messages_pl_PL.properties index 277462ff..37bf64e6 100644 --- a/src/main/resources/messages_pl_PL.properties +++ b/src/main/resources/messages_pl_PL.properties @@ -53,6 +53,8 @@ notAuthenticatedMessage=User not authenticated. userNotFoundMessage=User not found. incorrectPasswordMessage=Current password is incorrect. usernameExistsMessage=New Username already exists. +deleteCurrentUserMessage=Cannot delete currently logged in user. +deleteUsernameExistsMessage=The username does not exist and cannot be deleted. ############### @@ -147,8 +149,10 @@ adminUserSettings.roles=Roles adminUserSettings.role=Role adminUserSettings.actions=Actions adminUserSettings.apiUser=Limited API User +adminUserSettings.extraApiUser=Additional Limited API User adminUserSettings.webOnlyUser=Web Only User adminUserSettings.demoUser=Demo User (No custom settings) +adminUserSettings.internalApiUser=Internal API User adminUserSettings.forceChange=Force user to change username/password on login adminUserSettings.submit=Save User diff --git a/src/main/resources/messages_pt_BR.properties b/src/main/resources/messages_pt_BR.properties index 52dcc8fb..86affa82 100644 --- a/src/main/resources/messages_pt_BR.properties +++ b/src/main/resources/messages_pt_BR.properties @@ -53,6 +53,8 @@ notAuthenticatedMessage=User not authenticated. userNotFoundMessage=User not found. incorrectPasswordMessage=Current password is incorrect. usernameExistsMessage=New Username already exists. +deleteCurrentUserMessage=Cannot delete currently logged in user. +deleteUsernameExistsMessage=The username does not exist and cannot be deleted. ############### @@ -147,8 +149,10 @@ adminUserSettings.roles=Roles adminUserSettings.role=Role adminUserSettings.actions=Actions adminUserSettings.apiUser=Limited API User +adminUserSettings.extraApiUser=Additional Limited API User adminUserSettings.webOnlyUser=Web Only User adminUserSettings.demoUser=Demo User (No custom settings) +adminUserSettings.internalApiUser=Internal API User adminUserSettings.forceChange=Force user to change username/password on login adminUserSettings.submit=Save User diff --git a/src/main/resources/messages_pt_PT.properties b/src/main/resources/messages_pt_PT.properties index 8a6e7548..97366f3d 100644 --- a/src/main/resources/messages_pt_PT.properties +++ b/src/main/resources/messages_pt_PT.properties @@ -53,6 +53,8 @@ notAuthenticatedMessage=Utilizador não autenticado. userNotFoundMessage=Utilizador inexistente. incorrectPasswordMessage=Senha incorreta. usernameExistsMessage=Esse utilizador já existe. +deleteCurrentUserMessage=Cannot delete currently logged in user. +deleteUsernameExistsMessage=The username does not exist and cannot be deleted. ############### @@ -147,8 +149,10 @@ adminUserSettings.roles=Roles adminUserSettings.role=Role adminUserSettings.actions=Actions adminUserSettings.apiUser=Limited API User +adminUserSettings.extraApiUser=Additional Limited API User adminUserSettings.webOnlyUser=Web Only User adminUserSettings.demoUser=Demo User (No custom settings) +adminUserSettings.internalApiUser=Internal API User adminUserSettings.forceChange=Force user to change username/password on login adminUserSettings.submit=Save User diff --git a/src/main/resources/messages_ro_RO.properties b/src/main/resources/messages_ro_RO.properties index a33b8883..3ff43818 100644 --- a/src/main/resources/messages_ro_RO.properties +++ b/src/main/resources/messages_ro_RO.properties @@ -53,6 +53,8 @@ notAuthenticatedMessage=User not authenticated. userNotFoundMessage=User not found. incorrectPasswordMessage=Current password is incorrect. usernameExistsMessage=New Username already exists. +deleteCurrentUserMessage=Cannot delete currently logged in user. +deleteUsernameExistsMessage=The username does not exist and cannot be deleted. ############### @@ -147,8 +149,10 @@ adminUserSettings.roles=Roles adminUserSettings.role=Role adminUserSettings.actions=Actions adminUserSettings.apiUser=Limited API User +adminUserSettings.extraApiUser=Additional Limited API User adminUserSettings.webOnlyUser=Web Only User adminUserSettings.demoUser=Demo User (No custom settings) +adminUserSettings.internalApiUser=Internal API User adminUserSettings.forceChange=Force user to change username/password on login adminUserSettings.submit=Save User diff --git a/src/main/resources/messages_ru_RU.properties b/src/main/resources/messages_ru_RU.properties index 1cfa3446..358feb20 100644 --- a/src/main/resources/messages_ru_RU.properties +++ b/src/main/resources/messages_ru_RU.properties @@ -53,6 +53,8 @@ notAuthenticatedMessage=User not authenticated. userNotFoundMessage=User not found. incorrectPasswordMessage=Current password is incorrect. usernameExistsMessage=New Username already exists. +deleteCurrentUserMessage=Cannot delete currently logged in user. +deleteUsernameExistsMessage=The username does not exist and cannot be deleted. ############### @@ -147,8 +149,10 @@ adminUserSettings.roles=Roles adminUserSettings.role=Role adminUserSettings.actions=Actions adminUserSettings.apiUser=Limited API User +adminUserSettings.extraApiUser=Additional Limited API User adminUserSettings.webOnlyUser=Web Only User adminUserSettings.demoUser=Demo User (No custom settings) +adminUserSettings.internalApiUser=Internal API User adminUserSettings.forceChange=Force user to change username/password on login adminUserSettings.submit=Save User diff --git a/src/main/resources/messages_sr_LATN_RS.properties b/src/main/resources/messages_sr_LATN_RS.properties index 23ef0f5a..09740797 100644 --- a/src/main/resources/messages_sr_LATN_RS.properties +++ b/src/main/resources/messages_sr_LATN_RS.properties @@ -53,6 +53,8 @@ notAuthenticatedMessage=Korisnik nije autentifikovan. userNotFoundMessage=Korisnik nije pronađen. incorrectPasswordMessage=Trenutna šifra je netačna. usernameExistsMessage=Novi korisnik već postoji +deleteCurrentUserMessage=Cannot delete currently logged in user. +deleteUsernameExistsMessage=The username does not exist and cannot be deleted. ############### @@ -147,8 +149,10 @@ adminUserSettings.roles=Uloge adminUserSettings.role=Uloga adminUserSettings.actions=Akcije adminUserSettings.apiUser=Korisnik s ograničenim API pristupom +adminUserSettings.extraApiUser=Additional Limited API User adminUserSettings.webOnlyUser=Korisnik samo za web adminUserSettings.demoUser=Demo korisnik (Bez prilagođenih podešavanja) +adminUserSettings.internalApiUser=Internal API User adminUserSettings.forceChange=Prisili korisnika da promeni korisničko ime/lozinku pri prijavi adminUserSettings.submit=Sačuvaj korisnika diff --git a/src/main/resources/messages_sv_SE.properties b/src/main/resources/messages_sv_SE.properties index 9c91ba5f..291f657a 100644 --- a/src/main/resources/messages_sv_SE.properties +++ b/src/main/resources/messages_sv_SE.properties @@ -53,6 +53,8 @@ notAuthenticatedMessage=User not authenticated. userNotFoundMessage=User not found. incorrectPasswordMessage=Current password is incorrect. usernameExistsMessage=New Username already exists. +deleteCurrentUserMessage=Cannot delete currently logged in user. +deleteUsernameExistsMessage=The username does not exist and cannot be deleted. ############### @@ -147,8 +149,10 @@ adminUserSettings.roles=Roles adminUserSettings.role=Role adminUserSettings.actions=Actions adminUserSettings.apiUser=Limited API User +adminUserSettings.extraApiUser=Additional Limited API User adminUserSettings.webOnlyUser=Web Only User adminUserSettings.demoUser=Demo User (No custom settings) +adminUserSettings.internalApiUser=Internal API User adminUserSettings.forceChange=Force user to change username/password on login adminUserSettings.submit=Save User diff --git a/src/main/resources/messages_tr_TR.properties b/src/main/resources/messages_tr_TR.properties index 7cf805e7..7b1fdefb 100644 --- a/src/main/resources/messages_tr_TR.properties +++ b/src/main/resources/messages_tr_TR.properties @@ -53,6 +53,8 @@ notAuthenticatedMessage=Kullanıcı doğrulanmadı. userNotFoundMessage=Kullanıcı bulunamadı. incorrectPasswordMessage=Mevcut şifre yanlış. usernameExistsMessage=Yeni Kullanıcı Adı zaten var. +deleteCurrentUserMessage=Cannot delete currently logged in user. +deleteUsernameExistsMessage=The username does not exist and cannot be deleted. ############### @@ -147,8 +149,10 @@ adminUserSettings.roles=Roller adminUserSettings.role=Rol adminUserSettings.actions=Eylemler adminUserSettings.apiUser=Sınırlı API Kullanıcısı +adminUserSettings.extraApiUser=Additional Limited API User adminUserSettings.webOnlyUser=Sadece Web Kullanıcısı adminUserSettings.demoUser=Demo User (No custom settings) +adminUserSettings.internalApiUser=Internal API User adminUserSettings.forceChange=Kullanıcının girişte kullanıcı adı/şifre değiştirmesini zorla adminUserSettings.submit=Kullanıcıyı Kaydet diff --git a/src/main/resources/messages_zh_CN.properties b/src/main/resources/messages_zh_CN.properties index 9e68c4e6..80f0098a 100644 --- a/src/main/resources/messages_zh_CN.properties +++ b/src/main/resources/messages_zh_CN.properties @@ -53,6 +53,8 @@ notAuthenticatedMessage=用户未经过身份验证。 userNotFoundMessage=未找到用户。 incorrectPasswordMessage=当前密码不正确。 usernameExistsMessage=新用户名已存在。 +deleteCurrentUserMessage=Cannot delete currently logged in user. +deleteUsernameExistsMessage=The username does not exist and cannot be deleted. ############### @@ -147,8 +149,10 @@ adminUserSettings.roles=角色 adminUserSettings.role=角色 adminUserSettings.actions=操作 adminUserSettings.apiUser=有限 API 用户 +adminUserSettings.extraApiUser=Additional Limited API User adminUserSettings.webOnlyUser=仅限 Web 用户 adminUserSettings.demoUser=Demo User (No custom settings) +adminUserSettings.internalApiUser=Internal API User adminUserSettings.forceChange=强制用户在登录时更改用户名/密码 adminUserSettings.submit=保存用户 diff --git a/src/main/resources/messages_zh_TW.properties b/src/main/resources/messages_zh_TW.properties index 1896d9e1..75001bf1 100644 --- a/src/main/resources/messages_zh_TW.properties +++ b/src/main/resources/messages_zh_TW.properties @@ -53,6 +53,8 @@ notAuthenticatedMessage=使用者未認證。 userNotFoundMessage=找不到使用者。 incorrectPasswordMessage=目前密碼不正確。 usernameExistsMessage=新使用者名稱已存在。 +deleteCurrentUserMessage=Cannot delete currently logged in user. +deleteUsernameExistsMessage=The username does not exist and cannot be deleted. ############### @@ -147,8 +149,10 @@ adminUserSettings.roles=角色 adminUserSettings.role=角色 adminUserSettings.actions=操作 adminUserSettings.apiUser=受限制的 API 使用者 +adminUserSettings.extraApiUser=Additional Limited API User adminUserSettings.webOnlyUser=僅使用網頁的使用者 adminUserSettings.demoUser=示範用途的使用者(無自訂設定) +adminUserSettings.internalApiUser=Internal API User adminUserSettings.forceChange=強制使用者在登入時修改使用者名稱/密碼 adminUserSettings.submit=儲存 diff --git a/src/main/resources/templates/addUsers.html b/src/main/resources/templates/addUsers.html index f5e5e87d..5e4f5f68 100644 --- a/src/main/resources/templates/addUsers.html +++ b/src/main/resources/templates/addUsers.html @@ -16,6 +16,10 @@

Admin User Control Settings

+
+ Cannot delete currently logged in user. + The username does not exist and cannot be deleted. +
@@ -27,7 +31,7 @@ - +
@@ -53,11 +57,7 @@