Consistency and SQL Query optimisations - focused around the UI
This commit is contained in:
@@ -66,7 +66,17 @@ class SystemController extends Controller
|
||||
->with('saved',TRUE);
|
||||
}
|
||||
|
||||
$o->load(['addresses.zone.domain','addresses.system','sessions.domain','sessions.systems']);
|
||||
$o->loadMissing([
|
||||
'zcs',
|
||||
// For 'ftn' to work
|
||||
'addresses.zone:id,zone_id,domain_id,active',
|
||||
'addresses.zone.domain:id,name,active',
|
||||
// For 'role'
|
||||
'addresses.system:id,address',
|
||||
// For system addedit
|
||||
'sessions.domain:id,name,active',
|
||||
'sessions.systems:id',
|
||||
]);
|
||||
|
||||
return view('system.addedit')
|
||||
->with('action',$o->exists ? 'update_nn' : 'create')
|
||||
@@ -611,31 +621,12 @@ class SystemController extends Controller
|
||||
*/
|
||||
public function register(SystemRegisterRequest $request)
|
||||
{
|
||||
// Step 1, show the user a form to select an existing defined system
|
||||
if ($request->isMethod('GET'))
|
||||
return view('user.system.register');
|
||||
|
||||
if ($request->action === 'register' && $request->name && is_numeric($request->name))
|
||||
return view('user.system.widget.register_confirm')
|
||||
->with('o',System::findOrFail($request->name));
|
||||
|
||||
$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') {
|
||||
$validate = Setup::findOrFail(config('app.id'))->system->inMyZones($o->addresses);
|
||||
|
||||
// If we have addresses, we'll trigger the routed netmail
|
||||
if ($validate->count()) {
|
||||
Notification::route('netmail',$x=$validate->first())->notify(new AddressLink(Auth::user()));
|
||||
AddressPoll::dispatch($x)->delay(15);
|
||||
}
|
||||
|
||||
return view('user.system.widget.register_send')
|
||||
->with('validate',$validate)
|
||||
->with('o',$o);
|
||||
}
|
||||
|
||||
// If the system doesnt exist, we'll create it
|
||||
if (! $o->exist) {
|
||||
$o->sysop = Auth::user()->name;
|
||||
|
Reference in New Issue
Block a user