More work on user linking to existing defined system
This commit is contained in:
@@ -556,6 +556,29 @@ class SystemController extends Controller
|
||||
return redirect()->to(sprintf('ftn/system/addedit/%d',$o->system_id));
|
||||
}
|
||||
|
||||
public function system_link(Request $request)
|
||||
{
|
||||
if (! $request->system_id)
|
||||
return redirect('user/system/register');
|
||||
|
||||
$s = Setup::findOrFail(config('app.id'))->system;
|
||||
$so = System::findOrFail($request->system_id);
|
||||
|
||||
$ca = NULL;
|
||||
$la = NULL;
|
||||
foreach ($s->addresses as $ao) {
|
||||
if ($ca=$so->match($ao->zone))
|
||||
break;
|
||||
}
|
||||
|
||||
if ($ca->count() && $la=$ca->pop())
|
||||
Notification::route('netmail',$la)->notify(new AddressLink($la,Auth::user()));
|
||||
|
||||
return view('user.system.register_send')
|
||||
->with('la',$la)
|
||||
->with('o',$so);
|
||||
}
|
||||
|
||||
/**
|
||||
* register system
|
||||
*/
|
||||
@@ -565,6 +588,10 @@ class SystemController extends Controller
|
||||
if ($request->isMethod('GET'))
|
||||
return view('user.system.register');
|
||||
|
||||
if ($request->action != 'create')
|
||||
return view('user.system.widget.register_confirm')
|
||||
->with('o',System::findOrFail($request->system_id));
|
||||
|
||||
$o = System::findOrNew($request->system_id);
|
||||
|
||||
// If the system exists, and we are 'register', we'll start the address claim process
|
||||
@@ -575,7 +602,7 @@ class SystemController extends Controller
|
||||
if ($validate->count())
|
||||
Notification::route('netmail',$x=$validate->first())->notify(new AddressLink($x,Auth::user()));
|
||||
|
||||
return view('user.system.widget.register_confirm')
|
||||
return view('user.system.widget.register_send')
|
||||
->with('validate',$validate)
|
||||
->with('o',$o);
|
||||
}
|
||||
|
Reference in New Issue
Block a user