# pion::user_manager Class Reference

`#include <user.hpp>`

List of all members.

## 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 | add_user_hash (const std::string &username, const std::string &password_hash)
virtual bool | update_user_hash (const std::string &username, const std::string &password_hash)
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 143 of file user.hpp.

## Member Function Documentation

virtual bool pion::user_manager::add_user | ( | const std::string & | username,
|  | const std::string & | password |
| ) |  |  | `[inline, virtual]`

used to add a new user with plaintext password

Parameters:

  | username | name or identifier of the user to add
  | password | plaintext password of the user to add

Returns:
  false if user with such a name already exists

Definition at line 168 of file user.hpp.

virtual bool pion::user_manager::add_user_hash | ( | const std::string & | username,
|  | const std::string & | password_hash |
| ) |  |  | `[inline, virtual]`

used to add a new user with encrypted password

Parameters:

  | username | name or identifier of the user to add
  | password_hash | encrypted password of the user to add

Returns:
  false if user with such a name already exists

Definition at line 208 of file user.hpp.

virtual user_ptr pion::user_manager::get_user | ( | const std::string & | username,
|  | const std::string & | password |
| ) |  |  | `[inline, virtual]`

Used to locate user object by username and password

Definition at line 270 of file user.hpp.

virtual user_ptr pion::user_manager::get_user | ( | const std::string & | username | ) | `[inline, virtual]`

Used to locate user object by username

Definition at line 258 of file user.hpp.

virtual bool pion::user_manager::remove_user | ( | const std::string & | username | ) | `[inline, virtual]`

used to remove given user

Returns:
  false if no user with such username

Definition at line 246 of file user.hpp.

virtual bool pion::user_manager::update_user | ( | const std::string & | username,
|  | const std::string & | password |
| ) |  |  | `[inline, virtual]`

update password for given user

Parameters:

  | username | name or identifier of the user to update
  | password | plaintext password of the user to update

Returns:
  false if user with such a name doesn't exist

Definition at line 188 of file user.hpp.

virtual bool pion::user_manager::update_user_hash | ( | const std::string & | username,
|  | const std::string & | password_hash |
| ) |  |  | `[inline, virtual]`

update password for given user with encrypted password

Parameters:

  | username | name or identifier of the user to update
  | password_hash | encrypted password of the user to update

Returns:
  false if user with such a name doesn't exist

Definition at line 229 of file user.hpp.

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

- include/pion/user.hpp