ZNC  trunk
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
CUser Class Reference

#include <User.h>

+ Collaboration diagram for CUser:

Public Types

enum  eHashType { HASH_NONE, HASH_MD5, HASH_SHA256, HASH_DEFAULT = HASH_SHA256 }
 

Public Member Functions

 CUser (const CString &sUserName)
 
 ~CUser ()
 
 CUser (const CUser &)=delete
 
CUseroperator= (const CUser &)=delete
 
bool ParseConfig (CConfig *Config, CString &sError)
 
CConfig ToConfig () const
 
bool CheckPass (const CString &sPass) const
 
bool AddAllowedHost (const CString &sHostMask)
 
bool RemAllowedHost (const CString &sHostMask)
 
void ClearAllowedHosts ()
 
bool IsHostAllowed (const CString &sHost) const
 
bool IsValid (CString &sErrMsg, bool bSkipPass=false) const
 
CModulesGetModules ()
 
const CModulesGetModules () const
 
CIRCNetworkAddNetwork (const CString &sNetwork, CString &sErrorRet)
 
bool DeleteNetwork (const CString &sNetwork)
 
bool AddNetwork (CIRCNetwork *pNetwork)
 
void RemoveNetwork (CIRCNetwork *pNetwork)
 
CIRCNetworkFindNetwork (const CString &sNetwork) const
 
const std::vector< CIRCNetwork * > & GetNetworks () const
 
bool HasSpaceForNewNetwork () const
 
bool PutUser (const CString &sLine, CClient *pClient=nullptr, CClient *pSkipClient=nullptr)
 
bool PutAllUser (const CString &sLine, CClient *pClient=nullptr, CClient *pSkipClient=nullptr)
 
bool PutStatus (const CString &sLine, CClient *pClient=nullptr, CClient *pSkipClient=nullptr)
 
bool PutStatusNotice (const CString &sLine, CClient *pClient=nullptr, CClient *pSkipClient=nullptr)
 
bool PutModule (const CString &sModule, const CString &sLine, CClient *pClient=nullptr, CClient *pSkipClient=nullptr)
 
bool PutModNotice (const CString &sModule, const CString &sLine, CClient *pClient=nullptr, CClient *pSkipClient=nullptr)
 
bool IsUserAttached () const
 
void UserConnected (CClient *pClient)
 
void UserDisconnected (CClient *pClient)
 
CString GetLocalDCCIP () const
 
CString ExpandString (const CString &sStr) const
 
CStringExpandString (const CString &sStr, CString &sRet) const
 
CString AddTimestamp (const CString &sStr) const
 
CString AddTimestamp (time_t tm, const CString &sStr) const
 
CString AddTimestamp (timeval tv, const CString &sStr) const
 
void CloneNetworks (const CUser &User)
 
bool Clone (const CUser &User, CString &sErrorRet, bool bCloneNetworks=true)
 
void BounceAllClients ()
 
void AddBytesRead (unsigned long long u)
 
void AddBytesWritten (unsigned long long u)
 
void SetNick (const CString &s)
 
void SetAltNick (const CString &s)
 
void SetIdent (const CString &s)
 
void SetRealName (const CString &s)
 
void SetBindHost (const CString &s)
 
void SetDCCBindHost (const CString &s)
 
void SetPass (const CString &s, eHashType eHash, const CString &sSalt="")
 
void SetMultiClients (bool b)
 
void SetDenyLoadMod (bool b)
 
void SetAdmin (bool b)
 
void SetDenySetBindHost (bool b)
 
bool SetStatusPrefix (const CString &s)
 
void SetDefaultChanModes (const CString &s)
 
void SetClientEncoding (const CString &s)
 
void SetQuitMsg (const CString &s)
 
bool AddCTCPReply (const CString &sCTCP, const CString &sReply)
 
bool DelCTCPReply (const CString &sCTCP)
 
bool SetBufferCount (unsigned int u, bool bForce=false)
 
bool SetChanBufferSize (unsigned int u, bool bForce=false)
 
bool SetQueryBufferSize (unsigned int u, bool bForce=false)
 
void SetAutoClearChanBuffer (bool b)
 
void SetAutoClearQueryBuffer (bool b)
 
bool SetLanguage (const CString &s)
 
void SetBeingDeleted (bool b)
 
void SetTimestampFormat (const CString &s)
 
void SetTimestampAppend (bool b)
 
void SetTimestampPrepend (bool b)
 
void SetAuthOnlyViaModule (bool b)
 
void SetTimezone (const CString &s)
 
void SetJoinTries (unsigned int i)
 
void SetMaxJoins (unsigned int i)
 
void SetSkinName (const CString &s)
 
void SetMaxNetworks (unsigned int i)
 
void SetMaxQueryBuffers (unsigned int i)
 
void SetNoTrafficTimeout (unsigned int i)
 
const std::vector< CClient * > & GetUserClients () const
 
std::vector< CClient * > GetAllClients () const
 
const CStringGetUserName () const
 
const CStringGetCleanUserName () const
 
const CStringGetNick (bool bAllowDefault=true) const
 
const CStringGetAltNick (bool bAllowDefault=true) const
 
const CStringGetIdent (bool bAllowDefault=true) const
 
CString GetRealName () const
 
const CStringGetBindHost () const
 
const CStringGetDCCBindHost () const
 
const CStringGetPass () const
 
eHashType GetPassHashType () const
 
const CStringGetPassSalt () const
 
const std::set< CString > & GetAllowedHosts () const
 
const CStringGetTimestampFormat () const
 
const CStringGetClientEncoding () const
 
bool GetTimestampAppend () const
 
bool GetTimestampPrepend () const
 
const CStringGetUserPath () const
 
bool DenyLoadMod () const
 
bool IsAdmin () const
 
bool DenySetBindHost () const
 
bool MultiClients () const
 
bool AuthOnlyViaModule () const
 
const CStringGetStatusPrefix () const
 
const CStringGetDefaultChanModes () const
 
unsigned int GetPingFrequency () const
 How long must an IRC connection be idle before ZNC sends a ping. More...
 
unsigned int GetPingSlack () const
 Time between checks if PINGs need to be sent. More...
 
unsigned int GetNoTrafficTimeout () const
 Timeout after which IRC connections are closed. More...
 
CString GetQuitMsg () const
 
const MCStringGetCTCPReplies () const
 
unsigned int GetBufferCount () const
 
unsigned int GetChanBufferSize () const
 
unsigned int GetQueryBufferSize () const
 
bool AutoClearChanBuffer () const
 
bool AutoClearQueryBuffer () const
 
bool IsBeingDeleted () const
 
CString GetTimezone () const
 
unsigned long long BytesRead () const
 
unsigned long long BytesWritten () const
 
unsigned int JoinTries () const
 
unsigned int MaxJoins () const
 
CString GetSkinName () const
 
CString GetLanguage () const
 
unsigned int MaxNetworks () const
 
unsigned int MaxQueryBuffers () const
 

Static Public Member Functions

static CString SaltedHash (const CString &sPass, const CString &sSalt)
 
static bool IsValidUserName (const CString &sUserName)
 
static CString MakeCleanUserName (const CString &sUserName)
 

Protected Attributes

const CString m_sUserName
 
const CString m_sCleanUserName
 
CString m_sNick
 
CString m_sAltNick
 
CString m_sIdent
 
CString m_sRealName
 
CString m_sBindHost
 
CString m_sDCCBindHost
 
CString m_sPass
 
CString m_sPassSalt
 
CString m_sStatusPrefix
 
CString m_sDefaultChanModes
 
CString m_sClientEncoding
 
CString m_sQuitMsg
 
MCString m_mssCTCPReplies
 
CString m_sTimestampFormat
 
CString m_sTimezone
 
eHashType m_eHashType
 
CString m_sUserPath
 
bool m_bMultiClients
 
bool m_bDenyLoadMod
 
bool m_bAdmin
 
bool m_bDenySetBindHost
 
bool m_bAutoClearChanBuffer
 
bool m_bAutoClearQueryBuffer
 
bool m_bBeingDeleted
 
bool m_bAppendTimestamp
 
bool m_bPrependTimestamp
 
bool m_bAuthOnlyViaModule
 
CUserTimer * m_pUserTimer
 
std::vector< CIRCNetwork * > m_vIRCNetworks
 
std::vector< CClient * > m_vClients
 
std::set< CStringm_ssAllowedHosts
 
unsigned int m_uChanBufferSize
 
unsigned int m_uQueryBufferSize
 
unsigned long long m_uBytesRead
 
unsigned long long m_uBytesWritten
 
unsigned int m_uMaxJoinTries
 
unsigned int m_uMaxNetworks
 
unsigned int m_uMaxQueryBuffers
 
unsigned int m_uMaxJoins
 
unsigned int m_uNoTrafficTimeout
 
CString m_sSkinName
 
CString m_sLanguage
 
CModulesm_pModules
 

Member Enumeration Documentation

Enumerator
HASH_NONE 
HASH_MD5 
HASH_SHA256 
HASH_DEFAULT 

Constructor & Destructor Documentation

CUser::CUser ( const CString sUserName)
CUser::~CUser ( )
CUser::CUser ( const CUser )
delete

Member Function Documentation

bool CUser::AddAllowedHost ( const CString sHostMask)
void CUser::AddBytesRead ( unsigned long long  u)
inline

References m_uBytesRead.

void CUser::AddBytesWritten ( unsigned long long  u)
inline

References m_uBytesWritten.

bool CUser::AddCTCPReply ( const CString sCTCP,
const CString sReply 
)
CIRCNetwork* CUser::AddNetwork ( const CString sNetwork,
CString sErrorRet 
)
bool CUser::AddNetwork ( CIRCNetwork pNetwork)
CString CUser::AddTimestamp ( const CString sStr) const
CString CUser::AddTimestamp ( time_t  tm,
const CString sStr 
) const
CString CUser::AddTimestamp ( timeval  tv,
const CString sStr 
) const
bool CUser::AuthOnlyViaModule ( ) const
bool CUser::AutoClearChanBuffer ( ) const
bool CUser::AutoClearQueryBuffer ( ) const
void CUser::BounceAllClients ( )
unsigned long long CUser::BytesRead ( ) const
unsigned long long CUser::BytesWritten ( ) const
bool CUser::CheckPass ( const CString sPass) const
void CUser::ClearAllowedHosts ( )
bool CUser::Clone ( const CUser User,
CString sErrorRet,
bool  bCloneNetworks = true 
)
void CUser::CloneNetworks ( const CUser User)
bool CUser::DelCTCPReply ( const CString sCTCP)
bool CUser::DeleteNetwork ( const CString sNetwork)
bool CUser::DenyLoadMod ( ) const
bool CUser::DenySetBindHost ( ) const
CString CUser::ExpandString ( const CString sStr) const
CString& CUser::ExpandString ( const CString sStr,
CString sRet 
) const
CIRCNetwork* CUser::FindNetwork ( const CString sNetwork) const
std::vector<CClient*> CUser::GetAllClients ( ) const
const std::set<CString>& CUser::GetAllowedHosts ( ) const
const CString& CUser::GetAltNick ( bool  bAllowDefault = true) const
const CString& CUser::GetBindHost ( ) const
unsigned int CUser::GetBufferCount ( ) const
unsigned int CUser::GetChanBufferSize ( ) const
const CString& CUser::GetCleanUserName ( ) const
const CString& CUser::GetClientEncoding ( ) const
const MCString& CUser::GetCTCPReplies ( ) const
const CString& CUser::GetDCCBindHost ( ) const
const CString& CUser::GetDefaultChanModes ( ) const
const CString& CUser::GetIdent ( bool  bAllowDefault = true) const
CString CUser::GetLanguage ( ) const
CString CUser::GetLocalDCCIP ( ) const
CModules& CUser::GetModules ( )
inline

References m_pModules.

const CModules& CUser::GetModules ( ) const
inline

References m_pModules.

const std::vector<CIRCNetwork*>& CUser::GetNetworks ( ) const
const CString& CUser::GetNick ( bool  bAllowDefault = true) const
unsigned int CUser::GetNoTrafficTimeout ( ) const
inline

Timeout after which IRC connections are closed.

Must obviously be greater than GetPingFrequency() + GetPingSlack().

References m_uNoTrafficTimeout.

const CString& CUser::GetPass ( ) const
eHashType CUser::GetPassHashType ( ) const
const CString& CUser::GetPassSalt ( ) const
unsigned int CUser::GetPingFrequency ( ) const
inline

How long must an IRC connection be idle before ZNC sends a ping.

References m_uNoTrafficTimeout.

unsigned int CUser::GetPingSlack ( ) const
inline

Time between checks if PINGs need to be sent.

References m_uNoTrafficTimeout.

unsigned int CUser::GetQueryBufferSize ( ) const
CString CUser::GetQuitMsg ( ) const
CString CUser::GetRealName ( ) const
CString CUser::GetSkinName ( ) const
const CString& CUser::GetStatusPrefix ( ) const
bool CUser::GetTimestampAppend ( ) const
const CString& CUser::GetTimestampFormat ( ) const
bool CUser::GetTimestampPrepend ( ) const
CString CUser::GetTimezone ( ) const
inline

References m_sTimezone.

const std::vector<CClient*>& CUser::GetUserClients ( ) const
inline

References m_vClients.

const CString& CUser::GetUserName ( ) const
const CString& CUser::GetUserPath ( ) const
bool CUser::HasSpaceForNewNetwork ( ) const
bool CUser::IsAdmin ( ) const
bool CUser::IsBeingDeleted ( ) const
inline

References m_bBeingDeleted.

bool CUser::IsHostAllowed ( const CString sHost) const
bool CUser::IsUserAttached ( ) const
bool CUser::IsValid ( CString sErrMsg,
bool  bSkipPass = false 
) const
static bool CUser::IsValidUserName ( const CString sUserName)
static
unsigned int CUser::JoinTries ( ) const
inline

References m_uMaxJoinTries.

static CString CUser::MakeCleanUserName ( const CString sUserName)
static
unsigned int CUser::MaxJoins ( ) const
inline

References m_uMaxJoins.

unsigned int CUser::MaxNetworks ( ) const
inline

References m_uMaxNetworks.

unsigned int CUser::MaxQueryBuffers ( ) const
inline

References m_uMaxQueryBuffers.

bool CUser::MultiClients ( ) const
CUser& CUser::operator= ( const CUser )
delete
bool CUser::ParseConfig ( CConfig Config,
CString sError 
)
bool CUser::PutAllUser ( const CString sLine,
CClient pClient = nullptr,
CClient pSkipClient = nullptr 
)
bool CUser::PutModNotice ( const CString sModule,
const CString sLine,
CClient pClient = nullptr,
CClient pSkipClient = nullptr 
)
bool CUser::PutModule ( const CString sModule,
const CString sLine,
CClient pClient = nullptr,
CClient pSkipClient = nullptr 
)
bool CUser::PutStatus ( const CString sLine,
CClient pClient = nullptr,
CClient pSkipClient = nullptr 
)
bool CUser::PutStatusNotice ( const CString sLine,
CClient pClient = nullptr,
CClient pSkipClient = nullptr 
)
bool CUser::PutUser ( const CString sLine,
CClient pClient = nullptr,
CClient pSkipClient = nullptr 
)
bool CUser::RemAllowedHost ( const CString sHostMask)
void CUser::RemoveNetwork ( CIRCNetwork pNetwork)
static CString CUser::SaltedHash ( const CString sPass,
const CString sSalt 
)
inlinestatic
void CUser::SetAdmin ( bool  b)
void CUser::SetAltNick ( const CString s)
void CUser::SetAuthOnlyViaModule ( bool  b)
inline

References m_bAuthOnlyViaModule.

void CUser::SetAutoClearChanBuffer ( bool  b)
void CUser::SetAutoClearQueryBuffer ( bool  b)
void CUser::SetBeingDeleted ( bool  b)
inline

References m_bBeingDeleted.

void CUser::SetBindHost ( const CString s)
bool CUser::SetBufferCount ( unsigned int  u,
bool  bForce = false 
)
bool CUser::SetChanBufferSize ( unsigned int  u,
bool  bForce = false 
)
void CUser::SetClientEncoding ( const CString s)
void CUser::SetDCCBindHost ( const CString s)
void CUser::SetDefaultChanModes ( const CString s)
void CUser::SetDenyLoadMod ( bool  b)
void CUser::SetDenySetBindHost ( bool  b)
void CUser::SetIdent ( const CString s)
void CUser::SetJoinTries ( unsigned int  i)
inline

References m_uMaxJoinTries.

bool CUser::SetLanguage ( const CString s)
void CUser::SetMaxJoins ( unsigned int  i)
inline

References m_uMaxJoins.

void CUser::SetMaxNetworks ( unsigned int  i)
inline

References m_uMaxNetworks.

void CUser::SetMaxQueryBuffers ( unsigned int  i)
inline

References m_uMaxQueryBuffers.

void CUser::SetMultiClients ( bool  b)
void CUser::SetNick ( const CString s)
void CUser::SetNoTrafficTimeout ( unsigned int  i)
inline

References m_uNoTrafficTimeout.

void CUser::SetPass ( const CString s,
eHashType  eHash,
const CString sSalt = "" 
)
bool CUser::SetQueryBufferSize ( unsigned int  u,
bool  bForce = false 
)
void CUser::SetQuitMsg ( const CString s)
void CUser::SetRealName ( const CString s)
void CUser::SetSkinName ( const CString s)
inline

References m_sSkinName.

bool CUser::SetStatusPrefix ( const CString s)
void CUser::SetTimestampAppend ( bool  b)
inline

References m_bAppendTimestamp.

void CUser::SetTimestampFormat ( const CString s)
inline

References m_sTimestampFormat.

void CUser::SetTimestampPrepend ( bool  b)
inline

References m_bPrependTimestamp.

void CUser::SetTimezone ( const CString s)
inline

References m_sTimezone.

CConfig CUser::ToConfig ( ) const
void CUser::UserConnected ( CClient pClient)
void CUser::UserDisconnected ( CClient pClient)

Member Data Documentation

bool CUser::m_bAdmin
protected
bool CUser::m_bAppendTimestamp
protected

Referenced by SetTimestampAppend().

bool CUser::m_bAuthOnlyViaModule
protected

Referenced by SetAuthOnlyViaModule().

bool CUser::m_bAutoClearChanBuffer
protected
bool CUser::m_bAutoClearQueryBuffer
protected
bool CUser::m_bBeingDeleted
protected

Referenced by IsBeingDeleted(), and SetBeingDeleted().

bool CUser::m_bDenyLoadMod
protected
bool CUser::m_bDenySetBindHost
protected
bool CUser::m_bMultiClients
protected
bool CUser::m_bPrependTimestamp
protected

Referenced by SetTimestampPrepend().

eHashType CUser::m_eHashType
protected
MCString CUser::m_mssCTCPReplies
protected
CModules* CUser::m_pModules
protected

Referenced by GetModules().

CUserTimer* CUser::m_pUserTimer
protected
CString CUser::m_sAltNick
protected
CString CUser::m_sBindHost
protected
const CString CUser::m_sCleanUserName
protected
CString CUser::m_sClientEncoding
protected
CString CUser::m_sDCCBindHost
protected
CString CUser::m_sDefaultChanModes
protected
CString CUser::m_sIdent
protected
CString CUser::m_sLanguage
protected
CString CUser::m_sNick
protected
CString CUser::m_sPass
protected
CString CUser::m_sPassSalt
protected
CString CUser::m_sQuitMsg
protected
CString CUser::m_sRealName
protected
std::set<CString> CUser::m_ssAllowedHosts
protected
CString CUser::m_sSkinName
protected

Referenced by SetSkinName().

CString CUser::m_sStatusPrefix
protected
CString CUser::m_sTimestampFormat
protected

Referenced by SetTimestampFormat().

CString CUser::m_sTimezone
protected

Referenced by GetTimezone(), and SetTimezone().

const CString CUser::m_sUserName
protected
CString CUser::m_sUserPath
protected
unsigned long long CUser::m_uBytesRead
protected

Referenced by AddBytesRead().

unsigned long long CUser::m_uBytesWritten
protected

Referenced by AddBytesWritten().

unsigned int CUser::m_uChanBufferSize
protected
unsigned int CUser::m_uMaxJoins
protected

Referenced by MaxJoins(), and SetMaxJoins().

unsigned int CUser::m_uMaxJoinTries
protected

Referenced by JoinTries(), and SetJoinTries().

unsigned int CUser::m_uMaxNetworks
protected

Referenced by MaxNetworks(), and SetMaxNetworks().

unsigned int CUser::m_uMaxQueryBuffers
protected
unsigned int CUser::m_uNoTrafficTimeout
protected
unsigned int CUser::m_uQueryBufferSize
protected
std::vector<CClient*> CUser::m_vClients
protected

Referenced by GetUserClients().

std::vector<CIRCNetwork*> CUser::m_vIRCNetworks
protected

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