- Kontaktformular: keine Mail mehr an die eingegebene Adresse (wurde als Spam-Versender missbraucht); Anfrage nur an Kontakt-Adresse + Berater (BCC), Reply-To = Absender; Eingaben in der Mail escaped - Kontakt + Registrierung: Cloudflare Turnstile statt reCAPTCHA (Schluessel aus dem Code in die .env), Rate-Limits, Honeypot + Mindest-Ausfuellzeit, Namensregel (lateinische Schrift, max. 50 Zeichen), Form Requests - Registrierung: Partner-Nummer nur fuer aktive Berater (vorher ungeprueft) - CRM: POST /register abgeschaltet (legte ohne Captcha Benutzer an) - Passwort-Mindestlaenge systemweit 8 Zeichen ueber Password::defaults() - Log abgefangener Anfragen: storage/logs/form-spam-*.log - Doku und Protokoll: dev/2026-10-09-spam/README.md Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
79 lines
2 KiB
PHP
79 lines
2 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Auth;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\User;
|
|
use Illuminate\Foundation\Auth\RegistersUsers;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Hash;
|
|
use Illuminate\Support\Facades\Validator;
|
|
use Illuminate\Validation\Rules\Password;
|
|
|
|
class RegisterController extends Controller
|
|
{
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Register Controller
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| This controller handles the registration of new users as well as their
|
|
| validation and creation. By default this controller uses a trait to
|
|
| provide this functionality without requiring any additional code.
|
|
|
|
|
*/
|
|
|
|
use RegistersUsers;
|
|
|
|
/**
|
|
* Where to redirect users after registration.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $redirectTo = '/home';
|
|
|
|
/**
|
|
* Create a new controller instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct()
|
|
{
|
|
$this->middleware('guest');
|
|
}
|
|
|
|
public function showRegistrationForm()
|
|
{
|
|
// register off! - to login
|
|
return redirect('login');
|
|
|
|
}
|
|
|
|
/**
|
|
* Get a validator for an incoming registration request.
|
|
*
|
|
* @return \Illuminate\Contracts\Validation\Validator
|
|
*/
|
|
protected function validator(array $data)
|
|
{
|
|
return Validator::make($data, [
|
|
'name' => 'required|string|max:255',
|
|
'email' => 'required|string|email:filter|max:255|unique:users',
|
|
'password' => ['required', 'string', 'confirmed', Password::defaults()],
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* Create a new user instance after a valid registration.
|
|
*
|
|
* @return User
|
|
*/
|
|
protected function create(array $data)
|
|
{
|
|
return User::create([
|
|
'name' => $data['name'],
|
|
'email' => $data['email'],
|
|
'password' => Hash::make($data['password']),
|
|
]);
|
|
}
|
|
}
|