geforkt von SteamWar/BungeeCore
Commits vergleichen
5 Commits
master
...
tokens-com
Autor | SHA1 | Datum | |
---|---|---|---|
a5bbe63ebf | |||
a2ce616dbb | |||
53249cec61 | |||
18dfcf5025 | |||
b024d24a93 |
@ -1 +1 @@
|
||||
Subproject commit e664c6cf4e3e9a056918cf15030c247e7bc6fe19
|
||||
Subproject commit 9a3630b07cb870266669ba120985a2c0a8ebbf5c
|
@ -21,11 +21,11 @@ package de.steamwar.bungeecore.commands;
|
||||
|
||||
import de.steamwar.command.SWCommand;
|
||||
import de.steamwar.messages.ChatSender;
|
||||
import de.steamwar.sql.SteamwarUser;
|
||||
import de.steamwar.sql.Token;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
public class WebpasswordCommand extends SWCommand {
|
||||
|
||||
@ -41,25 +41,12 @@ public class WebpasswordCommand extends SWCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
ProcessBuilder pb = new ProcessBuilder("php", "/var/www/register.php", player.getName(), password);
|
||||
pb.redirectErrorStream(true);
|
||||
try {
|
||||
Process regProcess = pb.start();
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(regProcess.getInputStream()));
|
||||
String errorLine;
|
||||
if((errorLine = reader.readLine()) != null) {
|
||||
if ("updated".equals(errorLine)) {
|
||||
ChatSender.of(player).system("WEB_UPDATED");
|
||||
return;
|
||||
} else {
|
||||
throw new SecurityException("Could not create webaccount " + errorLine);
|
||||
}
|
||||
}
|
||||
SteamwarUser user = SteamwarUser.get(player.getUniqueId());
|
||||
user.setPassword(password);
|
||||
|
||||
ChatSender.of(player).system("WEB_CREATED");
|
||||
} catch (IOException e) {
|
||||
throw new SecurityException("Could not create webaccount", e);
|
||||
}
|
||||
Token.listUser(user).stream().filter(token -> token.getName().startsWith("Website: ")).forEach(token -> token.delete());
|
||||
|
||||
ChatSender.of(player).system("WEB_UPDATED");
|
||||
}
|
||||
|
||||
public static void changeUsername(String oldUsername, String newUsername){
|
||||
|
@ -657,4 +657,4 @@ ADVENT_CALENDAR_TITLE=§eAdventskalender
|
||||
ADVENT_CALENDAR_DAY=§7Tag§8: §e{0}
|
||||
ADVENT_CALENDAR_MESSAGE=§eHast du heute schon dein Geschenk geholt?
|
||||
ADVENT_CALENDAR_MESSAGE_HOVER=§eKlicken zum öffnen!
|
||||
ADVENT_CALENDAR_OPEN=§7Du hast §e{0}§7 aus dem Adventskalender erhalten!
|
||||
ADVENT_CALENDAR_OPEN=§7Du hast §e{0}§7 aus dem Adventskalender erhalten!
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren