mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2025-01-18 13:54:01 +08:00
use Request::ip() instead
This commit is contained in:
parent
28a66cba18
commit
efd57bfce0
@ -161,8 +161,6 @@ class AdminController extends Controller
|
||||
'enabled' => $plugins->getEnabledPlugins()
|
||||
];
|
||||
|
||||
// dd($data);
|
||||
|
||||
return view('admin.plugins', $data);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user