geforkt von SteamWar/BungeeCore
Change username on website with username change
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
552e0f3aed
Commit
1d1c8baf43
@ -61,4 +61,13 @@ public class WebregisterCommand extends BasicCommand {
|
|||||||
throw new SecurityException("Could not create webaccount", e);
|
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;
|
package de.steamwar.bungeecore.sql;
|
||||||
|
|
||||||
import de.steamwar.bungeecore.BungeeCore;
|
import de.steamwar.bungeecore.BungeeCore;
|
||||||
|
import de.steamwar.bungeecore.commands.WebregisterCommand;
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
import net.md_5.bungee.api.connection.PendingConnection;
|
import net.md_5.bungee.api.connection.PendingConnection;
|
||||||
@ -53,6 +54,7 @@ public class SteamwarUser {
|
|||||||
String userName = connection.getName();
|
String userName = connection.getName();
|
||||||
if(!user.userName.equals(userName)){
|
if(!user.userName.equals(userName)){
|
||||||
SQL.update("UPDATE UserData SET UserName = ? WHERE id = ?", userName, user.id);
|
SQL.update("UPDATE UserData SET UserName = ? WHERE id = ?", userName, user.id);
|
||||||
|
WebregisterCommand.changeUsername(user.userName, userName);
|
||||||
user.userName = userName;
|
user.userName = userName;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren