mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-08 03:35:35 +08:00
refs #485, renamed the trait for authenticated user to AuthenticatedDbUser
* there is no single authenticated user, this one has a specific usage * adjusted classed * formatting
This commit is contained in:
committed by
Mathew Sutcliffe
parent
f27d130df9
commit
55a0ab7b48
@@ -20,11 +20,12 @@ namespace BlackCore
|
||||
{
|
||||
namespace Data
|
||||
{
|
||||
//! Trait for for global setup data
|
||||
struct AuthenticatedUser : public BlackMisc::CDataTrait<BlackMisc::Network::CAuthenticatedUser>
|
||||
//! Trait for for global cached DB user.
|
||||
//! This user has authenticated with the swift DB.
|
||||
struct AuthenticatedDbUser : public BlackMisc::CDataTrait<BlackMisc::Network::CAuthenticatedUser>
|
||||
{
|
||||
//! Key in data cache
|
||||
static const char *key() { return "readers/global/user"; }
|
||||
static const char *key() { return "dbuser"; }
|
||||
|
||||
//! Default value
|
||||
static const BlackMisc::Network::CAuthenticatedUser &defaultValue()
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace BlackCore
|
||||
url.setQuery("logoff=true");
|
||||
QNetworkRequest request(CNetworkUtils::getNetworkRequest(url));
|
||||
sApp->getFromNetwork(request, { this, &CDatabaseAuthenticationService::ps_parseServerResponse });
|
||||
this->m_user.set(CAuthenticatedUser());
|
||||
this->m_swiftDbUser.set(CAuthenticatedUser());
|
||||
}
|
||||
|
||||
void CDatabaseAuthenticationService::ps_parseServerResponse(QNetworkReply *nwReplyPtr)
|
||||
@@ -124,7 +124,7 @@ namespace BlackCore
|
||||
msgs.push_back(CStatusMessage(cats, CStatusMessage::SeverityError, "User has no roles"));
|
||||
}
|
||||
}
|
||||
this->m_user.set(user);
|
||||
this->m_swiftDbUser.set(user);
|
||||
emit userAuthenticationFinished(user, msgs);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -59,8 +59,8 @@ namespace BlackCore
|
||||
void ps_userChanged();
|
||||
|
||||
private:
|
||||
BlackMisc::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< data cache
|
||||
BlackMisc::CData<BlackCore::Data::AuthenticatedUser> m_user {this, &CDatabaseAuthenticationService::ps_userChanged};
|
||||
BlackMisc::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< data cache
|
||||
BlackMisc::CData<BlackCore::Data::AuthenticatedDbUser> m_swiftDbUser {this, &CDatabaseAuthenticationService::ps_userChanged};
|
||||
bool m_shutdown = false;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user