geforkt von SteamWar/BungeeCore
Merge branch 'usernameChanger' of SteamWar/BungeeCore into master
Dieser Commit ist enthalten in:
Commit
2e7c326613
@ -61,4 +61,13 @@ public class WebregisterCommand extends BasicCommand {
|
||||
throw new SecurityException("Could not create webaccount", e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void changeUsername(String oldUsername, String newUsername){
|
||||
ProcessBuilder pb = new ProcessBuilder("php", "/var/www/changename.php", oldUsername, newUsername);
|
||||
try {
|
||||
pb.start();
|
||||
} catch (IOException e) {
|
||||
throw new SecurityException("Could not change username", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package de.steamwar.bungeecore.sql;
|
||||
|
||||
import de.steamwar.bungeecore.BungeeCore;
|
||||
import de.steamwar.bungeecore.commands.WebregisterCommand;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.md_5.bungee.api.connection.PendingConnection;
|
||||
@ -53,6 +54,7 @@ public class SteamwarUser {
|
||||
String userName = connection.getName();
|
||||
if(!user.userName.equals(userName)){
|
||||
SQL.update("UPDATE UserData SET UserName = ? WHERE id = ?", userName, user.id);
|
||||
WebregisterCommand.changeUsername(user.userName, userName);
|
||||
user.userName = userName;
|
||||
}
|
||||
}else{
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren