if (Ptr->limit)
{
- if (usercount(Ptr) == Ptr->limit)
+ if (usercount(Ptr) >= Ptr->limit)
{
WriteServ(user->fd,"471 %s %s :Cannot join channel (Channel is full)",user->nick, Ptr->name);
return NULL;
int MOD_RESULT = 0;
FOREACH_RESULT(OnAccessCheck(src,user,Ptr,AC_KICK));
-
if (MOD_RESULT == ACR_DENY)
return;
return;
}
}
-
+
+ MOD_RESULT = 0;
+ FOREACH_RESULT(OnUserPreKick(src,user,Ptr,reason));
+ if (MOD_RESULT)
+ return;
+
+ FOREACH_MOD OnUserKick(src,user,Ptr,reason);
+
for (int i =0; i != MAXCHANS; i++)
{
/* zap it from the channel list of the user */
break;
}
}
-
+
/* if there are no users left on the channel */
if (!usercount(Ptr))
{
strncpy(clientlist[tempnick]->host, host,160);
strncpy(clientlist[tempnick]->dhost, host,160);
strncpy(clientlist[tempnick]->server, ServerName,256);
- strncpy(clientlist[tempnick]->ident, "unknown",9);
+ strncpy(clientlist[tempnick]->ident, "unknown",12);
clientlist[tempnick]->registered = 0;
clientlist[tempnick]->signon = TIME+dns_timeout;
clientlist[tempnick]->lastping = 1;
NetSendToAll(buffer);
}
+
+// this returns 1 when all modules are satisfied that the user should be allowed onto the irc server
+// (until this returns true, a user will block in the waiting state, waiting to connect up to the
+// registration timeout maximum seconds)
+bool AllModulesReportReady(userrec* user)
+{
+ for (int i = 0; i <= MODCOUNT; i++)
+ {
+ int res = modules[i]->OnCheckReady(user);
+ if (!res)
+ return false;
+ }
+ return true;
+}
+
/* shows the message of the day, and any other on-logon stuff */
void ConnectUser(userrec *user)
{
// dns is already done, things are fast. no need to wait for dns to complete just pass them straight on
- if ((user->dns_done) && (user->registered >= 3))
+ if ((user->dns_done) && (user->registered >= 3) && (AllModulesReportReady(user)))
{
FullConnectUser(user);
}
kill_link(count2->second,"Registration timeout");
goto label;
}
- if ((TIME > count2->second->signon) && (count2->second->registered == 3))
+ if ((TIME > count2->second->signon) && (count2->second->registered == 3) && (AllModulesReportReady(count2->second)))
{
+ log(DEBUG,"signon exceed, registered=3, and modules ready, OK");
count2->second->dns_done = true;
FullConnectUser(count2->second);
goto label;
}
- if ((count2->second->dns_done) && (count2->second->registered == 3)) // both NICK and USER... and DNS
+ if ((count2->second->dns_done) && (count2->second->registered == 3) && (AllModulesReportReady(count2->second))) // both NICK and USER... and DNS
{
+ log(DEBUG,"dns done, registered=3, and modules ready, OK");
FullConnectUser(count2->second);
goto label;
}