From 023f1dc59843f5221045f00f94e85770ea80187d Mon Sep 17 00:00:00 2001 From: slawkens Date: Thu, 19 Dec 2024 21:52:05 +0100 Subject: [PATCH] Support for accounts.id when there is no accounts.name and accounts.number --- install/index.php | 24 ++++++++++++------------ system/templates/install.admin.html.twig | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/install/index.php b/install/index.php index 5dc457f83..3893c9a28 100644 --- a/install/index.php +++ b/install/index.php @@ -125,18 +125,7 @@ } // account check - if(isset($_SESSION['var_account'])) { - if(empty($_SESSION['var_account'])) { - $errors[] = $locale['step_admin_account_error_empty']; - } - else if(!Validator::accountName($_SESSION['var_account'])) { - $errors[] = $locale['step_admin_account_error_format']; - } - else if(strtoupper($_SESSION['var_account']) == strtoupper($password)) { - $errors[] = $locale['step_admin_account_error_same']; - } - } - else if(isset($_SESSION['var_account_id'])) { + if(isset($_SESSION['var_account_id'])) { if(empty($_SESSION['var_account_id'])) { $errors[] = $locale['step_admin_account_id_error_empty']; } @@ -147,6 +136,17 @@ $errors[] = $locale['step_admin_account_id_error_same']; } } + else if(isset($_SESSION['var_account'])) { + if(empty($_SESSION['var_account'])) { + $errors[] = $locale['step_admin_account_error_empty']; + } + else if(!Validator::accountName($_SESSION['var_account'])) { + $errors[] = $locale['step_admin_account_error_format']; + } + else if(strtoupper($_SESSION['var_account']) == strtoupper($password)) { + $errors[] = $locale['step_admin_account_error_same']; + } + } // password check if(empty($password)) { diff --git a/system/templates/install.admin.html.twig b/system/templates/install.admin.html.twig index 1d64eea90..f6ef2e7bd 100644 --- a/system/templates/install.admin.html.twig +++ b/system/templates/install.admin.html.twig @@ -9,7 +9,7 @@
- {% set values = ['email', 'account', 'password', 'password_confirm'] %} + {% set values = ['email', account, 'password', 'password_confirm'] %} {% if hasTablePlayers %} {% set values = values|merge(['player_name']) %}