Started using player UUID instead of name in URLs

- Changed instances where player name was given in a link instead of UUID where possible
  - Could not change for Extensions where "isPlayerName=true" is set for String data, the UUID is
    not available from the query

- Changed 404 error message to have '/player/{uuid/name}' instead of '/player/PlayerName'
- Changed export directory from names to uuids, change log should recommend export users to clear
  their player directory and to run /plan export players
- Fixed issue where Web users with level 2 could not access their own player page via /player/{uuid}

Affects issues:
- Close #1841
This commit is contained in:
Risto Lahtela 2021-04-15 10:13:32 +03:00
parent 1bded295e2
commit d1e00da51a
21 changed files with 55 additions and 35 deletions

View File

@ -32,7 +32,6 @@ import com.djrapitops.plan.settings.locale.lang.CommandLang;
import com.djrapitops.plan.storage.database.DBSystem; import com.djrapitops.plan.storage.database.DBSystem;
import com.djrapitops.plan.storage.database.Database; import com.djrapitops.plan.storage.database.Database;
import com.djrapitops.plan.storage.database.queries.objects.ServerQueries; import com.djrapitops.plan.storage.database.queries.objects.ServerQueries;
import com.djrapitops.plan.storage.database.queries.objects.UserIdentifierQueries;
import com.djrapitops.plan.storage.database.queries.objects.WebUserQueries; import com.djrapitops.plan.storage.database.queries.objects.WebUserQueries;
import javax.inject.Inject; import javax.inject.Inject;
@ -158,11 +157,8 @@ public class LinkCommands {
throw new IllegalArgumentException(locale.getString(CommandLang.FAIL_PLAYER_NOT_FOUND, identifier)); throw new IllegalArgumentException(locale.getString(CommandLang.FAIL_PLAYER_NOT_FOUND, identifier));
} }
String playerName = dbSystem.getDatabase().query(UserIdentifierQueries.fetchPlayerNameOf(playerUUID))
.orElseThrow(() -> new IllegalArgumentException(locale.getString(CommandLang.FAIL_PLAYER_NOT_FOUND_REGISTER, identifier)));
if (sender.hasPermission(Permissions.PLAYER_OTHER) || playerUUID.equals(senderUUID)) { if (sender.hasPermission(Permissions.PLAYER_OTHER) || playerUUID.equals(senderUUID)) {
String address = getAddress(sender) + "/player/" + Html.encodeToURL(playerName); String address = getAddress(sender) + "/player/" + playerUUID;
sender.buildMessage() sender.buildMessage()
.addPart(colors.getMainColor() + locale.getString(CommandLang.LINK_PLAYER)) .addPart(colors.getMainColor() + locale.getString(CommandLang.LINK_PLAYER))
.apply(builder -> linkTo(builder, sender, address)) .apply(builder -> linkTo(builder, sender, address))
@ -240,11 +236,8 @@ public class LinkCommands {
throw new IllegalArgumentException(locale.getString(CommandLang.FAIL_PLAYER_NOT_FOUND, identifier)); throw new IllegalArgumentException(locale.getString(CommandLang.FAIL_PLAYER_NOT_FOUND, identifier));
} }
String playerName = dbSystem.getDatabase().query(UserIdentifierQueries.fetchPlayerNameOf(playerUUID))
.orElseThrow(() -> new IllegalArgumentException(locale.getString(CommandLang.FAIL_PLAYER_NOT_FOUND_REGISTER, identifier)));
if (sender.hasPermission(Permissions.JSON_OTHER) || playerUUID.equals(senderUUID)) { if (sender.hasPermission(Permissions.JSON_OTHER) || playerUUID.equals(senderUUID)) {
String address = getAddress(sender) + "/player/" + Html.encodeToURL(playerName) + "/raw"; String address = getAddress(sender) + "/player/" + playerUUID + "/raw";
sender.buildMessage() sender.buildMessage()
.addPart(colors.getMainColor() + locale.getString(CommandLang.LINK_JSON)) .addPart(colors.getMainColor() + locale.getString(CommandLang.LINK_JSON))
.apply(builder -> linkTo(builder, sender, address)) .apply(builder -> linkTo(builder, sender, address))

View File

@ -91,8 +91,8 @@ public class PlayerPageExporter extends FileExporter {
exportPaths.put("../server/", toRelativePathFromRoot("server")); exportPaths.put("../server/", toRelativePathFromRoot("server"));
exportRequiredResources(exportPaths, toDirectory); exportRequiredResources(exportPaths, toDirectory);
Path playerDirectory = toDirectory.resolve("player/" + toFileName(playerName)); Path playerDirectory = toDirectory.resolve("player/" + toFileName(playerUUID.toString()));
exportJSON(exportPaths, playerDirectory, playerUUID, playerName); exportJSON(exportPaths, playerDirectory, playerUUID);
exportHtml(exportPaths, playerDirectory, playerUUID); exportHtml(exportPaths, playerDirectory, playerUUID);
exportPaths.clear(); exportPaths.clear();
} }
@ -108,11 +108,11 @@ public class PlayerPageExporter extends FileExporter {
} }
} }
private void exportJSON(ExportPaths exportPaths, Path toDirectory, UUID playerUUID, String playerName) throws IOException { private void exportJSON(ExportPaths exportPaths, Path toDirectory, UUID playerUUID) throws IOException {
exportJSON(exportPaths, toDirectory, "player?player=" + playerUUID, playerName); exportJSON(exportPaths, toDirectory, "player?player=" + playerUUID);
} }
private void exportJSON(ExportPaths exportPaths, Path toDirectory, String resource, String playerName) throws IOException { private void exportJSON(ExportPaths exportPaths, Path toDirectory, String resource) throws IOException {
Optional<Response> found = getJSONResponse(resource); Optional<Response> found = getJSONResponse(resource);
if (!found.isPresent()) { if (!found.isPresent()) {
throw new NotFoundException(resource + " was not properly exported: no response"); throw new NotFoundException(resource + " was not properly exported: no response");
@ -201,7 +201,7 @@ public class PlayerPageExporter extends FileExporter {
} }
private String toRelativePathFromRoot(String resourceName) { private String toRelativePathFromRoot(String resourceName) {
// Player html is exported at /player/<name>/index.html // Player html is exported at /player/<uuid>/index.html
return "../../" + toNonRelativePath(resourceName); return "../../" + toNonRelativePath(resourceName);
} }

View File

@ -122,7 +122,7 @@ public class PlayersTableJSONCreator {
private void addPlayerData(Map<String, Object> dataJson, TablePlayer player) { private void addPlayerData(Map<String, Object> dataJson, TablePlayer player) {
String name = player.getName().orElse(player.getPlayerUUID().toString()); String name = player.getName().orElse(player.getPlayerUUID().toString());
String url = "../player/" + Html.encodeToURL(name); String url = "../player/" + Html.encodeToURL(player.getPlayerUUID().toString());
int loginTimes = player.getSessionCount().orElse(0); int loginTimes = player.getSessionCount().orElse(0);
long activePlaytime = player.getActivePlaytime().orElse(-1L); long activePlaytime = player.getActivePlaytime().orElse(-1L);

View File

@ -55,7 +55,11 @@ public class PlayerPageResolver implements Resolver {
public boolean canAccess(Request request) { public boolean canAccess(Request request) {
URIPath path = request.getPath(); URIPath path = request.getPath();
WebUser user = request.getUser().orElse(new WebUser("")); WebUser user = request.getUser().orElse(new WebUser(""));
boolean isOwnPage = path.getPart(1).map(user.getName()::equalsIgnoreCase).orElse(true); boolean isOwnPage = path.getPart(1).map(nameOrUUID -> {
if (user.getName().equalsIgnoreCase(nameOrUUID)) return true; // name matches user
return uuidUtility.getNameOf(nameOrUUID).map(user.getName()::equalsIgnoreCase) // uuid matches user
.orElse(false); // uuid or name don't match
}).orElse(true); // No name or UUID given
return user.hasPermission("page.player.other") || (user.hasPermission("page.player.self") && isOwnPage); return user.hasPermission("page.player.other") || (user.hasPermission("page.player.self") && isOwnPage);
} }
@ -79,8 +83,8 @@ public class PlayerPageResolver implements Resolver {
} }
if (path.getPart(2).isPresent()) { if (path.getPart(2).isPresent()) {
// Redirect /player/Name/ to /player/Name // Redirect /player/{uuid/name}/ to /player/{uuid}
return responseFactory.redirectResponse("../" + Html.encodeToURL(playerName)); return responseFactory.redirectResponse("../" + Html.encodeToURL(playerUUID.toString()));
} }
return responseFactory.playerPageResponse(playerUUID); return responseFactory.playerPageResponse(playerUUID);
} }

View File

@ -57,6 +57,19 @@ public class UUIDUtility {
} }
} }
public Optional<String> getNameOf(String possiblePlayerUUID) {
try {
return getNameOf(UUID.fromString(possiblePlayerUUID));
} catch (IllegalArgumentException notUUID) {
return Optional.empty();
}
}
public Optional<String> getNameOf(UUID playerUUID) {
if (playerUUID == null) throw new IllegalArgumentException("Player uuid can not be null!");
return dbSystem.getDatabase().query(UserIdentifierQueries.fetchPlayerNameOf(playerUUID));
}
/** /**
* Get UUID of a player. * Get UUID of a player.
* *

View File

@ -25,7 +25,7 @@ public enum ErrorPageLang implements Lang {
UUID_404("Player UUID was not found in the database."), UUID_404("Player UUID was not found in the database."),
NO_SERVERS_404("No Servers online to perform the request."), NO_SERVERS_404("No Servers online to perform the request."),
NOT_PLAYED_404("Plan has not seen this player."), NOT_PLAYED_404("Plan has not seen this player."),
UNKNOWN_PAGE_404("Make sure you're accessing a link given by a command, Examples:</p><p>/player/PlayerName<br>/server/ServerName</p>"), UNKNOWN_PAGE_404("Make sure you're accessing a link given by a command, Examples:</p><p>/player/{uuid/name}<br>/server/{uuid/name/id}</p>"),
UNAUTHORIZED_401("Unauthorized"), UNAUTHORIZED_401("Unauthorized"),
AUTHENTICATION_FAILED_401("Authentication Failed."), AUTHENTICATION_FAILED_401("Authentication Failed."),
AUTH_FAIL_TIPS_401("- Ensure you have registered a user with <b>/plan register</b><br>- Check that the username and password are correct<br>- Username and password are case-sensitive<br><br>If you have forgotten your password, ask a staff member to delete your old user and re-register."), AUTH_FAIL_TIPS_401("- Ensure you have registered a user with <b>/plan register</b><br>- Check that the username and password are correct<br>- Username and password are case-sensitive<br><br>If you have forgotten your password, ask a staff member to delete your old user and re-register."),

View File

@ -448,7 +448,7 @@ HTML ERRORS - NOT_FOUND_404 || Nenalezeno
HTML ERRORS - NOT_PLAYED_404 || Hráč nebyl nenalezen. HTML ERRORS - NOT_PLAYED_404 || Hráč nebyl nenalezen.
HTML ERRORS - PAGE_NOT_FOUND_404 || Stránka neexistuje. HTML ERRORS - PAGE_NOT_FOUND_404 || Stránka neexistuje.
HTML ERRORS - UNAUTHORIZED_401 || Neautorizováno HTML ERRORS - UNAUTHORIZED_401 || Neautorizováno
HTML ERRORS - UNKNOWN_PAGE_404 || Ujistěte se, že přistupujete na odkaz poskytnutý příkazem, Příklad:</p><p>/player/PlayerName<br>/server/ServerName</p> HTML ERRORS - UNKNOWN_PAGE_404 || Ujistěte se, že přistupujete na odkaz poskytnutý příkazem, Příklad:</p><p>/player/{uuid/name}<br>/server/{uuid/name/id}</p>
HTML ERRORS - UUID_404 || Hráčské UUID nebylo nalezeno v databázi. HTML ERRORS - UUID_404 || Hráčské UUID nebylo nalezeno v databázi.
In Depth Help - /plan db || Použít jiné subpříkazy databáze ke změně dat In Depth Help - /plan db || Použít jiné subpříkazy databáze ke změně dat
In Depth Help - /plan db backup || Použití SQLite k zálohování cílové databáze do souboru. In Depth Help - /plan db backup || Použití SQLite k zálohování cílové databáze do souboru.

View File

@ -448,7 +448,7 @@ HTML ERRORS - NOT_FOUND_404 || Nicht gefunden.
HTML ERRORS - NOT_PLAYED_404 || Der Spieler war nie auf dem Server. HTML ERRORS - NOT_PLAYED_404 || Der Spieler war nie auf dem Server.
HTML ERRORS - PAGE_NOT_FOUND_404 || Diese Seite existiert nicht. HTML ERRORS - PAGE_NOT_FOUND_404 || Diese Seite existiert nicht.
HTML ERRORS - UNAUTHORIZED_401 || Unautorisiert HTML ERRORS - UNAUTHORIZED_401 || Unautorisiert
HTML ERRORS - UNKNOWN_PAGE_404 || Stelle sicher, dass du einen Link benutzt, der von einem Befehl generiert wurde. Beispielsweise:</p><p>/player/PlayerName<br>/server/ServerName</p> HTML ERRORS - UNKNOWN_PAGE_404 || Stelle sicher, dass du einen Link benutzt, der von einem Befehl generiert wurde. Beispielsweise:</p><p>/player/{uuid/name}<br>/server/{uuid/name/id}</p>
HTML ERRORS - UUID_404 || Die UUID des Spielers wurde nicht in der Datenbank gefunden. HTML ERRORS - UUID_404 || Die UUID des Spielers wurde nicht in der Datenbank gefunden.
In Depth Help - /plan db || Use different database subcommands to change the data in some way In Depth Help - /plan db || Use different database subcommands to change the data in some way
In Depth Help - /plan db backup || Uses SQLite to backup the target database to a file. In Depth Help - /plan db backup || Uses SQLite to backup the target database to a file.

View File

@ -448,7 +448,7 @@ HTML ERRORS - NOT_FOUND_404 || Not Found
HTML ERRORS - NOT_PLAYED_404 || Plan has not seen this player. HTML ERRORS - NOT_PLAYED_404 || Plan has not seen this player.
HTML ERRORS - PAGE_NOT_FOUND_404 || Page does not exist. HTML ERRORS - PAGE_NOT_FOUND_404 || Page does not exist.
HTML ERRORS - UNAUTHORIZED_401 || Unauthorized HTML ERRORS - UNAUTHORIZED_401 || Unauthorized
HTML ERRORS - UNKNOWN_PAGE_404 || Make sure you're accessing a link given by a command, Examples:</p><p>/player/PlayerName<br>/server/ServerName</p> HTML ERRORS - UNKNOWN_PAGE_404 || Make sure you're accessing a link given by a command, Examples:</p><p>/player/{uuid/name}<br>/server/{uuid/name/id}</p>
HTML ERRORS - UUID_404 || Player UUID was not found in the database. HTML ERRORS - UUID_404 || Player UUID was not found in the database.
In Depth Help - /plan db || Use different database subcommands to change the data in some way In Depth Help - /plan db || Use different database subcommands to change the data in some way
In Depth Help - /plan db backup || Uses SQLite to backup the target database to a file. In Depth Help - /plan db backup || Uses SQLite to backup the target database to a file.

View File

@ -448,7 +448,7 @@ HTML ERRORS - NOT_FOUND_404 || No encontrado
HTML ERRORS - NOT_PLAYED_404 || Ese jugador no ha jugado en este servidor. HTML ERRORS - NOT_PLAYED_404 || Ese jugador no ha jugado en este servidor.
HTML ERRORS - PAGE_NOT_FOUND_404 || La pagina no existe. HTML ERRORS - PAGE_NOT_FOUND_404 || La pagina no existe.
HTML ERRORS - UNAUTHORIZED_401 || No autorizado HTML ERRORS - UNAUTHORIZED_401 || No autorizado
HTML ERRORS - UNKNOWN_PAGE_404 || Asegurate que estas entrando por un link dado por un comando, Ejemplos:</p><p>/player/NombreJugador<br>/server/NombreServidor</p> HTML ERRORS - UNKNOWN_PAGE_404 || Asegurate que estas entrando por un link dado por un comando, Ejemplos:</p><p>/player/{uuid/nombre}<br>/server/{uuid/nombre/id}</p>
HTML ERRORS - UUID_404 || La UUID del jugador no ha sido encontrada. HTML ERRORS - UUID_404 || La UUID del jugador no ha sido encontrada.
In Depth Help - /plan db || Use different database subcommands to change the data in some way In Depth Help - /plan db || Use different database subcommands to change the data in some way
In Depth Help - /plan db backup || Uses SQLite to backup the target database to a file. In Depth Help - /plan db backup || Uses SQLite to backup the target database to a file.

View File

@ -448,7 +448,7 @@ HTML ERRORS - NOT_FOUND_404 || Ei löytynyt
HTML ERRORS - NOT_PLAYED_404 || Pelaaja ei ole pelannut palvelimella. HTML ERRORS - NOT_PLAYED_404 || Pelaaja ei ole pelannut palvelimella.
HTML ERRORS - PAGE_NOT_FOUND_404 || Sivua ei ole olemassa. HTML ERRORS - PAGE_NOT_FOUND_404 || Sivua ei ole olemassa.
HTML ERRORS - UNAUTHORIZED_401 || Todennusta ei suoritettu loppuun. HTML ERRORS - UNAUTHORIZED_401 || Todennusta ei suoritettu loppuun.
HTML ERRORS - UNKNOWN_PAGE_404 || Varmista menneeesi komennon antamaan osoitteeseen, Esim:</p><p>/player/PelaajanNimi<br>/server/PalvelimenNimi</p> HTML ERRORS - UNKNOWN_PAGE_404 || Varmista menneeesi komennon antamaan osoitteeseen, Esim:</p><p>/player/{uuid/nimi}<br>/server/{uuid/nimi/id}</p>
HTML ERRORS - UUID_404 || Pelaajan UUID:ta ei löytynyt tietokannasta. HTML ERRORS - UUID_404 || Pelaajan UUID:ta ei löytynyt tietokannasta.
In Depth Help - /plan db || Käytä eri tietokanta alikomentoja vaikuttaaksesi tietokantaan In Depth Help - /plan db || Käytä eri tietokanta alikomentoja vaikuttaaksesi tietokantaan
In Depth Help - /plan db backup || Käyttää SQLiteä varmuuskopioimaan tiedot tiedostoon. In Depth Help - /plan db backup || Käyttää SQLiteä varmuuskopioimaan tiedot tiedostoon.

View File

@ -448,7 +448,7 @@ HTML ERRORS - NOT_FOUND_404 || Non trouvé.
HTML ERRORS - NOT_PLAYED_404 || Cet utilisateur ne s'est jamais connecté sur ce serveur. HTML ERRORS - NOT_PLAYED_404 || Cet utilisateur ne s'est jamais connecté sur ce serveur.
HTML ERRORS - PAGE_NOT_FOUND_404 || Cette page n'existe pas. HTML ERRORS - PAGE_NOT_FOUND_404 || Cette page n'existe pas.
HTML ERRORS - UNAUTHORIZED_401 || Non autorisé. HTML ERRORS - UNAUTHORIZED_401 || Non autorisé.
HTML ERRORS - UNKNOWN_PAGE_404 || Assurez-vous que vous accédez à un lien donné par une commande. Exemples :</p><p>/player/Nom_du_Joueur<br>/server/Nom_du_Serveur</p> HTML ERRORS - UNKNOWN_PAGE_404 || Assurez-vous que vous accédez à un lien donné par une commande. Exemples :</p><p>/player/{uuid/nom}<br>/server/{uuid/nom/id}</p>
HTML ERRORS - UUID_404 || L'UUID de cet utilisateur n'a pas été trouvé dans la base de données. HTML ERRORS - UUID_404 || L'UUID de cet utilisateur n'a pas été trouvé dans la base de données.
In Depth Help - /plan db || Utilise différentes sous-commandes de base de données pour modifier les données d'une manière ou d'une autre. In Depth Help - /plan db || Utilise différentes sous-commandes de base de données pour modifier les données d'une manière ou d'une autre.
In Depth Help - /plan db backup || Utilise SQLite pour sauvegarder la base de données cible dans un fichier. In Depth Help - /plan db backup || Utilise SQLite pour sauvegarder la base de données cible dans un fichier.

View File

@ -448,7 +448,7 @@ HTML ERRORS - NOT_FOUND_404 || Non Trovato
HTML ERRORS - NOT_PLAYED_404 || Questo giocatore non ha mai giocato su questo server. HTML ERRORS - NOT_PLAYED_404 || Questo giocatore non ha mai giocato su questo server.
HTML ERRORS - PAGE_NOT_FOUND_404 || Questa pagina non esiste. HTML ERRORS - PAGE_NOT_FOUND_404 || Questa pagina non esiste.
HTML ERRORS - UNAUTHORIZED_401 || Non Autorizzato HTML ERRORS - UNAUTHORIZED_401 || Non Autorizzato
HTML ERRORS - UNKNOWN_PAGE_404 || Assicurati che stai seguendo il link usando il commando, Esempi:</p><p>/player/PlayerName<br>/server/ServerName</p> HTML ERRORS - UNKNOWN_PAGE_404 || Assicurati che stai seguendo il link usando il commando, Esempi:</p><p>/player/{uuid/name}<br>/server/{uuid/name/id}</p>
HTML ERRORS - UUID_404 || UUID del Giocatore non trovato nel database. HTML ERRORS - UUID_404 || UUID del Giocatore non trovato nel database.
In Depth Help - /plan db || Use different database subcommands to change the data in some way In Depth Help - /plan db || Use different database subcommands to change the data in some way
In Depth Help - /plan db backup || Uses SQLite to backup the target database to a file. In Depth Help - /plan db backup || Uses SQLite to backup the target database to a file.

View File

@ -448,7 +448,7 @@ HTML ERRORS - NOT_FOUND_404 || ページが見つかりま
HTML ERRORS - NOT_PLAYED_404 || プレイヤーはこのサーバーでプレイしていません HTML ERRORS - NOT_PLAYED_404 || プレイヤーはこのサーバーでプレイしていません
HTML ERRORS - PAGE_NOT_FOUND_404 || ページは存在しません HTML ERRORS - PAGE_NOT_FOUND_404 || ページは存在しません
HTML ERRORS - UNAUTHORIZED_401 || 未認証状態です HTML ERRORS - UNAUTHORIZED_401 || 未認証状態です
HTML ERRORS - UNKNOWN_PAGE_404 || リンクが間違っています、コマンド等を使用しURLを確認して下さい。 URL例:</p><p>/player/PlayerName<br>/server/ServerName</p> HTML ERRORS - UNKNOWN_PAGE_404 || リンクが間違っています、コマンド等を使用しURLを確認して下さい。 URL例:</p><p>/player/{uuid/name}<br>/server/{uuid/name/id}</p>
HTML ERRORS - UUID_404 || データベース内にプレヤーのUUIDが存在しません HTML ERRORS - UUID_404 || データベース内にプレヤーのUUIDが存在しません
In Depth Help - /plan db || 異なるデータベースのサブコマンドを使用することで、様々な方法でデータを変更/更新/削除します In Depth Help - /plan db || 異なるデータベースのサブコマンドを使用することで、様々な方法でデータを変更/更新/削除します
In Depth Help - /plan db backup || SQLiteによってデータベースをファイルにバックアップします In Depth Help - /plan db backup || SQLiteによってデータベースをファイルにバックアップします

View File

@ -448,7 +448,7 @@ HTML ERRORS - NOT_FOUND_404 || Not Found 404
HTML ERRORS - NOT_PLAYED_404 || Plan has not seen this player. 404 HTML ERRORS - NOT_PLAYED_404 || Plan has not seen this player. 404
HTML ERRORS - PAGE_NOT_FOUND_404 || Page does not exist. 404 HTML ERRORS - PAGE_NOT_FOUND_404 || Page does not exist. 404
HTML ERRORS - UNAUTHORIZED_401 || Unauthorized 401 HTML ERRORS - UNAUTHORIZED_401 || Unauthorized 401
HTML ERRORS - UNKNOWN_PAGE_404 || Make sure you're accessing a link given by a command, Examples:</p><p>/player/PlayerName<br>/server/ServerName</p> HTML ERRORS - UNKNOWN_PAGE_404 || Make sure you're accessing a link given by a command, Examples:</p><p>/player/{uuid/name}<br>/server/{uuid/name/id}</p>
HTML ERRORS - UUID_404 || Player UUID was not found in the database. 404 HTML ERRORS - UUID_404 || Player UUID was not found in the database. 404
In Depth Help - /plan db || Use different database subcommands to change the data in some way In Depth Help - /plan db || Use different database subcommands to change the data in some way
In Depth Help - /plan db backup || Uses SQLite to backup the target database to a file. In Depth Help - /plan db backup || Uses SQLite to backup the target database to a file.

View File

@ -448,7 +448,7 @@ HTML ERRORS - NOT_FOUND_404 || Não Encontrado
HTML ERRORS - NOT_PLAYED_404 || Esse jogador não jogou nesse servidor. HTML ERRORS - NOT_PLAYED_404 || Esse jogador não jogou nesse servidor.
HTML ERRORS - PAGE_NOT_FOUND_404 || Página não existe. HTML ERRORS - PAGE_NOT_FOUND_404 || Página não existe.
HTML ERRORS - UNAUTHORIZED_401 || Acesso não autorizado HTML ERRORS - UNAUTHORIZED_401 || Acesso não autorizado
HTML ERRORS - UNKNOWN_PAGE_404 || Certifique-se de que você está acessando um link fornecido por comando, exemplos:</p><p>/player/NomeDoJogador<br>/server/NomeDoServidor</p> HTML ERRORS - UNKNOWN_PAGE_404 || Certifique-se de que você está acessando um link fornecido por comando, exemplos:</p><p>/player/{uuid/nome}<br>/server/{uuid/nome/id}</p>
HTML ERRORS - UUID_404 || UUID de jogador não encontrado no banco de dados. HTML ERRORS - UUID_404 || UUID de jogador não encontrado no banco de dados.
In Depth Help - /plan db || Use different database subcommands to change the data in some way In Depth Help - /plan db || Use different database subcommands to change the data in some way
In Depth Help - /plan db backup || Uses SQLite to backup the target database to a file. In Depth Help - /plan db backup || Uses SQLite to backup the target database to a file.

View File

@ -448,7 +448,7 @@ HTML ERRORS - NOT_FOUND_404 || Не обнаружена
HTML ERRORS - NOT_PLAYED_404 || Plan еще не видел этого игрока. HTML ERRORS - NOT_PLAYED_404 || Plan еще не видел этого игрока.
HTML ERRORS - PAGE_NOT_FOUND_404 || Страница не существует. HTML ERRORS - PAGE_NOT_FOUND_404 || Страница не существует.
HTML ERRORS - UNAUTHORIZED_401 || Не авторизован HTML ERRORS - UNAUTHORIZED_401 || Не авторизован
HTML ERRORS - UNKNOWN_PAGE_404 || Убедитесь, что вы получаете доступ к ссылке, заданной командой, Примеры:</p><p>/player/PlayerName<br>/server/ServerName</p> HTML ERRORS - UNKNOWN_PAGE_404 || Убедитесь, что вы получаете доступ к ссылке, заданной командой, Примеры:</p><p>/player/{uuid/name}<br>/server/{uuid/name/id}</p>
HTML ERRORS - UUID_404 || UUID игрока не найден в базе данных. HTML ERRORS - UUID_404 || UUID игрока не найден в базе данных.
In Depth Help - /plan db || Use different database subcommands to change the data in some way In Depth Help - /plan db || Use different database subcommands to change the data in some way
In Depth Help - /plan db backup || Uses SQLite to backup the target database to a file. In Depth Help - /plan db backup || Uses SQLite to backup the target database to a file.

View File

@ -448,7 +448,7 @@ HTML ERRORS - NOT_FOUND_404 || Bulunamadı
HTML ERRORS - NOT_PLAYED_404 || Oyuncu bu sunucuda hiç oynamadı. HTML ERRORS - NOT_PLAYED_404 || Oyuncu bu sunucuda hiç oynamadı.
HTML ERRORS - PAGE_NOT_FOUND_404 || Böyle bir sayfa mevcut değil. HTML ERRORS - PAGE_NOT_FOUND_404 || Böyle bir sayfa mevcut değil.
HTML ERRORS - UNAUTHORIZED_401 || Yetkisiz HTML ERRORS - UNAUTHORIZED_401 || Yetkisiz
HTML ERRORS - UNKNOWN_PAGE_404 || Make sure you're accessing a link given by a command, Examples:</p><p>/player/PlayerName<br>/server/ServerName</p> HTML ERRORS - UNKNOWN_PAGE_404 || Make sure you're accessing a link given by a command, Examples:</p><p>/player/{uuid/name}<br>/server/{uuid/name/id}</p>
HTML ERRORS - UUID_404 || Oyuncunun UUID si veritabanında bulunamadı. HTML ERRORS - UUID_404 || Oyuncunun UUID si veritabanında bulunamadı.
In Depth Help - /plan db || Use different database subcommands to change the data in some way In Depth Help - /plan db || Use different database subcommands to change the data in some way
In Depth Help - /plan db backup || Uses SQLite to backup the target database to a file. In Depth Help - /plan db backup || Uses SQLite to backup the target database to a file.

View File

@ -93,7 +93,7 @@ function createAccordionBody(i, session) {
</div> </div>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6"> <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<div id="worldpie_${i}" class="chart-pie"></div> <div id="worldpie_${i}" class="chart-pie"></div>
<a href="${session.network_server ? `./player/` : `../player/`}${session.player_url_name}" class="float-right btn bg-blue"> <a href="${session.network_server ? `./player/` : `../player/`}${session.player_uuid}" class="float-right btn bg-blue">
<i class="fa fa-user"></i><span> Player Page</span> <i class="fa fa-user"></i><span> Player Page</span>
</a> </a>
${session.network_server ? `<a href="./server/${session.server_url_name}" class="float-right btn bg-light-green mr-2"> ${session.network_server ? `<a href="./server/${session.server_url_name}" class="float-right btn bg-light-green mr-2">

View File

@ -183,6 +183,8 @@ public class AccessControlTest {
"/v1/network/pingTable,200", "/v1/network/pingTable,200",
"/player/" + TestConstants.PLAYER_ONE_NAME + ",200", "/player/" + TestConstants.PLAYER_ONE_NAME + ",200",
"/player/" + TestConstants.PLAYER_TWO_NAME + ",404", "/player/" + TestConstants.PLAYER_TWO_NAME + ",404",
"/player/" + TestConstants.PLAYER_ONE_UUID_STRING + ",200",
"/player/" + TestConstants.PLAYER_TWO_UUID_STRING + ",404",
"/v1/player?player=" + TestConstants.PLAYER_ONE_NAME + ",200", "/v1/player?player=" + TestConstants.PLAYER_ONE_NAME + ",200",
"/v1/player?player=" + TestConstants.PLAYER_TWO_NAME + ",400", "/v1/player?player=" + TestConstants.PLAYER_TWO_NAME + ",400",
"/players,200", "/players,200",
@ -240,6 +242,8 @@ public class AccessControlTest {
"/v1/network/pingTable,403", "/v1/network/pingTable,403",
"/player/" + TestConstants.PLAYER_ONE_NAME + ",200", "/player/" + TestConstants.PLAYER_ONE_NAME + ",200",
"/player/" + TestConstants.PLAYER_TWO_NAME + ",404", "/player/" + TestConstants.PLAYER_TWO_NAME + ",404",
"/player/" + TestConstants.PLAYER_ONE_UUID_STRING + ",200",
"/player/" + TestConstants.PLAYER_TWO_UUID_STRING + ",404",
"/v1/player?player=" + TestConstants.PLAYER_ONE_NAME + ",200", "/v1/player?player=" + TestConstants.PLAYER_ONE_NAME + ",200",
"/v1/player?player=" + TestConstants.PLAYER_TWO_NAME + ",400", "/v1/player?player=" + TestConstants.PLAYER_TWO_NAME + ",400",
"/players,200", "/players,200",
@ -297,6 +301,8 @@ public class AccessControlTest {
"/v1/network/pingTable,403", "/v1/network/pingTable,403",
"/player/" + TestConstants.PLAYER_ONE_NAME + ",200", "/player/" + TestConstants.PLAYER_ONE_NAME + ",200",
"/player/" + TestConstants.PLAYER_TWO_NAME + ",403", "/player/" + TestConstants.PLAYER_TWO_NAME + ",403",
"/player/" + TestConstants.PLAYER_ONE_UUID_STRING + ",200",
"/player/" + TestConstants.PLAYER_TWO_UUID_STRING + ",403",
"/v1/player?player=" + TestConstants.PLAYER_ONE_NAME + ",200", "/v1/player?player=" + TestConstants.PLAYER_ONE_NAME + ",200",
"/v1/player?player=" + TestConstants.PLAYER_TWO_NAME + ",403", "/v1/player?player=" + TestConstants.PLAYER_TWO_NAME + ",403",
"/players,403", "/players,403",
@ -354,6 +360,8 @@ public class AccessControlTest {
"/v1/network/pingTable,403", "/v1/network/pingTable,403",
"/player/" + TestConstants.PLAYER_ONE_NAME + ",403", "/player/" + TestConstants.PLAYER_ONE_NAME + ",403",
"/player/" + TestConstants.PLAYER_TWO_NAME + ",403", "/player/" + TestConstants.PLAYER_TWO_NAME + ",403",
"/player/" + TestConstants.PLAYER_ONE_UUID_STRING + ",403",
"/player/" + TestConstants.PLAYER_TWO_UUID_STRING + ",403",
"/v1/player?player=" + TestConstants.PLAYER_ONE_NAME + ",403", "/v1/player?player=" + TestConstants.PLAYER_ONE_NAME + ",403",
"/v1/player?player=" + TestConstants.PLAYER_TWO_NAME + ",403", "/v1/player?player=" + TestConstants.PLAYER_TWO_NAME + ",403",
"/players,403", "/players,403",

View File

@ -38,8 +38,10 @@ public class TestConstants {
public static final String SERVER_UUID_STRING = "e4ec2edd-e0ed-3c58-a87d-8a9021899479"; public static final String SERVER_UUID_STRING = "e4ec2edd-e0ed-3c58-a87d-8a9021899479";
public static final ServerUUID SERVER_UUID = ServerUUID.fromString(SERVER_UUID_STRING); public static final ServerUUID SERVER_UUID = ServerUUID.fromString(SERVER_UUID_STRING);
public static final ServerUUID SERVER_TWO_UUID = ServerUUID.fromString("c4ec2edd-e0ed-3c58-a87d-8a9024791899"); public static final ServerUUID SERVER_TWO_UUID = ServerUUID.fromString("c4ec2edd-e0ed-3c58-a87d-8a9024791899");
public static final UUID PLAYER_ONE_UUID = UUID.fromString("45b0dfdb-f71d-4cf3-8c21-27c9d4c651db"); public static final String PLAYER_ONE_UUID_STRING = "45b0dfdb-f71d-4cf3-8c21-27c9d4c651db";
public static final UUID PLAYER_TWO_UUID = UUID.fromString("ec94a954-1fa1-445b-b09b-9b698519af80"); public static final UUID PLAYER_ONE_UUID = UUID.fromString(PLAYER_ONE_UUID_STRING);
public static final String PLAYER_TWO_UUID_STRING = "ec94a954-1fa1-445b-b09b-9b698519af80";
public static final UUID PLAYER_TWO_UUID = UUID.fromString(PLAYER_TWO_UUID_STRING);
public static final UUID PLAYER_THREE_UUID = UUID.randomUUID(); public static final UUID PLAYER_THREE_UUID = UUID.randomUUID();
public static final String PLAYER_ONE_NAME = "Test_Player_one"; public static final String PLAYER_ONE_NAME = "Test_Player_one";