mirror of
https://github.com/znc/znc.git
synced 2026-05-03 12:02:30 +02:00
CUser: add API for removing and clearing allowed hosts
This commit is contained in:
@@ -63,6 +63,8 @@ public:
|
||||
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& sHostMask) const;
|
||||
bool IsValid(CString& sErrMsg, bool bSkipPass = false) const;
|
||||
static bool IsValidUserName(const CString& sUserName);
|
||||
|
||||
@@ -791,6 +791,12 @@ bool CUser::AddAllowedHost(const CString& sHostMask) {
|
||||
m_ssAllowedHosts.insert(sHostMask);
|
||||
return true;
|
||||
}
|
||||
bool CUser::RemAllowedHost(const CString& sHostMask) {
|
||||
return m_ssAllowedHosts.erase(sHostMask) > 0;
|
||||
}
|
||||
void CUser::ClearAllowedHosts() {
|
||||
m_ssAllowedHosts.clear();
|
||||
}
|
||||
|
||||
bool CUser::IsHostAllowed(const CString& sHostMask) const {
|
||||
if (m_ssAllowedHosts.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user