The Pedigree Project
0.1
|
#include <User.h>
Public Member Functions | |
User (size_t uid, String username, String fullName, Group *pGroup, String home, String shell, String password) | |
virtual | ~User () |
void | join (Group *pGroup) |
void | leave (Group *pGroup) |
bool | isMember (Group *pGroup) |
bool | login (String password) |
size_t | getId () |
String | getUsername () |
String | getFullName () |
Group * | getDefaultGroup () |
String | getHome () |
String | getShell () |
Private Member Functions | |
User () | |
User (const User &) | |
User & | operator= (const User &) |
Private Attributes | |
size_t | m_Uid |
String | m_Username |
String | m_FullName |
Group * | m_pDefaultGroup |
String | m_Home |
String | m_Shell |
String | m_Password |
List< Group * > | m_Groups |
User::User | ( | size_t | uid, |
String | username, | ||
String | fullName, | ||
Group * | pGroup, | ||
String | home, | ||
String | shell, | ||
String | password | ||
) |
Constructor
uid | The user's system-wide unique ID. |
name | The user's username. |
fullName | The user's full name. |
pGroup | The default group. |
home | The user's home directory. |
shell | The user's default shell. |
password | Password hash. |
|
private |
It doesn't make sense for a User to have a default or copy constructor.
|
inline |
Retrieves the user's default group.
Definition at line 81 of file User.h.
Referenced by UserManager::initialise(), and WaitCleanup::terminated().
|
inline |
Retrieves the user's full name.
Definition at line 76 of file User.h.
Referenced by WaitCleanup::terminated().
|
inline |
Retrieves the user's home directory.
Definition at line 86 of file User.h.
Referenced by WaitCleanup::terminated().
|
inline |
Retrieves the user's UID.
Definition at line 66 of file User.h.
Referenced by ProcFs::addProcess(), Process::getUserId(), and WaitCleanup::terminated().
|
inline |
Retrieves the user's default shell.
Definition at line 91 of file User.h.
Referenced by WaitCleanup::terminated().
|
inline |
Retrieves the user's username.
Definition at line 71 of file User.h.
Referenced by UserManager::getUser(), and WaitCleanup::terminated().
bool User::isMember | ( | Group * | pGroup | ) |
Queries a group membership.
Definition at line 59 of file User.cc.
References List< T, nodePoolSize >::begin(), List< T, nodePoolSize >::end(), m_Groups, and m_pDefaultGroup.
void User::join | ( | Group * | pGroup | ) |
Adds a group membership.
Definition at line 41 of file User.cc.
References m_Groups, and List< T, nodePoolSize >::pushBack().
void User::leave | ( | Group * | pGroup | ) |
Removes a group membership.
Definition at line 46 of file User.cc.
References List< T, nodePoolSize >::begin(), List< T, nodePoolSize >::end(), List< T, nodePoolSize >::erase(), and m_Groups.
bool User::login | ( | String | password | ) |
(Attempts to) log in as this user. On success this process' user is set to this, and the group is set to this user's default group.
Definition at line 72 of file User.cc.
References Processor::information(), m_Password, m_pDefaultGroup, Process::setEffectiveUser(), Process::setGroup(), and Process::setUser().
Referenced by WaitCleanup::terminated().
Set of groups (excluding default group).
Definition at line 119 of file User.h.
Referenced by isMember(), join(), and leave().
|
private |
|
private |