mirror of
https://github.com/znc/znc.git
synced 2026-07-06 09:51:25 +02:00
Added IsValidUserName()
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@213 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -70,6 +70,22 @@ bool CUser::IsHostAllowed(const string& sHostMask) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CUser::IsValidUserName(const string& sUserName) {
|
||||
const char* p = sUserName.c_str();
|
||||
|
||||
if (sUserName.empty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
while (*p) {
|
||||
if (!isalnum(*p++)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CUser::IsValid(string& sErrMsg) {
|
||||
sErrMsg.clear();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user