mirror of
https://github.com/YunoHost-Apps/pixelfed_ynh.git
synced 2024-09-03 20:06:04 +02:00
Update RegisterController, bump min password length from 6 to 8
This commit is contained in:
parent
2cccbd772a
commit
f22a4b2d75
1 changed files with 10 additions and 7 deletions
|
@ -76,7 +76,7 @@ class RegisterController extends Controller
|
||||||
'name' => 'required|string|max:'.config('pixelfed.max_name_length'),
|
'name' => 'required|string|max:'.config('pixelfed.max_name_length'),
|
||||||
'username' => $usernameRules,
|
'username' => $usernameRules,
|
||||||
'email' => 'required|string|email|max:255|unique:users',
|
'email' => 'required|string|email|max:255|unique:users',
|
||||||
'password' => 'required|string|min:6|confirmed',
|
'password' => 'required|string|min:8|confirmed',
|
||||||
];
|
];
|
||||||
|
|
||||||
return Validator::make($data, $rules);
|
return Validator::make($data, $rules);
|
||||||
|
@ -123,14 +123,17 @@ class RegisterController extends Controller
|
||||||
*/
|
*/
|
||||||
public function showRegistrationForm()
|
public function showRegistrationForm()
|
||||||
{
|
{
|
||||||
$count = User::count();
|
if(config('pixelfed.open_registration')) {
|
||||||
$limit = config('pixelfed.max_users');
|
$limit = config('pixelfed.max_users');
|
||||||
if($limit && $limit <= $count) {
|
if($limit) {
|
||||||
$view = 'site.closed-registration';
|
abort_if($limit <= User::count(), 404);
|
||||||
|
return view('auth.register');
|
||||||
} else {
|
} else {
|
||||||
$view = config('pixelfed.open_registration') == true ? 'auth.register' : 'site.closed-registration';
|
return view('auth.register');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
abort(404);
|
||||||
}
|
}
|
||||||
return view($view);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue