Skip to content

Commit 89fbc21

Browse files
authored
Merge pull request #4154 from Jatc252/userid-to-username
Make webregister command a bit nicer
2 parents 17773c9 + 4f362a5 commit 89fbc21

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

DynmapCore/src/main/java/org/dynmap/WebAuthManager.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -182,36 +182,36 @@ public boolean processWebRegisterCommand(DynmapCore core, DynmapCommandSender se
182182
boolean other = false;
183183
if(args.length > 1) {
184184
if(!core.checkPlayerPermission(sender, "webregister.other")) {
185-
sender.sendMessage("Not authorized to set web login information for other players");
185+
sender.sendMessage("You're not authorised to access web registration info for other players");
186186
return true;
187187
}
188188
uid = args[1];
189189
other = true;
190190
}
191191
else if (player == null) { /* Console? */
192-
sender.sendMessage("Must provide user ID to register web login");
192+
sender.sendMessage("Must provide username to access web registration info");
193193
return true;
194194
}
195195
else {
196196
uid = player.getName();
197197
}
198198
if (checkUserName(uid) == false) {
199-
sender.sendMessage("Invalid user ID");
199+
sender.sendMessage("Invalid username. Did you type it correctly?");
200200
return true;
201201
}
202202
String regkey = String.format("%04d-%04d", rnd.nextInt(10000), rnd.nextInt(10000));
203203
pending_registrations.put(uid.toLowerCase(), regkey.toLowerCase());
204-
sender.sendMessage("Registration pending for user ID: " + uid);
204+
sender.sendMessage("Registration pending for username: " + uid);
205205
sender.sendMessage("Registration code: " + regkey);
206206
publicRegistrationURL = core.configuration.getString("publicURL", "index.html");
207-
sender.sendMessage("Enter ID and code on registration web page (" + publicRegistrationURL.toString() + ") to complete registration");
207+
sender.sendMessage("Enter username and registration code when prompted on web page (" + publicRegistrationURL.toString() + ") to complete registration");
208208
if(other) {
209209
DynmapPlayer p = core.getServer().getPlayer(uid);
210-
if(p != null) {
210+
if(p != null && sender != p) {
211211
p.sendMessage("The registration of your account for web access has been started.");
212212
p.sendMessage("To complete the process, access the Login page on the Dynmap map");
213213
p.sendMessage("Registration code: " + regkey);
214-
p.sendMessage("The user ID must match your account ID, but the password should NOT be the same.");
214+
p.sendMessage("Enter your username and registration code when prompted on web page (" + publicRegistrationURL.toString() + ") to complete registration");
215215
}
216216
}
217217
core.events.trigger("loginupdated", null);

DynmapCore/src/main/resources/extracted/web/login.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ <h2>Minecraft Dynamic Map - Login/Register</h2>
6262
<tr><td class='login'>
6363
<FORM METHOD=POST name=login ACTION="up/login">
6464
<p>
65-
Enter user ID and password:
65+
Enter username and password:
6666
<BR>
6767
<BR>
6868
<table>
69-
<tr><td>User ID</td><td><input type="text" size="20" name="j_username"></td></tr>
69+
<tr><td>Username</td><td><input type="text" size="20" name="j_username"></td></tr>
7070
<tr><td>Password</td><td><input type="password" size="20" name="j_password"></td></tr>
7171
</table>
7272
<BR>
@@ -80,11 +80,11 @@ <h2>Minecraft Dynamic Map - Login/Register</h2>
8080
<td class='register'>
8181
<FORM METHOD=POST name=register ACTION="up/register">
8282
<p>
83-
Run '/dynmap webregister' and enter returned registration code, along with userid and password:
83+
Run '/dynmap webregister' and enter your username and registration code, and create a password:
8484
<BR>
8585
<BR>
8686
<table>
87-
<tr><td>User ID</td><td><input type="text" size="20" name="j_username"></td></tr>
87+
<tr><td>Username</td><td><input type="text" size="20" name="j_username"></td></tr>
8888
<tr><td>Password</td><td><input type="password" size="20" name="j_password"></td></tr>
8989
<tr><td>Verify Password</td><td><input type="password" size="20" name="j_verify_password"></td></tr>
9090
<tr><td>Registration Code</td><td><input type="text" size="20" name="j_passcode"></td></tr>

0 commit comments

Comments
 (0)