Mail routing parent/children, domain name validation, nodelist import changes and other fixes

This commit is contained in:
Deon George
2021-07-26 21:21:58 +10:00
parent 49bc946024
commit b179b1b3e9
15 changed files with 537 additions and 171 deletions

View File

@@ -89,7 +89,6 @@ class NodelistImport implements ShouldQueue
switch ($fields[0]) {
case 'Zone': $zone = $fields[1];
// We ignore the Zone entries, since they are dynamically created.
Zone::unguard();
$zo = Zone::firstOrNew([
'zone_id'=>$zone,
@@ -99,7 +98,7 @@ class NodelistImport implements ShouldQueue
Zone::reguard();
$region = 0;
$host = $fields[1];
$host = 0;
$hub_id = NULL;
$role = DomainController::NODE_ZC;
@@ -118,8 +117,7 @@ class NodelistImport implements ShouldQueue
$hub_id = NULL;
$role = DomainController::NODE_NC;
// We ignore the Host entries, since they are dynamically created.
continue 2;
break;
case 'Hub':
$node = $fields[1];
@@ -243,10 +241,10 @@ class NodelistImport implements ShouldQueue
try {
$so->addresses()->save($ao);
if ($role == DomainController::NODE_HC)
if ($ao->role == DomainController::NODE_HC)
$hub_id = $ao->id;
$this->no->addresses()->attach($ao,['role'=>$role]);
$this->no->addresses()->attach($ao,['role'=>$ao->role]);
} catch (\Exception $e) {
Log::error(sprintf('%s:Error with line [%s] (%s)',self::LOGKEY,$line,$e->getMessage()),['fields'=>$fields]);