Do not create player if there is no players table in db

This commit is contained in:
slawkens
2024-09-05 15:36:19 +02:00
parent 779aa152fa
commit 201f95caa8
6 changed files with 74 additions and 55 deletions

View File

@@ -2,6 +2,10 @@
use MyAAC\Settings;
if (!$db->hasTable('players')) {
return;
}
$query = $db->query("SELECT `id` FROM `players` WHERE (`name` = " . $db->quote("Rook Sample") . " OR `name` = " . $db->quote("Sorcerer Sample") . " OR `name` = " . $db->quote("Druid Sample") . " OR `name` = " . $db->quote("Paladin Sample") . " OR `name` = " . $db->quote("Knight Sample") . " OR `name` = " . $db->quote("Account Manager") . ") ORDER BY `id`;");
$highscores_ignored_ids = array();

View File

@@ -9,7 +9,13 @@
<form action="{{ constant('BASE_URL') }}install/" method="post" autocomplete="off">
<input type="hidden" name="step" id="step" value="finish" />
{% for value in ['email', 'account', 'password', 'password_confirm', 'player_name'] %}
{% set values = ['email', 'account', 'password', 'password_confirm'] %}
{% if hasTablePlayers %}
{% set values = values|merge(['player_name']) %}
{% endif %}
{% for value in values %}
<div class="form-group mb-2">
<label for="vars_{{ value }}">{{ locale['step_admin_' ~ value] }}</label>