The Pedigree Project  0.1
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
UserManager Class Reference

#include <UserManager.h>

+ Collaboration diagram for UserManager:

Public Member Functions

void initialise ()
 
UsergetUser (size_t id)
 
UsergetUser (String name)
 
GroupgetGroup (size_t id)
 
GroupgetGroup (String name)
 

Static Public Member Functions

static UserManagerinstance ()
 

Private Member Functions

 UserManager ()
 
 UserManager (const UserManager &)
 
UserManageroperator= (const UserManager &)
 
void initialiseUsers ()
 
void initialiseGroups ()
 
void addUser (size_t uid, String username, String fullName, String group, String home, String shell, String password)
 
void addGroup (size_t gid, String name)
 

Private Attributes

Tree< size_t, User * > m_Users
 
Tree< size_t, Group * > m_Groups
 

Static Private Attributes

static UserManager m_Instance
 

Detailed Description

The user manager - this allows lookups of users and groups, and also parses the initial file "root:/config/users".

Definition at line 30 of file UserManager.h.

Constructor & Destructor Documentation

UserManager::UserManager ( )
private

Member Function Documentation

Group * UserManager::getGroup ( size_t  id)

Look up a group by ID.

Definition at line 105 of file UserManager.cc.

References Tree< K, E >::lookup(), and m_Groups.

Referenced by getGroup(), and WaitCleanup::terminated().

+ Here is the caller graph for this function:

Group * UserManager::getGroup ( String  name)
User * UserManager::getUser ( size_t  id)

Look up a user by ID.

Definition at line 88 of file UserManager.cc.

References Tree< K, E >::lookup(), and m_Users.

Referenced by getGroup(), initialise(), and WaitCleanup::terminated().

+ Here is the caller graph for this function:

User * UserManager::getUser ( String  name)

Look up a user by name.

Definition at line 93 of file UserManager.cc.

References Tree< K, E >::begin(), Tree< K, E >::end(), User::getUsername(), and m_Users.

void UserManager::initialise ( )

Reads in the file "root:/config/users".

Definition at line 170 of file UserManager.cc.

References FATAL, User::getDefaultGroup(), getUser(), Processor::information(), initialise(), instance(), Process::setGroup(), and Process::setUser().

Referenced by initialise().

+ Here is the caller graph for this function:

static UserManager& UserManager::instance ( )
inlinestatic

Get the singleton instance.

Definition at line 34 of file UserManager.h.

Referenced by initialise(), and WaitCleanup::terminated().

+ Here is the caller graph for this function:

Member Data Documentation

Tree<size_t, Group *> UserManager::m_Groups
private

Dictionary of groups, indexed by ID.

Definition at line 69 of file UserManager.h.

Referenced by getGroup().

Tree<size_t, User *> UserManager::m_Users
private

Dictionary of users, indexed by ID.

Definition at line 67 of file UserManager.h.

Referenced by getGroup(), and getUser().


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