pion  5.0.6
Public Member Functions | Protected Types | Protected Attributes | List of all members
pion::user_manager Class Reference

#include <user.hpp>

Inherits noncopyable.

Public Member Functions

 user_manager (void)
 construct a new user_manager object
 
virtual ~user_manager ()
 virtual destructor
 
bool empty (void) const
 returns true if no users are defined
 
virtual bool add_user (const std::string &username, const std::string &password)
 
virtual bool update_user (const std::string &username, const std::string &password)
 
virtual bool remove_user (const std::string &username)
 
virtual user_ptr get_user (const std::string &username)
 
virtual user_ptr get_user (const std::string &username, const std::string &password)
 

Protected Types

typedef std::map< std::string, user_ptr > user_map_t
 data type for a map of usernames to user objects
 

Protected Attributes

boost::mutex m_mutex
 mutex used to protect access to the user list
 
user_map_t m_users
 user records container
 

Detailed Description

user_manager base class for user container/manager

Definition at line 167 of file user.hpp.

Member Function Documentation

virtual bool pion::user_manager::add_user ( const std::string &  username,
const std::string &  password 
)
inlinevirtual

used to add a new user with plaintext password

Parameters
usernamename or identifier of the user to add
passwordplaintext password of the user to add
Returns
false if user with such a name already exists

Definition at line 192 of file user.hpp.

References m_mutex, and m_users.

virtual user_ptr pion::user_manager::get_user ( const std::string &  username)
inlinevirtual

Used to locate user object by username

Definition at line 282 of file user.hpp.

References m_mutex, and m_users.

virtual user_ptr pion::user_manager::get_user ( const std::string &  username,
const std::string &  password 
)
inlinevirtual

Used to locate user object by username and password

Definition at line 294 of file user.hpp.

References m_mutex, and m_users.

virtual bool pion::user_manager::remove_user ( const std::string &  username)
inlinevirtual

used to remove given user

Returns
false if no user with such username

Definition at line 270 of file user.hpp.

References m_mutex, and m_users.

virtual bool pion::user_manager::update_user ( const std::string &  username,
const std::string &  password 
)
inlinevirtual

update password for given user

Parameters
usernamename or identifier of the user to update
passwordplaintext password of the user to update
Returns
false if user with such a name doesn't exist

Definition at line 212 of file user.hpp.

References m_mutex, and m_users.


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