diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index 08d6b31e..f03d81f3 100644 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -161,8 +161,6 @@ class AdminController extends Controller 'enabled' => $plugins->getEnabledPlugins() ]; - // dd($data); - return view('admin.plugins', $data); } diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index 7ed02941..a2466b7a 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -115,11 +115,9 @@ class AuthController extends Controller return json(trans('auth.register.close'), 7); } - $ip = get_real_ip(); - // If amount of registered accounts of IP is more than allowed amounts, // then reject the register. - if (User::where('ip', $ip)->count() < option('regs_per_ip')) + if (User::where('ip', $request->ip())->count() < option('regs_per_ip')) { // Register a new user. // If the email is already registered, @@ -127,9 +125,9 @@ class AuthController extends Controller $user = User::register( $request->input('email'), $request->input('password'), - function($user) use ($ip, $request) + function($user) use ($request) { - $user->ip = $ip; + $user->ip = $request->ip(); $user->score = option('user_initial_score'); $user->register_at = Utils::getTimeFormatted(); $user->last_sign_at = Utils::getTimeFormatted(time() - 86400); diff --git a/app/Http/Controllers/SetupController.php b/app/Http/Controllers/SetupController.php index 2060a3ce..8d9e7509 100644 --- a/app/Http/Controllers/SetupController.php +++ b/app/Http/Controllers/SetupController.php @@ -106,7 +106,7 @@ class SetupController extends Controller $request->input('password'), function ($user) { - $user->ip = get_real_ip(); + $user->ip = $request->ip(); $user->score = option('user_initial_score'); $user->register_at = Utils::getTimeFormatted(); $user->last_sign_at = Utils::getTimeFormatted(time() - 86400);