Mail routing parent/children, domain name validation, nodelist import changes and other fixes
This commit is contained in:
@@ -5,7 +5,7 @@ namespace App\Http\Controllers;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
use App\Models\Zone;
|
||||
use App\Models\{Address,Zone};
|
||||
|
||||
class ZoneController extends Controller
|
||||
{
|
||||
@@ -64,6 +64,30 @@ class ZoneController extends Controller
|
||||
|
||||
$o->save();
|
||||
|
||||
// Find the zones 0/0 address, and assign it to this host.
|
||||
$ao = Address::where('zone_id',$request->zone_id)
|
||||
->where('region_id',0)
|
||||
->where('host_id',0)
|
||||
->where('node_id',0)
|
||||
->where('point_id',0)
|
||||
->single();
|
||||
|
||||
// Its not defined, so we'll create it.
|
||||
if (! $ao) {
|
||||
$ao = new Address;
|
||||
$ao->forceFill([
|
||||
'region_id'=>0,
|
||||
'host_id'=>0,
|
||||
'node_id'=>0,
|
||||
'point_id'=>0,
|
||||
'role'=>DomainController::NODE_ZC,
|
||||
]);
|
||||
}
|
||||
|
||||
$ao->system_id = $request->system_id;
|
||||
$ao->active = TRUE;
|
||||
$o->addresses()->save($ao);
|
||||
|
||||
return redirect()->action([self::class,'home']);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user