Wittyshare  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
WsLdapAuth Class Reference

Ldap authentication module. More...

#include <WsLdapAuth.h>

Inheritance diagram for WsLdapAuth:
Inheritance graph
Collaboration diagram for WsLdapAuth:
Collaboration graph

Public Types

enum  loadStatus { notLoaded = 1, loaded, onError }
 

Public Member Functions

 WsLdapAuth ()
 Constructor. More...
 
int authentify (const std::string &uid, const std::string &pass="", const std::string &ip="")
 authenticate the user by retrieving his info from ldap More...
 
std::string getUid ()
 Get the uid of the user. More...
 
std::string getFirstName ()
 Get the first name of the user. More...
 
std::string getSurname ()
 Get the surname of the user. More...
 
std::string getEmail ()
 Get the email of the user. More...
 
std::set< std::string > getUserGroups ()
 get the groups of the user More...
 
std::set< std::string > getAllGroups ()
 get all the groups in the ldap More...
 

Protected Member Functions

bool ipValid (std::string ip)
 return true or false whether the ip is valid (ie match the mask in the configuration file More...
 

Private Attributes

std::string m_uid
 
std::string m_name
 
std::string m_surname
 
std::string m_email
 
std::string m_dn
 
std::string m_ip
 
std::set< std::string > m_groups
 
std::set< std::string > m_allGroups
 
WsGlobalPropertiesm_properties
 
loadStatus m_ldapStatus
 

Detailed Description

Ldap authentication module.

Definition at line 28 of file WsLdapAuth.h.

Member Enumeration Documentation

Enumerator
notLoaded 
loaded 
onError 

Definition at line 30 of file WsLdapAuth.h.

Constructor & Destructor Documentation

WsLdapAuth::WsLdapAuth ( )

Constructor.

Definition at line 31 of file WsLdapAuth.cpp.

Member Function Documentation

int WsLdapAuth::authentify ( const std::string &  uid,
const std::string &  pass = "",
const std::string &  ip = "" 
)
virtual

authenticate the user by retrieving his info from ldap

Parameters
uidthe uid of the user
passthe password of the user
ipthe ip of the user
Returns
SUCCESS or FAILURE

Implements WsAbstractAuth.

Definition at line 36 of file WsLdapAuth.cpp.

Here is the call graph for this function:

set< string > WsLdapAuth::getAllGroups ( )
virtual

get all the groups in the ldap

Reimplemented from WsAbstractAuth.

Definition at line 182 of file WsLdapAuth.cpp.

Here is the call graph for this function:

string WsLdapAuth::getEmail ( )
virtual

Get the email of the user.

Reimplemented from WsAbstractAuth.

Definition at line 172 of file WsLdapAuth.cpp.

string WsLdapAuth::getFirstName ( )
virtual

Get the first name of the user.

Returns
a std::string containing the name

Reimplemented from WsAbstractAuth.

Definition at line 162 of file WsLdapAuth.cpp.

string WsLdapAuth::getSurname ( )
virtual

Get the surname of the user.

Returns
the surname of the user

Reimplemented from WsAbstractAuth.

Definition at line 167 of file WsLdapAuth.cpp.

string WsLdapAuth::getUid ( )
virtual

Get the uid of the user.

Returns
a std::string containing the uid

Implements WsAbstractAuth.

Definition at line 157 of file WsLdapAuth.cpp.

set< string > WsLdapAuth::getUserGroups ( )
virtual

get the groups of the user

Reimplemented from WsAbstractAuth.

Definition at line 177 of file WsLdapAuth.cpp.

bool WsLdapAuth::ipValid ( std::string  ip)
protected

return true or false whether the ip is valid (ie match the mask in the configuration file

Parameters
ipthe ip

Definition at line 220 of file WsLdapAuth.cpp.

Here is the call graph for this function:

Member Data Documentation

std::set<std::string> WsLdapAuth::m_allGroups
private

Definition at line 99 of file WsLdapAuth.h.

std::string WsLdapAuth::m_dn
private

Definition at line 96 of file WsLdapAuth.h.

std::string WsLdapAuth::m_email
private

Definition at line 95 of file WsLdapAuth.h.

std::set<std::string> WsLdapAuth::m_groups
private

Definition at line 98 of file WsLdapAuth.h.

std::string WsLdapAuth::m_ip
private

Definition at line 97 of file WsLdapAuth.h.

loadStatus WsLdapAuth::m_ldapStatus
private

Definition at line 101 of file WsLdapAuth.h.

std::string WsLdapAuth::m_name
private

Definition at line 93 of file WsLdapAuth.h.

WsGlobalProperties* WsLdapAuth::m_properties
private

Definition at line 100 of file WsLdapAuth.h.

std::string WsLdapAuth::m_surname
private

Definition at line 94 of file WsLdapAuth.h.

std::string WsLdapAuth::m_uid
private

Definition at line 92 of file WsLdapAuth.h.


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