@@ -23,11 +23,13 @@ namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Profile;
|
||||
use App\Services\AccountSuspensionService;
|
||||
use App\User;
|
||||
use App\Facades\Options;
|
||||
use App\Facades\IP;
|
||||
use Illuminate\Foundation\Auth\RegistersUsers;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
class RegisterController extends Controller
|
||||
@@ -62,19 +64,6 @@ class RegisterController extends Controller
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
public function showRegistrationForm()
|
||||
{
|
||||
$users = User::where('originalIP', \request()->ip())->get();
|
||||
|
||||
foreach ($users as $user) {
|
||||
if ($user && $user->isBanned()) {
|
||||
abort(403, 'You do not have permission to access this page.');
|
||||
}
|
||||
}
|
||||
|
||||
return view('auth.register');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a validator for an incoming registration request.
|
||||
*
|
||||
@@ -106,9 +95,14 @@ class RegisterController extends Controller
|
||||
'uuid' => (Options::getOption('requireGameLicense') && Options::getOption('currentGame') == 'MINECRAFT') ? ['required', 'string', 'unique:users', 'min:32', 'max:32'] : ['nullable', 'string'],
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
|
||||
'dob' => ['required', 'string', 'date_format:Y-m-d', 'before:-13 years'],
|
||||
'acceptTerms' => ['required', 'accepted'],
|
||||
'password' => $password,
|
||||
], [
|
||||
'uuid.required' => 'Please enter a valid (and Premium) Minecraft username! We do not support cracked users.',
|
||||
'dob.before' => __('You must be 13 years of age or older in order to sign up for an account.'),
|
||||
'dob.required' => __('Please enter your date of birth.'),
|
||||
'uuid.required' => __('Please enter a valid (and Premium) Minecraft username! We do not support cracked users.'),
|
||||
'acceptTerms.required' => __('Please accept the Community Guidelines, Terms of Service and Privacy Policy to continue.')
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -120,12 +114,16 @@ class RegisterController extends Controller
|
||||
*/
|
||||
protected function create(array $data)
|
||||
{
|
||||
$ip = IP::shouldCollect() ? request()->ip() : '0.0.0.0';
|
||||
|
||||
$user = User::create([
|
||||
'uuid' => $data['uuid'] ?? "disabled",
|
||||
'name' => $data['name'],
|
||||
'email' => $data['email'],
|
||||
'password' => Hash::make($data['password']),
|
||||
'originalIP' => IP::shouldCollect() ? request()->ip() : '0.0.0.0',
|
||||
'registrationIp' => $ip,
|
||||
'currentIp' => $ip,
|
||||
'dob' => $data['dob']
|
||||
]);
|
||||
|
||||
$user->assignRole('user');
|
||||
|
Reference in New Issue
Block a user