ZNC
trunk
|
#include <User.h>
Public Types | |
enum | eHashType { HASH_NONE , HASH_MD5 , HASH_SHA256 , HASH_ARGON2ID , HASH_DEFAULT = HASH_SHA256 } |
Public Member Functions | |
CUser (const CString &sUsername) | |
~CUser () | |
CUser (const CUser &)=delete | |
CUser & | operator= (const CUser &)=delete |
bool | ParseConfig (CConfig *Config, CString &sError) |
CConfig | ToConfig () const |
bool | CheckPass (const CString &sPass) |
Checks password, may upgrade the hash method. More... | |
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 |
CModules & | GetModules () |
const CModules & | GetModules () const |
CIRCNetwork * | AddNetwork (const CString &sNetwork, CString &sErrorRet) |
bool | DeleteNetwork (const CString &sNetwork) |
bool | AddNetwork (CIRCNetwork *pNetwork) |
void | RemoveNetwork (CIRCNetwork *pNetwork) |
CIRCNetwork * | FindNetwork (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) ZNC_MSG_DEPRECATED("Use PutUser() instead") |
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 |
CString & | ExpandString (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) |
void | SetDenySetIdent (bool b) |
void | SetDenySetNetwork (bool b) |
void | SetDenySetRealName (bool b) |
void | SetDenySetQuitMsg (bool b) |
void | SetDenySetCTCPReplies (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 CString & | GetUserName () const |
const CString & | GetUsername () const |
const CString & | GetCleanUserName () const |
const CString & | GetNick (bool bAllowDefault=true) const |
const CString & | GetAltNick (bool bAllowDefault=true) const |
const CString & | GetIdent (bool bAllowDefault=true) const |
CString | GetRealName () const |
const CString & | GetBindHost () const |
const CString & | GetDCCBindHost () const |
const CString & | GetPass () const |
eHashType | GetPassHashType () const |
const CString & | GetPassSalt () const |
const std::set< CString > & | GetAllowedHosts () const |
const CString & | GetTimestampFormat () const |
const CString & | GetClientEncoding () const |
bool | GetTimestampAppend () const |
bool | GetTimestampPrepend () const |
const CString & | GetUserPath () const |
bool | DenyLoadMod () const |
bool | IsAdmin () const |
bool | DenySetBindHost () const |
bool | DenySetIdent () const |
bool | DenySetNetwork () const |
bool | DenySetRealName () const |
bool | DenySetQuitMsg () const |
bool | DenySetCTCPReplies () const |
bool | MultiClients () const |
bool | AuthOnlyViaModule () const |
const CString & | GetStatusPrefix () const |
const CString & | GetDefaultChanModes () 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 MCString & | GetCTCPReplies () 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 bool | IsValidUserName (const CString &sUsername) |
static CString | MakeCleanUsername (const CString &sUsername) |
static CString | MakeCleanUserName (const CString &sUsername) |
enum CUser::eHashType |
CUser::CUser | ( | const CString & | sUsername | ) |
CUser::~CUser | ( | ) |
|
delete |
bool CUser::AddAllowedHost | ( | const CString & | sHostMask | ) |
|
inline |
References m_uBytesRead.
|
inline |
References m_uBytesWritten.
bool CUser::AddNetwork | ( | CIRCNetwork * | pNetwork | ) |
CIRCNetwork* CUser::AddNetwork | ( | const CString & | sNetwork, |
CString & | sErrorRet | ||
) |
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 | ) |
Checks password, may upgrade the hash method.
void CUser::ClearAllowedHosts | ( | ) |
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 |
bool CUser::DenySetCTCPReplies | ( | ) | const |
bool CUser::DenySetIdent | ( | ) | const |
bool CUser::DenySetNetwork | ( | ) | const |
bool CUser::DenySetQuitMsg | ( | ) | const |
bool CUser::DenySetRealName | ( | ) | 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 |
|
inline |
References m_pModules.
|
inline |
References m_pModules.
const std::vector<CIRCNetwork*>& CUser::GetNetworks | ( | ) | const |
const CString& CUser::GetNick | ( | bool | bAllowDefault = true | ) | 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 |
|
inline |
How long must an IRC connection be idle before ZNC sends a ping.
References m_uNoTrafficTimeout.
|
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 |
|
inline |
References m_sTimezone.
|
inline |
References m_vClients.
const CString& CUser::GetUserName | ( | ) | const |
const CString& CUser::GetUsername | ( | ) | const |
const CString& CUser::GetUserPath | ( | ) | const |
bool CUser::HasSpaceForNewNetwork | ( | ) | const |
bool CUser::IsAdmin | ( | ) | 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 |
|
static |
|
inline |
References m_uMaxJoinTries.
|
inline |
References m_uMaxJoins.
|
inline |
References m_uMaxNetworks.
|
inline |
References m_uMaxQueryBuffers.
bool CUser::MultiClients | ( | ) | const |
|
inline |
References PutUser().
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 |
||
) |
Referenced by PutAllUser().
bool CUser::RemAllowedHost | ( | const CString & | sHostMask | ) |
void CUser::RemoveNetwork | ( | CIRCNetwork * | pNetwork | ) |
References CUtils::SaltedHash().
void CUser::SetAdmin | ( | bool | b | ) |
void CUser::SetAltNick | ( | const CString & | s | ) |
|
inline |
References m_bAuthOnlyViaModule.
void CUser::SetAutoClearChanBuffer | ( | bool | b | ) |
void CUser::SetAutoClearQueryBuffer | ( | 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::SetDenySetCTCPReplies | ( | bool | b | ) |
void CUser::SetDenySetIdent | ( | bool | b | ) |
void CUser::SetDenySetNetwork | ( | bool | b | ) |
void CUser::SetDenySetQuitMsg | ( | bool | b | ) |
void CUser::SetDenySetRealName | ( | bool | b | ) |
void CUser::SetIdent | ( | const CString & | s | ) |
|
inline |
References m_uMaxJoinTries.
bool CUser::SetLanguage | ( | const CString & | s | ) |
|
inline |
References m_uMaxJoins.
|
inline |
References m_uMaxNetworks.
|
inline |
References m_uMaxQueryBuffers.
void CUser::SetMultiClients | ( | bool | b | ) |
void CUser::SetNick | ( | const CString & | s | ) |
|
inline |
References m_uNoTrafficTimeout.
bool CUser::SetQueryBufferSize | ( | unsigned int | u, |
bool | bForce = false |
||
) |
void CUser::SetQuitMsg | ( | const CString & | s | ) |
void CUser::SetRealName | ( | const CString & | s | ) |
|
inline |
References m_sSkinName.
bool CUser::SetStatusPrefix | ( | const CString & | s | ) |
|
inline |
References m_bAppendTimestamp.
|
inline |
References m_sTimestampFormat.
|
inline |
References m_bPrependTimestamp.
|
inline |
References m_sTimezone.
CConfig CUser::ToConfig | ( | ) | const |
void CUser::UserConnected | ( | CClient * | pClient | ) |
void CUser::UserDisconnected | ( | CClient * | pClient | ) |
|
protected |
|
protected |
Referenced by SetTimestampAppend().
|
protected |
Referenced by SetAuthOnlyViaModule().
|
protected |
|
protected |
|
protected |
Referenced by IsBeingDeleted(), and SetBeingDeleted().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by SetTimestampPrepend().
|
protected |
|
protected |
|
protected |
Referenced by GetModules().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by SetSkinName().
|
protected |
|
protected |
Referenced by SetTimestampFormat().
|
protected |
Referenced by GetTimezone(), and SetTimezone().
|
protected |
|
protected |
|
protected |
Referenced by AddBytesRead().
|
protected |
Referenced by AddBytesWritten().
|
protected |
|
protected |
Referenced by MaxJoins(), and SetMaxJoins().
|
protected |
Referenced by JoinTries(), and SetJoinTries().
|
protected |
Referenced by MaxNetworks(), and SetMaxNetworks().
|
protected |
Referenced by MaxQueryBuffers(), and SetMaxQueryBuffers().
|
protected |
Referenced by GetNoTrafficTimeout(), GetPingFrequency(), GetPingSlack(), and SetNoTrafficTimeout().
|
protected |
|
protected |
Referenced by GetUserClients().
|
protected |