Update and display last seen for systems

This commit is contained in:
Deon George
2021-07-04 23:24:38 +10:00
parent acfde97e79
commit c8447d8573
5 changed files with 19 additions and 15 deletions

View File

@@ -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;
}

View File

@@ -1027,6 +1027,8 @@ final class Binkp extends BaseProtocol
}
/**
* Remote accepted our password
*
* @throws Exception
*/
private function M_ok(string $buf): int