Public Member Functions | |
virtual | ~QAuthManager () |
dtor | |
QApolloUserLevel | Authenticate (const std::string &user, std::string &pw) |
check user/password pair against db | |
void | SetTimeoutSec (Int_t timeoutSec) |
set authentication timeout (i.e. how long the auth will last) | |
std::string | HashMD5 (const std::string &src) const |
evaluate md5 hash of src string | |
Bool_t | IsAuthenticated () const |
check whether authentication is still valid | |
Static Public Member Functions | |
static QAuthManager & | GetInstance () |
singleton getter | |
Private Member Functions | |
QAuthManager () | |
ctor | |
void | UpdateTimeout () |
update athentication expiry time | |
Bool_t | TimeoutExpired () const |
check whether timeout expired | |
Private Attributes | |
Int_t | fTimeoutSec |
std::string | fAuthUser |
time_t | fAuthTimeUnix |
QApolloUserLevel | fAuthLevel |
Static Private Attributes | |
static QAuthManager * | gMe = NULL |
QApolloUserLevel QAuthManager::Authenticate | ( | const std::string & | user, | |
std::string & | pw | |||
) |
check user/password pair against db
References fAuthLevel, fAuthUser, QApolloDb::GetPasswordHash(), QApolloDb::GetUserLevel(), HashMD5(), InvalidLevel, TimeoutExpired(), and UpdateTimeout().
Referenced by QGuiUserAdd::Authenticate(), QGuiControlWindow::Authenticate(), and QGuiControlWindow::UpdateAuth().
void QAuthManager::SetTimeoutSec | ( | Int_t | timeoutSec | ) | [inline] |
set authentication timeout (i.e. how long the auth will last)
timeoutSec | if positive, the authentication will last the specified amount of time in seconds. If zero, authentication will expire immediately. If negative, authentication won't expire. Defaults to zero. |
References fTimeoutSec.
Referenced by QGuiControlWindow::QGuiControlWindow().
QAuthManager * QAuthManager::gMe = NULL [static, private] |
ptr to this object
Referenced by GetInstance().
Int_t QAuthManager::fTimeoutSec [private] |
auth timeout -- see doc for SetTimeoutSec()
Referenced by SetTimeoutSec(), and TimeoutExpired().
std::string QAuthManager::fAuthUser [private] |
username of last successful authentication
Referenced by Authenticate().
time_t QAuthManager::fAuthTimeUnix [private] |
unix time of last successful authentication
Referenced by TimeoutExpired(), and UpdateTimeout().
QApolloUserLevel QAuthManager::fAuthLevel [private] |
level of last successful authentication
Referenced by Authenticate().