mirror of
https://github.com/anope/anope.git
synced 2026-07-09 04:23:13 +02:00
BUILD : 1.7.5 (354) BUGS : NOTES : Added RestrictOpernicks by request. Small feature.
git-svn-id: svn://svn.anope.org/anope/trunk@354 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@230 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
parent
3a4570a131
commit
fcd9c968ee
+23
-1
@@ -1930,12 +1930,13 @@ static int do_help(User * u)
|
||||
static int do_register(User * u)
|
||||
{
|
||||
NickRequest *nr = NULL, *anr = NULL;
|
||||
NickCore *nc = NULL;
|
||||
int prefixlen = strlen(NSGuestNickPrefix);
|
||||
int nicklen = strlen(u->nick);
|
||||
char *pass = strtok(NULL, " ");
|
||||
char *email = strtok(NULL, " ");
|
||||
char passcode[11];
|
||||
int idx, min = 1, max = 62;
|
||||
int idx, min = 1, max = 62, i = 0;
|
||||
int chars[] =
|
||||
{ ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
|
||||
'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y',
|
||||
@@ -1976,6 +1977,27 @@ static int do_register(User * u)
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (RestrictOperNicks) {
|
||||
for (i = 0; i < RootNumber; i++) {
|
||||
if (strstr(u->nick, ServicesRoots[i]) && !is_oper(u)) {
|
||||
notice_lang(s_NickServ, u, NICK_CANNOT_BE_REGISTERED, u->nick);
|
||||
return MOD_CONT;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < servadmins.count && (nc = servadmins.list[i]);i++) {
|
||||
if (strstr(u->nick, nc->display) && !is_oper(u)) {
|
||||
notice_lang(s_NickServ, u, NICK_CANNOT_BE_REGISTERED, u->nick);
|
||||
return MOD_CONT;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < servopers.count && (nc = servopers.list[i]);i++) {
|
||||
if (strstr(u->nick, nc->display) && !is_oper(u)) {
|
||||
notice_lang(s_NickServ, u, NICK_CANNOT_BE_REGISTERED, u->nick);
|
||||
return MOD_CONT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!pass || (NSForceEmail && !email)) {
|
||||
syntax_error(s_NickServ, u, "REGISTER",
|
||||
NICK_REGISTER_SYNTAX_EMAIL);
|
||||
|
||||
Reference in New Issue
Block a user