mirror of
https://github.com/znc/znc.git
synced 2026-08-07 01:13:25 +02:00
Added IsValid() and Changed behavior of allowed hosts to accept * on no allow defined
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@188 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -57,6 +57,10 @@ bool CUser::AddAllowedHost(const string& sHostMask) {
|
||||
}
|
||||
|
||||
bool CUser::IsHostAllowed(const string& sHostMask) {
|
||||
if (m_ssAllowedHosts.empty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (set<string>::iterator a = m_ssAllowedHosts.begin(); a != m_ssAllowedHosts.end(); a++) {
|
||||
if (CUtils::wildcmp(*a, sHostMask)) {
|
||||
return true;
|
||||
@@ -66,6 +70,27 @@ bool CUser::IsHostAllowed(const string& sHostMask) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CUser::IsValid(string& sErrMsg) {
|
||||
sErrMsg.clear();
|
||||
|
||||
if (m_sPass.empty()) {
|
||||
sErrMsg = "Pass is empty";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_sUserName.empty()) {
|
||||
sErrMsg = "User is empty";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_vServers.empty()) {
|
||||
sErrMsg = "No servers defined";
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CUser::AddChan(CChan* pChan) {
|
||||
if (!pChan) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user