Refactor PeerDatabaseRecord and SessionManager to handle ReservedUsernames and improve date handling

This commit is contained in:
netkas 2025-03-19 15:06:59 -04:00
parent 6a1aa6b353
commit a92391445a
Signed by: netkas
GPG key ID: 4D8629441B76E4CC
3 changed files with 35 additions and 14 deletions

View file

@ -54,13 +54,14 @@
// TODO: Update this to support `host` peers
if($peer->isExternal())
{
Logger::getLogger()->debug('Creating a session for an external peer');
$flags[] = SessionFlags::AUTHENTICATION_REQUIRED;
$flags[] = SessionFlags::VER_AUTHENTICATION;
}
else if($peer->isEnabled())
{
Logger::getLogger()->debug('Creating a session for an enabled peer');
$flags[] = SessionFlags::AUTHENTICATION_REQUIRED;
if(PasswordManager::usesPassword($peer->getUuid()))
{
$flags[] = SessionFlags::VER_PASSWORD;
@ -73,6 +74,7 @@
}
else
{
Logger::getLogger()->debug('Creating a session for a disabled peer');
$flags[] = SessionFlags::REGISTRATION_REQUIRED;
if(Configuration::getRegistrationConfiguration()->isDisplayNameRequired())