X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fusermanager.cpp;h=2d824c6b2ff188417a971ec57f54fd57ecebe26c;hb=984cc96a1f832abf9b5fcfddcd8260c5b12bd2a9;hp=2eebb1ed029f2c5035055d520b4df43aa467091c;hpb=de25d946733f774e3a5b53a58438a9c92af0acbe;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/usermanager.cpp b/src/usermanager.cpp index 2eebb1ed0..2d824c6b2 100644 --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -23,10 +23,10 @@ void UserManager::AddUser(int socket, ClientListenSocket* via, irc::sockets::soc /* NOTE: Calling this one parameter constructor for User automatically * allocates a new UUID and places it in the hash_map. */ - User* New = NULL; + LocalUser* New = NULL; try { - New = new User(); + New = new LocalUser(); } catch (...) { @@ -81,13 +81,7 @@ void UserManager::AddUser(int socket, ClientListenSocket* via, irc::sockets::soc * First class check. We do this again in FullConnect after DNS is done, and NICK/USER is recieved. * See my note down there for why this is required. DO NOT REMOVE. :) -- w00t */ - ConnectClass* i = New->SetClass(); - - if (!i) - { - this->QuitUser(New, "Access denied by configuration"); - return; - } + New->SetClass(); /* * Check connect class settings and initialise settings into User. @@ -198,14 +192,13 @@ void UserManager::QuitUser(User *user, const std::string &quitreason, const char user->WriteCommonQuit(reason, oper_reason); } - FOREACH_MOD(I_OnUserDisconnect,OnUserDisconnect(user)); - if (user->registered != REG_ALL) if (ServerInstance->Users->unregistered_count) ServerInstance->Users->unregistered_count--; if (IS_LOCAL(user)) { + FOREACH_MOD(I_OnUserDisconnect,OnUserDisconnect(IS_LOCAL(user))); user->DoWrite(); if (user->GetIOHook()) { @@ -423,7 +416,7 @@ void UserManager::ServerNoticeAll(const char* text, ...) snprintf(formatbuffer,MAXBUF,"NOTICE $%s :%s", ServerInstance->Config->ServerName.c_str(), textbuffer); - for (std::vector::const_iterator i = local_users.begin(); i != local_users.end(); i++) + for (std::vector::const_iterator i = local_users.begin(); i != local_users.end(); i++) { User* t = *i; t->WriteServ(std::string(formatbuffer)); @@ -444,7 +437,7 @@ void UserManager::ServerPrivmsgAll(const char* text, ...) snprintf(formatbuffer,MAXBUF,"PRIVMSG $%s :%s", ServerInstance->Config->ServerName.c_str(), textbuffer); - for (std::vector::const_iterator i = local_users.begin(); i != local_users.end(); i++) + for (std::vector::const_iterator i = local_users.begin(); i != local_users.end(); i++) { User* t = *i; t->WriteServ(std::string(formatbuffer)); @@ -470,7 +463,7 @@ void UserManager::WriteMode(const char* modes, int flags, const char* text, ...) if (flags == WM_AND) { - for (std::vector::const_iterator i = local_users.begin(); i != local_users.end(); i++) + for (std::vector::const_iterator i = local_users.begin(); i != local_users.end(); i++) { User* t = *i; bool send_to_user = true; @@ -491,7 +484,7 @@ void UserManager::WriteMode(const char* modes, int flags, const char* text, ...) } else if (flags == WM_OR) { - for (std::vector::const_iterator i = local_users.begin(); i != local_users.end(); i++) + for (std::vector::const_iterator i = local_users.begin(); i != local_users.end(); i++) { User* t = *i; bool send_to_user = false;