Wittyshare  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WsAuthenticator.h
Go to the documentation of this file.
1 /*
2  *
3  * Filename: WsAuthenticator.h
4  *
5  * Description: Handles connection of user
6  *
7  * Created: 02/15/12 12:37:55
8  *
9  * Author: Benoit Daccache, ben.daccache@gmail.com
10  *
11  */
12 
13 #ifndef WS_AUTHENTICATOR_H__
14 #define WS_AUTHENTICATOR_H__
15 
16 #include <iostream>
17 #include <set>
18 
19 #include "WsAbstractAuth.h"
20 
27 
28 public:
29 
34 
39 
47  int authentify(const std::string& uid, const std::string& pass = "", const std::string& ip = "");
48 
53  std::string getUid();
54 
59  std::string getFirstName();
60 
65  std::string getSurname();
66 
71  std::string getEmail();
72 
77  std::set<std::string> getUserGroups();
78 
83  std::set<std::string> getAllGroups();
84 
85 private:
90  int loadModule();
91 
93  std::string m_uid;
94  std::string m_pass;
95  std::string m_ip;
96 
97 
98 
99 };
100 
101 typedef WsAbstractAuth* (*pf_wsAuthMod) ();
102 #endif
std::string getUid()
return the user uid WsAuthenticator::authentify must be called before
std::string getSurname()
return the user surname WsAuthenticator::authentify must be called before
~WsAuthenticator()
Destructor.
std::string getEmail()
return the user email WsAuthenticator::authentify must be called before
Loads Authentification module and acts as an interface.
std::string m_ip
WsAuthenticator()
Constructor.
WsAbstractAuth * m_auth
int loadModule()
loads the module and casts it as WsAbstractAuth object
std::set< std::string > getUserGroups()
return the user groups WsAuthenticator::authentify must be called before
std::set< std::string > getAllGroups()
return all the possible groups WsAuthenticator::authentify must be called before
std::string m_uid
std::string m_pass
Abstract class for authentification.
int authentify(const std::string &uid, const std::string &pass="", const std::string &ip="")
authentify the user.
std::string getFirstName()
return the user name WsAuthenticator::authentify must be called before