Auto create Domains/Zones as systems present their AKAs to us
This commit is contained in:
@@ -9,7 +9,7 @@ use Illuminate\Support\Facades\Log;
|
||||
use App\Classes\File\{Receive,Send};
|
||||
use App\Classes\Sock\SocketClient;
|
||||
use App\Classes\Sock\SocketException;
|
||||
use App\Models\{Address,Setup};
|
||||
use App\Models\{Address,Setup,System};
|
||||
|
||||
abstract class Protocol
|
||||
{
|
||||
@@ -313,6 +313,19 @@ abstract class Protocol
|
||||
(($rc & self::S_MASK) == self::S_OK) ? 'Successful' : 'Failed',
|
||||
));
|
||||
|
||||
// Add unknown FTNs to the DB
|
||||
if ($this->node->aka_remote_authed->count()) {
|
||||
$so = $this->node->aka_remote_authed->first()->system;
|
||||
} else {
|
||||
$so = System::where('name','Discovered System')->single();
|
||||
}
|
||||
|
||||
if ($so && $so->exists) {
|
||||
foreach ($this->node->aka_other as $aka) {
|
||||
Address::findFTN($aka,TRUE,$so);
|
||||
}
|
||||
}
|
||||
|
||||
// @todo Log to history log in the DB.
|
||||
//if ($this->node->start_time && $this->setup->cfg('CFG_HISTORY')) {}
|
||||
|
||||
|
Reference in New Issue
Block a user