mirror of
https://github.com/slawkens/myaac.git
synced 2026-02-07 05:36:22 +01:00
Merge branch 'develop' into feature/2fa
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use MyAAC\CreateCharacter;
|
use MyAAC\CreateCharacter;
|
||||||
|
use MyAAC\Models\AccountAction;
|
||||||
use MyAAC\Models\AccountEmailVerify;
|
use MyAAC\Models\AccountEmailVerify;
|
||||||
|
|
||||||
defined('MYAAC') or die('Direct access not allowed!');
|
defined('MYAAC') or die('Direct access not allowed!');
|
||||||
@@ -44,6 +45,16 @@ $errors = array();
|
|||||||
$save = isset($_POST['save']) && $_POST['save'] == 1;
|
$save = isset($_POST['save']) && $_POST['save'] == 1;
|
||||||
if($save)
|
if($save)
|
||||||
{
|
{
|
||||||
|
$cooldown = setting('core.account_create_ip_block_cooldown');;
|
||||||
|
if ($cooldown > 0) {
|
||||||
|
$accountAction = AccountAction::where('ip', get_browser_real_ip())->where('action', 'Account created.')->where('date', '>=', time() - ($cooldown * 60))->first();
|
||||||
|
|
||||||
|
if ($accountAction) {
|
||||||
|
$minute = ($cooldown > 1 ? 'minutes' : 'minute');
|
||||||
|
$errors['account'] = "You have to wait $cooldown $minute before creating another account.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(!config('account_login_by_email')) {
|
if(!config('account_login_by_email')) {
|
||||||
if(USE_ACCOUNT_NAME) {
|
if(USE_ACCOUNT_NAME) {
|
||||||
$account_name = $_POST['account'];
|
$account_name = $_POST['account'];
|
||||||
@@ -140,7 +151,7 @@ if($save)
|
|||||||
'country' => $country,
|
'country' => $country,
|
||||||
'password' => $password,
|
'password' => $password,
|
||||||
'password_confirm' => $password_confirm,
|
'password_confirm' => $password_confirm,
|
||||||
'accept_rules' => isset($_POST['accept_rules']) ? $_POST['accept_rules'] === 'true' : false,
|
'accept_rules' => isset($_POST['accept_rules']) && $_POST['accept_rules'] === 'true',
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!config('account_login_by_email')) {
|
if (!config('account_login_by_email')) {
|
||||||
|
|||||||
@@ -1744,6 +1744,18 @@ Sent by MyAAC,<br/>
|
|||||||
'account_login_ipban_protection', '=', 'true'
|
'account_login_ipban_protection', '=', 'true'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
|
||||||
|
[
|
||||||
|
'type' => 'section',
|
||||||
|
'title' => 'Cooldowns',
|
||||||
|
],
|
||||||
|
'account_create_ip_block_cooldown' => [
|
||||||
|
'name' => 'Create Account IP Block Cooldown',
|
||||||
|
'type' => 'number',
|
||||||
|
'desc' => 'Block flooding create account per ip. If you still have a problem with account create spam - then its recommended to install the recaptcha plugin.' .
|
||||||
|
'<br/><strong>In minutes.</strong> 0 to disable.',
|
||||||
|
'default' => 10,
|
||||||
|
],
|
||||||
],
|
],
|
||||||
'callbacks' => [
|
'callbacks' => [
|
||||||
'beforeSave' => function(&$settings, &$values) {
|
'beforeSave' => function(&$settings, &$values) {
|
||||||
|
|||||||
Reference in New Issue
Block a user