mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 22:41:27 +00:00
Merge pull request #4326 from eitch/staging
[Fix] Don't count inactive accounts for registration blocking
This commit is contained in:
commit
85cdaf5f3a
1 changed files with 3 additions and 2 deletions
|
@ -180,7 +180,8 @@ class RegisterController extends Controller
|
||||||
}
|
}
|
||||||
$limit = config('pixelfed.max_users');
|
$limit = config('pixelfed.max_users');
|
||||||
if($limit) {
|
if($limit) {
|
||||||
abort_if($limit <= User::count(), 404);
|
$count = User::where(function($q){ return $q->whereNull('status')->orWhereNotIn('status', ['deleted','delete']); })->count();
|
||||||
|
abort_if($limit <= $count, 404);
|
||||||
return view('auth.register');
|
return view('auth.register');
|
||||||
} else {
|
} else {
|
||||||
return view('auth.register');
|
return view('auth.register');
|
||||||
|
@ -204,7 +205,7 @@ class RegisterController extends Controller
|
||||||
abort_if(BouncerService::checkIp($request->ip()), 404);
|
abort_if(BouncerService::checkIp($request->ip()), 404);
|
||||||
}
|
}
|
||||||
|
|
||||||
$count = User::count();
|
$count = User::where(function($q){ return $q->whereNull('status')->orWhereNotIn('status', ['deleted','delete']); })->count();
|
||||||
$limit = config('pixelfed.max_users');
|
$limit = config('pixelfed.max_users');
|
||||||
|
|
||||||
if(false == config_cache('pixelfed.open_registration') || $limit && $limit <= $count) {
|
if(false == config_cache('pixelfed.open_registration') || $limit && $limit <= $count) {
|
||||||
|
|
Loading…
Reference in a new issue