QAuthManager.hh

Go to the documentation of this file.
00001 
00002 #ifndef _Q_AUTH_MANAGER_HH_
00003 #define _Q_AUTH_MANAGER_HH_
00004 
00005 #include "QCuore.hh"
00006 #include "QApolloDbDefs.hh"
00007 
00008 #include <string>
00014 class QAuthManager
00015 {
00016 public:
00017    
00019    static QAuthManager& GetInstance();
00020 
00022    virtual ~QAuthManager();
00023 
00030    QApolloUserLevel Authenticate(const std::string& user,
00031                                  std::string& pw);
00032 
00040    void SetTimeoutSec(Int_t timeoutSec) { fTimeoutSec = timeoutSec; }
00041 
00043    std::string HashMD5(const std::string& src) const;
00044 
00046    Bool_t IsAuthenticated() const { return !(TimeoutExpired()); }
00047 
00048 private:
00050    QAuthManager();
00051       
00052    static QAuthManager *gMe; 
00053    Int_t fTimeoutSec; 
00054    std::string fAuthUser; 
00055    time_t fAuthTimeUnix; 
00056    QApolloUserLevel fAuthLevel; 
00059    void UpdateTimeout();
00060    
00062    Bool_t TimeoutExpired() const;
00063 };
00064 #endif

Generated on Tue Nov 16 10:49:54 2010 for CUORE Software by  doxygen 1.5.6