Mail routing parent/children, domain name validation, nodelist import changes and other fixes
This commit is contained in:
@@ -121,6 +121,32 @@ class SystemController extends Controller
|
||||
]
|
||||
]);
|
||||
|
||||
// Find the Hub address
|
||||
// Find the zones <HOST>/0 address, and assign it to this host.
|
||||
$oo = Address::where('zone_id',$request->zone_id)
|
||||
->where('region_id',$request->region_id)
|
||||
->where('host_id',$request->host_id_new)
|
||||
->where('node_id',0)
|
||||
->where('point_id',0)
|
||||
->single();
|
||||
|
||||
// Its not defined, so we'll create it.
|
||||
if (! $oo) {
|
||||
$oo = new Address;
|
||||
$oo->forceFill([
|
||||
'zone_id'=>$request->zone_id,
|
||||
'region_id'=>$request->region_id,
|
||||
'host_id'=>$request->host_id_new,
|
||||
'node_id'=>0,
|
||||
'point_id'=>0,
|
||||
'role'=>DomainController::NODE_NC,
|
||||
]);
|
||||
}
|
||||
|
||||
$oo->system_id = $request->system_id;
|
||||
$oo->active = TRUE;
|
||||
$o->addresses()->save($oo);
|
||||
|
||||
$oo = new Address;
|
||||
$oo->zone_id = $request->post('zone_id');
|
||||
$oo->region_id = $request->post('region_id');
|
||||
@@ -200,8 +226,8 @@ class SystemController extends Controller
|
||||
$validate = $request->validate([
|
||||
'zone_id' => 'required|exists:zones,id',
|
||||
'sespass' => 'required|string|min:4',
|
||||
'pktpass' => 'required|string|min:4|max:8',
|
||||
'ticpass' => 'required|string|min:4',
|
||||
'pktpass' => 'nullable|string|min:4|max:8',
|
||||
'ticpass' => 'nullable|string|min:4',
|
||||
'fixpass' => 'required|string|min:4',
|
||||
]);
|
||||
|
||||
@@ -242,6 +268,8 @@ class SystemController extends Controller
|
||||
return redirect()->action([self::class,'home']);
|
||||
}
|
||||
|
||||
$o->load(['addresses.zone.domain']);
|
||||
|
||||
return view('system.addedit')
|
||||
->with('o',$o);
|
||||
}
|
||||
|
Reference in New Issue
Block a user