Move account_types to config, account.web_flags to common.php

This commit is contained in:
slawkens 2023-02-06 20:27:12 +01:00
parent b918f88776
commit 17eb5426e3
3 changed files with 24 additions and 7 deletions

View File

@ -31,13 +31,8 @@ if ($config['account_country']) {
foreach ($config['countries'] as $code => $c) foreach ($config['countries'] as $code => $c)
$countries[$code] = $c; $countries[$code] = $c;
} }
$web_acc = array("None", "Admin", "Super Admin", "(Admin + Super Admin)"); $web_acc = ACCOUNT_WEB_FLAGS;
$acc_type = array("None", "Normal", "Tutor", "Senior Tutor", "Gamemaster", "God"); $acc_type = config('account_types');
$groups = new OTS_Groups_List();
if ($groups->getHighestId() == 6) {
$acc_type = array("None", "Normal", "Tutor", "Senior Tutor", "Gamemaster", "Community Manager", "God");
}
?> ?>
<link rel="stylesheet" type="text/css" href="<?php echo BASE_URL; ?>tools/css/jquery.datetimepicker.css"/ > <link rel="stylesheet" type="text/css" href="<?php echo BASE_URL; ?>tools/css/jquery.datetimepicker.css"/ >

View File

@ -34,8 +34,10 @@ define('MYAAC_OS', stripos(PHP_OS, 'WIN') === 0 ? 'WINDOWS' : (strtoupper(PHP_OS
define('IS_CLI', in_array(php_sapi_name(), ['cli', 'phpdb'])); define('IS_CLI', in_array(php_sapi_name(), ['cli', 'phpdb']));
// account flags // account flags
const FLAG_NONE = 0;
const FLAG_ADMIN = 1; const FLAG_ADMIN = 1;
const FLAG_SUPER_ADMIN = 2; const FLAG_SUPER_ADMIN = 2;
const FLAG_SUPER_BOTH = 3;
const FLAG_CONTENT_PAGES = 4; const FLAG_CONTENT_PAGES = 4;
const FLAG_CONTENT_MAILER = 8; const FLAG_CONTENT_MAILER = 8;
const FLAG_CONTENT_NEWS = 16; const FLAG_CONTENT_NEWS = 16;
@ -49,6 +51,14 @@ const FLAG_CONTENT_FAQ = 2048;
const FLAG_CONTENT_MENUS = 4096; const FLAG_CONTENT_MENUS = 4096;
const FLAG_CONTENT_PLAYERS = 8192; const FLAG_CONTENT_PLAYERS = 8192;
// account access types
const ACCOUNT_WEB_FLAGS = [
FLAG_NONE => 'None',
FLAG_ADMIN =>'Admin',
FLAG_SUPER_ADMIN => 'Super Admin',
FLAG_SUPER_BOTH =>'(Admin + Super Admin)',
];
// news // news
const NEWS = 1; const NEWS = 1;
const TICKER = 2; const TICKER = 2;

View File

@ -160,6 +160,18 @@ $config = array(
'send_mail_when_change_password' => true, // send e-mail with new password when change password to account 'send_mail_when_change_password' => true, // send e-mail with new password when change password to account
'send_mail_when_generate_reckey' => true, // send e-mail with rec key (key is displayed on page anyway when generate) 'send_mail_when_generate_reckey' => true, // send e-mail with rec key (key is displayed on page anyway when generate)
// you may need to adjust this for older tfs versions
// by removing Community Manager
'account_types' => [
'None',
'Normal',
'Tutor',
'Senior Tutor',
'Gamemaster',
'Community Manager',
'God',
],
// genders (aka sex) // genders (aka sex)
'genders' => array( 'genders' => array(
0 => 'Female', 0 => 'Female',