Enhance the system link/register selection

This commit is contained in:
2023-10-05 11:11:21 +11:00
parent 32c0088339
commit 495a27cfed
3 changed files with 40 additions and 115 deletions

View File

@@ -826,11 +826,11 @@ class SystemController extends Controller
if ($request->isMethod('GET'))
return view('user.system.register');
if ($request->action === 'register' && $request->system_id)
if ($request->action === 'register' && $request->name && is_numeric($request->name))
return view('user.system.widget.register_confirm')
->with('o',System::findOrFail($request->system_id));
->with('o',System::findOrFail($request->name));
$o = System::findOrNew($request->system_id);
$o = System::findOrNew(is_numeric($request->system_id) ? $request->system_id : NULL);
// If the system exists, and we are 'register', we'll start the address claim process
if ($o->exists && $request->action === 'Link') {