Transfering netmail via EMSI
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user