Transfering netmail via EMSI

This commit is contained in:
Deon George
2021-07-17 15:48:07 +10:00
parent 6ce4e64cb6
commit 1fa566b26c
15 changed files with 226 additions and 83 deletions

View File

@@ -33,12 +33,14 @@ class Node
private Collection $ftns; // The FTNs of the remote system
private Collection $ftns_authed; // The FTNs we have validated
private bool $authed; // Have we authenticated the remote.
private int $options; // This nodes capabilities/options
public function __construct()
{
$this->options = 0;
$this->authed = FALSE;
$this->start_time = Carbon::now();
$this->ftns = collect();
$this->ftns_authed = collect();
@@ -54,16 +56,20 @@ class Node
case 'aka_num':
return $this->ftns->count();
// Number of AKAs we have validated
// The authenticated remote addresses
case 'aka_remote':
return $this->ftns_authed;
// Have we authenticated the remote
case 'aka_authed':
return $this->ftns_authed->count();
return $this->authed;
case 'ftn':
return ($x=$this->ftns->first()) ? $x->ftn : 'Unknown';
// The nodes password
case 'password':
return ($this->ftns_authed->count() && ($x=$this->ftns_authed->first()->session('sespass'))) ? $x : '-';
return ($this->ftns->count() && ($x=$this->ftns->first()->session('sespass'))) ? $x : '-';
// Return how long our session has been connected
case 'session_time':
@@ -163,6 +169,7 @@ class Node
$o->system->last_session = Carbon::now();
$o->system->save();
$this->ftns_authed->push($o);
$this->authed = TRUE;
}
}
@@ -224,6 +231,10 @@ class Node
*/
public function originate_check(): bool
{
// If we have already authed, we wont do it again
if ($this->authed)
return TRUE;
if ($this->ftns_authed->count() !== 1 || ! $this->ftns->count())
return FALSE;
@@ -233,6 +244,7 @@ class Node
if ($item->ftn == $ftn) {
$item->system->last_session = Carbon::now();
$item->system->save();
$this->authed = TRUE;
return TRUE;
}
}) !== FALSE;