class UserData

Encapsulate user and access information. More...

Definition#include <UserData.h>
InheritsQObject
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Methods

Protected Members


Detailed Description

This class is used to represent internal data about a user's access in the bot.

int getUserIdx ()
[const]

Get the internal user index of the current UserData object.

Returns: The internal user index.

const QString& getLogin ()
[const]

Get the login (username) of the current UserData object.

Returns: The username of the current user.

bool passwordMatches (QString pass)
[const]

Determine if pass matches the password of the current UserData object. The comparison is case-sensitive.

Parameters:
passThe password to test against the user's password.

Returns: true if the passwords match exactly, false otherwise.

const QDateTime& getLastSeen ()
[const]

Get the last time the user was seen.

Returns: A QDateTime object representing the last time the user was seen.

const QString& getLastIP ()
[const]

Get the last IP the user was seen on.

Returns: A string the last IP the user was seen on.

const QString& getLastModifBy ()
[const]

Get the username of the user who made the last modification to this access.

Returns: The username of the last modifying user.

const QDateTime& getLastModifTS ()
[const]

Get the date & time of the last modification to this access.

Returns: The date & time of the last modification.

const QString& getLastModif ()
[const]

Get the name of the last command that modified this access.

Returns: The name of the last command modifying this access.

int getConsole ()
[const]

Get the user's console.

Returns: An int containing the sum of the activated DCCUser flags for console settings.

const QString& getInfoLine ()
[const]

Get the infoline the user specified, if any.

Returns: The infoline of the user, or an empty string if there is none set.

const QString& getDefaultChannel ()
[const]

Get the name of the channel the user wishes to authenticate by default.

Returns: The name of the user's default channel.

AccessIterator* createAccessIterator ()
[const]

Create an iterator over the user's access list. This can be used to go through the whole list. The access list is in arbitrary order. The calling method is responsible for freeing memory allocated by createAccessIterator.

PRECONDITIONS: _accessDict != 0

Returns: A new AccessIterator object pointing to the first access in the user's access list.

const AccessData* findAccess (QString channel)
[const]

Find an access for a specific channel in the user's access list.

PRECONDITIONS: _accessDict != 0

Parameters:
channelThe name of the channel to find (case-insensitive).

Returns: A const pointer to the AccessData object representing the access on the requested channel, or 0 if the user does not have access to that channel.

UserData (int userIdx,QString login, QString pass, QDateTime lastSeen, QString lastIP, QString lastModifBy, QDateTime lastModifTS, QString lastModif, int console, QString infoline, QString defChan)
[protected]

Create a new USerData object with the given values. All the values can be obtained from the database. This constructor is private, allowing only friend classes to create UserData objects.

Parameters:
userIdxThe internal user index of the user.
loginThe username of the user.
passThe user's password.
lastSeenDate & time the user was last seen.
lastIPLast IP the user was seen on.
lastModifByUsername of the user who last modified this user.
lastModifTSDate & time of the last modification on this user.
lastModifName of the command that last modified this user.
consoleConsole settings for this user.
infolineThe user's infoline.
defChanName of the channel the user authenticates on by default.

void setAccessList (AccessList* pAccess)
[protected]

Set the internal access list to the one specified in parameter. Once set, this list cannot be changed.

PRECONDITIONS: pAccess != 0 ; _accessDict == 0

Parameters:
pAccessA created and filled list of accesses to be attached to this user.