]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/usermanager.cpp
Move AllowedPrivs and similar oper information from LocalUser to OperInfo
[user/henk/code/inspircd.git] / src / usermanager.cpp
index 2eebb1ed029f2c5035055d520b4df43aa467091c..2d824c6b2ff188417a971ec57f54fd57ecebe26c 100644 (file)
@@ -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<User*>::const_iterator i = local_users.begin(); i != local_users.end(); i++)
+       for (std::vector<LocalUser*>::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<User*>::const_iterator i = local_users.begin(); i != local_users.end(); i++)
+       for (std::vector<LocalUser*>::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<User*>::const_iterator i = local_users.begin(); i != local_users.end(); i++)
+               for (std::vector<LocalUser*>::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<User*>::const_iterator i = local_users.begin(); i != local_users.end(); i++)
+               for (std::vector<LocalUser*>::const_iterator i = local_users.begin(); i != local_users.end(); i++)
                {
                        User* t = *i;
                        bool send_to_user = false;