From 9ad367370a6da23da55a05dccf805af468ea7647 Mon Sep 17 00:00:00 2001 From: slawkens Date: Wed, 9 Jun 2021 01:54:22 +0200 Subject: [PATCH] Support for downgraded TFS 7.72 (with accounts.number) Part 2 --- system/init.php | 4 +++- system/login.php | 2 +- system/pages/accountmanagement.php | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/system/init.php b/system/init.php index cc42180c..d4c623bf 100644 --- a/system/init.php +++ b/system/init.php @@ -127,6 +127,8 @@ $ots = POT::getInstance(); require_once SYSTEM . 'database.php'; define('USE_ACCOUNT_NAME', $db->hasColumn('accounts', 'name')); +define('USE_ACCOUNT_NUMBER', $db->hasColumn('accounts', 'number')); + // load vocation names $tmp = ''; if($cache->enabled() && $cache->fetch('vocations', $tmp)) { @@ -158,4 +160,4 @@ else { unset($tmp, $id, $vocation); require LIBS . 'Towns.php'; -Towns::load(); \ No newline at end of file +Towns::load(); diff --git a/system/login.php b/system/login.php index c004f03c..cf33d04b 100644 --- a/system/login.php +++ b/system/login.php @@ -102,7 +102,7 @@ else && (!isset($t) || $t['attempts'] < 5) ) { - setSession('account', $account_logged->getId()); + setSession('account', $account_logged->getNumber()); setSession('password', encrypt(($config_salt_enabled ? $account_logged->getCustomField('salt') : '') . $login_password)); if($remember_me) { setSession('remember_me', true); diff --git a/system/pages/accountmanagement.php b/system/pages/accountmanagement.php index 1a4cb583..53c65c0c 100644 --- a/system/pages/accountmanagement.php +++ b/system/pages/accountmanagement.php @@ -127,7 +127,7 @@ $errors = array(); 'email_request' => $email_request, 'email_new_time' => $email_new_time, 'email_new' => isset($email_new) ? $email_new : '', - 'account' => USE_ACCOUNT_NAME ? $account_logged->getName() : $account_logged->getId(), + 'account' => USE_ACCOUNT_NAME ? $account_logged->getName() : $account_logged->getNumber(), 'account_email' => $account_email, 'account_created' => $account_created, 'account_status' => $account_status,