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

Reprensents a User session. More...

#include <WsUserSession.h>

Collaboration diagram for WsUserSession:
Collaboration graph

Public Member Functions

 WsUserSession (const std::string &uid, const std::string &pass="", const std::string &ip="")
 Constructor. More...
 
const std::set< std::string > & getGroups ()
 get the groups belonging to the user More...
 
const std::string & getName ()
 
const std::string & getSurname ()
 
const std::string & getEmail ()
 
void setGroups (const std::set< std::string > &groups)
 sets the groups of a user More...
 
void setName (const std::string &name)
 set the name of the user More...
 
void setSurname (const std::string &surname)
 set the surname of the user More...
 
void setEmail (const std::string &email)
 set the email of the user More...
 
bool isValidSession (const std::string &uid, const std::string &pass, const std::string &ip)
 returns true or false whether the session is valid More...
 

Protected Attributes

std::string m_uid
 
std::string m_pass
 
std::string m_ip
 
std::string m_name
 
std::string m_surname
 
std::string m_email
 
std::set< std::string > m_groups
 
long m_timestamp
 

Private Member Functions

long getNowTimestamp ()
 returns the time.now() More...
 

Detailed Description

Reprensents a User session.

This class is instanciated when a user first connects to the daemon to authenticate

Definition at line 27 of file WsUserSession.h.

Constructor & Destructor Documentation

WsUserSession::WsUserSession ( const std::string &  uid,
const std::string &  pass = "",
const std::string &  ip = "" 
)

Constructor.

Parameters
uidthe user id
passoptionnal password
ipoptionnal ip of the user

Definition at line 19 of file WsUserSession.cpp.

Here is the call graph for this function:

Member Function Documentation

const string & WsUserSession::getEmail ( )
Returns
the user's email

Definition at line 62 of file WsUserSession.cpp.

Here is the caller graph for this function:

const set< string > & WsUserSession::getGroups ( )

get the groups belonging to the user

Returns
a set of gid or empty set if no groups

Definition at line 27 of file WsUserSession.cpp.

const string & WsUserSession::getName ( )
Returns
the user's name

Definition at line 52 of file WsUserSession.cpp.

Here is the caller graph for this function:

long WsUserSession::getNowTimestamp ( )
private

returns the time.now()

Definition at line 44 of file WsUserSession.cpp.

Here is the caller graph for this function:

const string & WsUserSession::getSurname ( )
Returns
the user's surname

Definition at line 57 of file WsUserSession.cpp.

Here is the caller graph for this function:

bool WsUserSession::isValidSession ( const std::string &  uid,
const std::string &  pass,
const std::string &  ip 
)

returns true or false whether the session is valid

Returns
true if session valid, false otherwise
Parameters
uiduser id
passthe password
ipthe ip

Definition at line 37 of file WsUserSession.cpp.

Here is the call graph for this function:

void WsUserSession::setEmail ( const std::string &  email)

set the email of the user

Parameters
emailthe email

Definition at line 77 of file WsUserSession.cpp.

Here is the caller graph for this function:

void WsUserSession::setGroups ( const std::set< std::string > &  groups)

sets the groups of a user

Parameters
groupsa set of gids

Definition at line 32 of file WsUserSession.cpp.

Here is the caller graph for this function:

void WsUserSession::setName ( const std::string &  name)

set the name of the user

Parameters
namethe name

Definition at line 67 of file WsUserSession.cpp.

Here is the caller graph for this function:

void WsUserSession::setSurname ( const std::string &  surname)

set the surname of the user

Parameters
surnamethe surname

Definition at line 72 of file WsUserSession.cpp.

Here is the caller graph for this function:

Member Data Documentation

std::string WsUserSession::m_email
protected

Definition at line 98 of file WsUserSession.h.

std::set<std::string> WsUserSession::m_groups
protected

Definition at line 99 of file WsUserSession.h.

std::string WsUserSession::m_ip
protected

Definition at line 95 of file WsUserSession.h.

std::string WsUserSession::m_name
protected

Definition at line 96 of file WsUserSession.h.

std::string WsUserSession::m_pass
protected

Definition at line 94 of file WsUserSession.h.

std::string WsUserSession::m_surname
protected

Definition at line 97 of file WsUserSession.h.

long WsUserSession::m_timestamp
protected

Definition at line 100 of file WsUserSession.h.

std::string WsUserSession::m_uid
protected

Definition at line 93 of file WsUserSession.h.


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