Added IsValidUserName()

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@213 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
prozacx
2005-04-30 19:10:55 +00:00
parent 22840ca24c
commit 8ccb908194
2 changed files with 17 additions and 0 deletions
+16
View File
@@ -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();