diff --git a/admin/pages/accounts.php b/admin/pages/accounts.php index 7c126dc1..da7894a9 100644 --- a/admin/pages/accounts.php +++ b/admin/pages/accounts.php @@ -31,13 +31,8 @@ if ($config['account_country']) { foreach ($config['countries'] as $code => $c) $countries[$code] = $c; } -$web_acc = array("None", "Admin", "Super Admin", "(Admin + Super Admin)"); -$acc_type = array("None", "Normal", "Tutor", "Senior Tutor", "Gamemaster", "God"); - -$groups = new OTS_Groups_List(); -if ($groups->getHighestId() == 6) { - $acc_type = array("None", "Normal", "Tutor", "Senior Tutor", "Gamemaster", "Community Manager", "God"); -} +$web_acc = ACCOUNT_WEB_FLAGS; +$acc_type = config('account_types'); ?> diff --git a/common.php b/common.php index 73a9c28e..5c5b5a34 100644 --- a/common.php +++ b/common.php @@ -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'])); // account flags +const FLAG_NONE = 0; const FLAG_ADMIN = 1; const FLAG_SUPER_ADMIN = 2; +const FLAG_SUPER_BOTH = 3; const FLAG_CONTENT_PAGES = 4; const FLAG_CONTENT_MAILER = 8; const FLAG_CONTENT_NEWS = 16; @@ -49,6 +51,14 @@ const FLAG_CONTENT_FAQ = 2048; const FLAG_CONTENT_MENUS = 4096; 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 const NEWS = 1; const TICKER = 2; diff --git a/config.php b/config.php index 1d6806da..0b6a3c96 100644 --- a/config.php +++ b/config.php @@ -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_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' => array( 0 => 'Female',