Compare commits
No commits in common. "d3a9e36bb7b2a0e3c3b9ffbf7b88a577eaf90688" and "db8475053c08c1b7f20349cf294831b99e916f67" have entirely different histories.
d3a9e36bb7
...
db8475053c
@ -38,7 +38,6 @@ class Node
|
||||
private Collection $ftns_authed; // The FTNs we have validated
|
||||
private Collection $ftns_other; // Other FTN addresses presented
|
||||
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
|
||||
|
||||
@ -85,9 +84,9 @@ class Node
|
||||
|
||||
// The nodes password
|
||||
case 'password':
|
||||
// If we are originating a session, we'll use that password.
|
||||
if (isset($this->originate))
|
||||
return $this->originate->pass_session;
|
||||
// If we have already authed, we'll use that password.
|
||||
if ($this->ftns_authed->count())
|
||||
return $this->ftns_authed->first()->pass_session;
|
||||
else
|
||||
return ($this->ftns->count() && ($x=$this->ftns->first()->pass_session)) ? $x : '-';
|
||||
|
||||
@ -195,8 +194,6 @@ class Node
|
||||
throw new Exception('Already authed');
|
||||
|
||||
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)
|
||||
continue;
|
||||
|
||||
@ -272,8 +269,7 @@ class Node
|
||||
*/
|
||||
public function originate(Address $o): void
|
||||
{
|
||||
$this->originate = $o;
|
||||
$this->ftns_authed = $o->system->match($o->zone);
|
||||
$this->ftns_authed->push($o);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -287,9 +283,19 @@ class Node
|
||||
if ($this->authed)
|
||||
return TRUE;
|
||||
|
||||
Log::debug(sprintf('%s:- Making sure we called [%s] from [%s]',self::LOGKEY,$this->originate->ftn,$this->ftns->pluck('ftn')->join(',')));
|
||||
if ($this->ftns_authed->count() !== 1 || ! $this->ftns->count())
|
||||
return FALSE;
|
||||
|
||||
return $this->ftns->pluck('ftn')->contains($this->originate->ftn);
|
||||
$ftn = $this->ftns_authed->first()->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
|
||||
|
@ -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
|
||||
} elseif (is_null(our_address($o))) {
|
||||
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(',')));
|
||||
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(',')));
|
||||
|
||||
$this->node->ftn_other = $rem_aka;
|
||||
continue;
|
||||
|
@ -48,6 +48,21 @@ class MailSend #implements ShouldQueue
|
||||
->join('systems',['systems.id'=>'a.system_id'])
|
||||
->join('zones',['zones.id'=>'a.zone_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')
|
||||
->with(['system','zone.domain'])
|
||||
->dontCache()
|
||||
@ -65,13 +80,6 @@ class MailSend #implements ShouldQueue
|
||||
} else {
|
||||
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) {
|
||||
|
@ -51,7 +51,6 @@ abstract class Netmails extends Notification //implements ShouldQueue
|
||||
{
|
||||
// @todo Redirect netmails to Hubs or higher to the admin
|
||||
$ao = $notifiable->routeNotificationFor(static::via);
|
||||
$ao->load('system');
|
||||
|
||||
$o = new Netmail;
|
||||
$o->to = $ao->system->sysop;
|
||||
|
@ -6,9 +6,9 @@
|
||||
namespace App\Traits;
|
||||
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
use App\Classes\FTN\Message;
|
||||
use App\Models\Setup;
|
||||
|
||||
trait MsgID
|
||||
{
|
||||
@ -18,8 +18,6 @@ trait MsgID
|
||||
if ((! $this->exists) && ($this->flags & Message::FLAG_LOCAL) && (is_null(Arr::get($this->attributes,'msgid')))) {
|
||||
$ftn = our_address($this->fftn);
|
||||
$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);
|
||||
|
Loading…
Reference in New Issue
Block a user