Compare commits
5 Commits
db8475053c
...
d3a9e36bb7
Author | SHA1 | Date | |
---|---|---|---|
d3a9e36bb7 | |||
2f55de2ddf | |||
b34b046d3c | |||
7c23971e58 | |||
91d4cd0b2f |
@ -38,6 +38,7 @@ class Node
|
|||||||
private Collection $ftns_authed; // The FTNs we have validated
|
private Collection $ftns_authed; // The FTNs we have validated
|
||||||
private Collection $ftns_other; // Other FTN addresses presented
|
private Collection $ftns_other; // Other FTN addresses presented
|
||||||
private bool $authed; // Have we authenticated the remote.
|
private bool $authed; // Have we authenticated the remote.
|
||||||
|
private Address $originate; // When we originate a call, this is who we are after
|
||||||
|
|
||||||
private int $options; // This nodes capabilities/options
|
private int $options; // This nodes capabilities/options
|
||||||
|
|
||||||
@ -84,9 +85,9 @@ class Node
|
|||||||
|
|
||||||
// The nodes password
|
// The nodes password
|
||||||
case 'password':
|
case 'password':
|
||||||
// If we have already authed, we'll use that password.
|
// If we are originating a session, we'll use that password.
|
||||||
if ($this->ftns_authed->count())
|
if (isset($this->originate))
|
||||||
return $this->ftns_authed->first()->pass_session;
|
return $this->originate->pass_session;
|
||||||
else
|
else
|
||||||
return ($this->ftns->count() && ($x=$this->ftns->first()->pass_session)) ? $x : '-';
|
return ($this->ftns->count() && ($x=$this->ftns->first()->pass_session)) ? $x : '-';
|
||||||
|
|
||||||
@ -194,6 +195,8 @@ class Node
|
|||||||
throw new Exception('Already authed');
|
throw new Exception('Already authed');
|
||||||
|
|
||||||
foreach ($this->ftns as $o) {
|
foreach ($this->ftns as $o) {
|
||||||
|
Log::debug(sprintf('%s:- Attempting to authenticate [%s] with [%s]',self::LOGKEY,$o->ftn,$o->pass_session));
|
||||||
|
|
||||||
if (! $sespass=$o->pass_session)
|
if (! $sespass=$o->pass_session)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -269,7 +272,8 @@ class Node
|
|||||||
*/
|
*/
|
||||||
public function originate(Address $o): void
|
public function originate(Address $o): void
|
||||||
{
|
{
|
||||||
$this->ftns_authed->push($o);
|
$this->originate = $o;
|
||||||
|
$this->ftns_authed = $o->system->match($o->zone);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -283,19 +287,9 @@ class Node
|
|||||||
if ($this->authed)
|
if ($this->authed)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
if ($this->ftns_authed->count() !== 1 || ! $this->ftns->count())
|
Log::debug(sprintf('%s:- Making sure we called [%s] from [%s]',self::LOGKEY,$this->originate->ftn,$this->ftns->pluck('ftn')->join(',')));
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
$ftn = $this->ftns_authed->first()->ftn;
|
return $this->ftns->pluck('ftn')->contains($this->originate->ftn);
|
||||||
|
|
||||||
return $this->ftns->search(function($item) use ($ftn) {
|
|
||||||
if ($item->ftn === $ftn) {
|
|
||||||
$item->system->last_session = Carbon::now();
|
|
||||||
$item->system->save();
|
|
||||||
$this->authed = TRUE;
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
}) !== FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function optionClear(int $key): void
|
public function optionClear(int $key): void
|
||||||
|
@ -711,7 +711,7 @@ final class Binkp extends BaseProtocol
|
|||||||
|
|
||||||
// If we only present limited AKAs dont validate password against akas outside of the domains we present
|
// If we only present limited AKAs dont validate password against akas outside of the domains we present
|
||||||
} elseif (is_null(our_address($o))) {
|
} elseif (is_null(our_address($o))) {
|
||||||
Log::alert(sprintf('%s:/ AKA domain [%s] is not in our domain(s) [%s] - ignoring',self::LOGKEY,$o->zone->domain->name,our_address()->pluck('zone.domain.name')->unique()->join(',')));
|
Log::debug(sprintf('%s:/ AKA domain [%s] is not in our domain(s) [%s] - ignoring',self::LOGKEY,$o->zone->domain->name,our_address()->pluck('zone.domain.name')->unique()->join(',')));
|
||||||
|
|
||||||
$this->node->ftn_other = $rem_aka;
|
$this->node->ftn_other = $rem_aka;
|
||||||
continue;
|
continue;
|
||||||
|
@ -48,21 +48,6 @@ class MailSend #implements ShouldQueue
|
|||||||
->join('systems',['systems.id'=>'a.system_id'])
|
->join('systems',['systems.id'=>'a.system_id'])
|
||||||
->join('zones',['zones.id'=>'a.zone_id'])
|
->join('zones',['zones.id'=>'a.zone_id'])
|
||||||
->join('domains',['domains.id'=>'zones.domain_id'])
|
->join('domains',['domains.id'=>'zones.domain_id'])
|
||||||
->where(function($query) {
|
|
||||||
return $query->whereNull('autohold')
|
|
||||||
->orWhere('autohold',FALSE);
|
|
||||||
})
|
|
||||||
->when(! is_null($this->crash),function($query) {
|
|
||||||
return $query->when(
|
|
||||||
$this->crash,
|
|
||||||
function($query) {
|
|
||||||
return $query->where('pollmode',$this->crash);
|
|
||||||
},
|
|
||||||
function($query) {
|
|
||||||
return $query->whereNotNull('pollmode');
|
|
||||||
}
|
|
||||||
);
|
|
||||||
})
|
|
||||||
->groupBy('a.system_id','a.id','a.zone_id','addresses.region_id','a.host_id','a.node_id','a.point_id','addresses.hub_id','addresses.role')
|
->groupBy('a.system_id','a.id','a.zone_id','addresses.region_id','a.host_id','a.node_id','a.point_id','addresses.hub_id','addresses.role')
|
||||||
->with(['system','zone.domain'])
|
->with(['system','zone.domain'])
|
||||||
->dontCache()
|
->dontCache()
|
||||||
@ -80,6 +65,13 @@ class MailSend #implements ShouldQueue
|
|||||||
} else {
|
} else {
|
||||||
return $item;
|
return $item;
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
->filter(function($item) {
|
||||||
|
if ($item->ftn3d === '1337:1/100') dump(['item'=>$item,'ftn'=>$item->ftn,'autohold'=>$item->system->authold,'pollmode'=>$item->system->pollmode,'crash'=>$this->crash]);
|
||||||
|
if ($item->system->autohold)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return is_null($this->crash) || ($item->system->pollmode) || ($item->system->pollmode === $this->crash) ? $item : NULL;
|
||||||
});
|
});
|
||||||
|
|
||||||
foreach ($u->groupBy('ftn') as $oo) {
|
foreach ($u->groupBy('ftn') as $oo) {
|
||||||
|
@ -51,6 +51,7 @@ abstract class Netmails extends Notification //implements ShouldQueue
|
|||||||
{
|
{
|
||||||
// @todo Redirect netmails to Hubs or higher to the admin
|
// @todo Redirect netmails to Hubs or higher to the admin
|
||||||
$ao = $notifiable->routeNotificationFor(static::via);
|
$ao = $notifiable->routeNotificationFor(static::via);
|
||||||
|
$ao->load('system');
|
||||||
|
|
||||||
$o = new Netmail;
|
$o = new Netmail;
|
||||||
$o->to = $ao->system->sysop;
|
$o->to = $ao->system->sysop;
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
namespace App\Traits;
|
namespace App\Traits;
|
||||||
|
|
||||||
use Illuminate\Support\Arr;
|
use Illuminate\Support\Arr;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
use App\Classes\FTN\Message;
|
use App\Classes\FTN\Message;
|
||||||
use App\Models\Setup;
|
|
||||||
|
|
||||||
trait MsgID
|
trait MsgID
|
||||||
{
|
{
|
||||||
@ -18,6 +18,8 @@ trait MsgID
|
|||||||
if ((! $this->exists) && ($this->flags & Message::FLAG_LOCAL) && (is_null(Arr::get($this->attributes,'msgid')))) {
|
if ((! $this->exists) && ($this->flags & Message::FLAG_LOCAL) && (is_null(Arr::get($this->attributes,'msgid')))) {
|
||||||
$ftn = our_address($this->fftn);
|
$ftn = our_address($this->fftn);
|
||||||
$this->attributes['msgid'] = sprintf('%s %08x',$ftn->ftn4d,timew());
|
$this->attributes['msgid'] = sprintf('%s %08x',$ftn->ftn4d,timew());
|
||||||
|
|
||||||
|
Log::debug(sprintf('%s:- Auto setting msgid to [%s]',self::LOGKEY,$this->attributes['msgid']));
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent::save($options);
|
return parent::save($options);
|
||||||
|
Loading…
Reference in New Issue
Block a user