From 1a151468eccddab6e46a00a9114cee3f5815536a Mon Sep 17 00:00:00 2001 From: Jatc251 Date: Fri, 30 Aug 2024 18:38:20 +1000 Subject: [PATCH 1/3] Make webregister command easier to comprehend --- .../src/main/java/org/dynmap/WebAuthManager.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DynmapCore/src/main/java/org/dynmap/WebAuthManager.java b/DynmapCore/src/main/java/org/dynmap/WebAuthManager.java index 6983b925..6b7eb76b 100644 --- a/DynmapCore/src/main/java/org/dynmap/WebAuthManager.java +++ b/DynmapCore/src/main/java/org/dynmap/WebAuthManager.java @@ -182,36 +182,36 @@ public class WebAuthManager { boolean other = false; if(args.length > 1) { if(!core.checkPlayerPermission(sender, "webregister.other")) { - sender.sendMessage("Not authorized to set web login information for other players"); + sender.sendMessage("You're not authorised to access web registration info for other players"); return true; } uid = args[1]; other = true; } else if (player == null) { /* Console? */ - sender.sendMessage("Must provide user ID to register web login"); + sender.sendMessage("Must provide username to access web registration info"); return true; } else { uid = player.getName(); } if (checkUserName(uid) == false) { - sender.sendMessage("Invalid user ID"); + sender.sendMessage("Invalid username. Did you type it correctly?"); return true; } String regkey = String.format("%04d-%04d", rnd.nextInt(10000), rnd.nextInt(10000)); pending_registrations.put(uid.toLowerCase(), regkey.toLowerCase()); - sender.sendMessage("Registration pending for user ID: " + uid); + sender.sendMessage("Registration pending for username: " + uid); sender.sendMessage("Registration code: " + regkey); publicRegistrationURL = core.configuration.getString("publicURL", "index.html"); - sender.sendMessage("Enter ID and code on registration web page (" + publicRegistrationURL.toString() + ") to complete registration"); + sender.sendMessage("Enter username and registration code when prompted on web page (" + publicRegistrationURL.toString() + ") to complete registration"); if(other) { DynmapPlayer p = core.getServer().getPlayer(uid); if(p != null) { p.sendMessage("The registration of your account for web access has been started."); p.sendMessage("To complete the process, access the Login page on the Dynmap map"); p.sendMessage("Registration code: " + regkey); - p.sendMessage("The user ID must match your account ID, but the password should NOT be the same."); + p.sendMessage("Enter your username and registration code when prompted on web page (" + publicRegistrationURL.toString() + ") to complete registration"); } } core.events.trigger("loginupdated", null); From 17c5af35e41e4695fd4f77e8d820099a1ed05394 Mon Sep 17 00:00:00 2001 From: Jatc251 Date: Fri, 30 Aug 2024 18:42:26 +1000 Subject: [PATCH 2/3] Don't send personalised information to sender --- DynmapCore/src/main/java/org/dynmap/WebAuthManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DynmapCore/src/main/java/org/dynmap/WebAuthManager.java b/DynmapCore/src/main/java/org/dynmap/WebAuthManager.java index 6b7eb76b..41c2fe2f 100644 --- a/DynmapCore/src/main/java/org/dynmap/WebAuthManager.java +++ b/DynmapCore/src/main/java/org/dynmap/WebAuthManager.java @@ -207,7 +207,7 @@ public class WebAuthManager { sender.sendMessage("Enter username and registration code when prompted on web page (" + publicRegistrationURL.toString() + ") to complete registration"); if(other) { DynmapPlayer p = core.getServer().getPlayer(uid); - if(p != null) { + if(p != null && sender != p) { p.sendMessage("The registration of your account for web access has been started."); p.sendMessage("To complete the process, access the Login page on the Dynmap map"); p.sendMessage("Registration code: " + regkey); From 4f362a5c3fc9c861d3fca78e98faee1d96e1578c Mon Sep 17 00:00:00 2001 From: Jatc251 Date: Fri, 30 Aug 2024 18:47:05 +1000 Subject: [PATCH 3/3] Update login.html --- DynmapCore/src/main/resources/extracted/web/login.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DynmapCore/src/main/resources/extracted/web/login.html b/DynmapCore/src/main/resources/extracted/web/login.html index b2964e9b..6ddfcff5 100644 --- a/DynmapCore/src/main/resources/extracted/web/login.html +++ b/DynmapCore/src/main/resources/extracted/web/login.html @@ -62,11 +62,11 @@

-Enter user ID and password: +Enter username and password:

- +
User ID
Username
Password

@@ -80,11 +80,11 @@ Enter user ID and password:

-Run '/dynmap webregister' and enter returned registration code, along with userid and password: +Run '/dynmap webregister' and enter your username and registration code, and create a password:

- +
User ID
Username
Password
Verify Password
Registration Code