mirror of
https://github.com/slawkens/myaac.git
synced 2025-11-06 18:56:23 +01:00
Add new possibility: to deny saving setting if condition is not met
This commit is contained in:
@@ -1301,6 +1301,16 @@ Sent by MyAAC,<br/>
|
||||
'desc' => 'What to give to player after donation - what column in accounts table to use.',
|
||||
'options' => ['premium_points' => 'Premium Points', 'coins' => 'Coins'],
|
||||
'default' => 'premium_points',
|
||||
'callbacks' => [
|
||||
'beforeSave' => function($key, $value, &$errorMessage) {
|
||||
global $db;
|
||||
if ($value == 'coins' && !$db->hasColumn('accounts', 'coins')) {
|
||||
$errorMessage = "Shop: Donate Column: Cannot set column to coins, because it doesn't exist in database.";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
]
|
||||
],
|
||||
'account_generate_new_reckey' => [
|
||||
'name' => 'Allow Generate New Key',
|
||||
|
||||
Reference in New Issue
Block a user