Update and display last seen for systems
This commit is contained in:
@@ -159,8 +159,11 @@ class Node
|
||||
// If we have challenge, then we are doing MD5
|
||||
$exp_pwd = $challenge ? $this->md5_challenge($o->session('sespass'),$challenge) : $o->session('sespass');
|
||||
|
||||
if ($exp_pwd === $password)
|
||||
if ($exp_pwd === $password) {
|
||||
$o->system->last_session = Carbon::now();
|
||||
$o->system->save();
|
||||
$this->ftns_authed->push($o);
|
||||
}
|
||||
}
|
||||
|
||||
Log::debug(sprintf('%s: = End [%d]',__METHOD__,$this->ftns_authed->count()));
|
||||
@@ -227,7 +230,11 @@ class Node
|
||||
$ftn = $this->ftns_authed->first()->ftn;
|
||||
|
||||
return $this->ftns->search(function($item) use ($ftn) {
|
||||
return $item->ftn == $ftn;
|
||||
if ($item->ftn == $ftn) {
|
||||
$item->system->last_session = Carbon::now();
|
||||
$item->system->save();
|
||||
return TRUE;
|
||||
}
|
||||
}) !== FALSE;
|
||||
}
|
||||
|
||||
|
@@ -1027,6 +1027,8 @@ final class Binkp extends BaseProtocol
|
||||
}
|
||||
|
||||
/**
|
||||
* Remote accepted our password
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
private function M_ok(string $buf): int
|
||||
|
@@ -12,6 +12,8 @@ class System extends Model
|
||||
{
|
||||
use HasFactory,ScopeActive;
|
||||
|
||||
protected $dates = ['last_session'];
|
||||
|
||||
/* RELATIONS */
|
||||
|
||||
public function addresses()
|
||||
|
Reference in New Issue
Block a user