QAuthManager Class Reference

List of all members.


Detailed Description

process level authentication manager (singleton)

Author:
Sergio Di Domizio

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 QAuthManagerGetInstance ()
 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 QAuthManagergMe = NULL

Member Function Documentation

QApolloUserLevel QAuthManager::Authenticate ( const std::string &  user,
std::string &  pw 
)

check user/password pair against db

Returns:
authentication level
password is reset at each call to this method

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)

Parameters:
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().


Member Data Documentation

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().

level of last successful authentication

Referenced by Authenticate().


The documentation for this class was generated from the following files:

Generated on Tue Nov 16 10:50:04 2010 for CUORE Software by  doxygen 1.5.6