]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fixes to typos and change to return by reference on GetClass
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 1 Jan 2006 20:57:42 +0000 (20:57 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 1 Jan 2006 20:57:42 +0000 (20:57 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2725 e03df62e-2008-0410-955e-edbf42e46eb7

include/helperfuncs.h
src/cmd_pass.cpp
src/helperfuncs.cpp
src/users.cpp

index 9e1d511cb58a547b3ab9a416031ab6d52463bb37..5153620dba69e9d4a00c2bc30c7288adc554bc1c 100644 (file)
@@ -68,7 +68,7 @@ char* chanmodes(chanrec *chan);
 void userlist(userrec *user,chanrec *c);
 int usercount_i(chanrec *c);
 int usercount(chanrec *c);
-ConnectClass* GetClass(userrec *user);
+ConnectClass GetClass(userrec *user);
 void send_error(char *s);
 void Error(int status);
 int usercnt(void);
index 0e40fea8181bdafd63b3035413e093ecc0f5bcbe..9bc6c1ae7b57da04788f611763a1e258d491dd17 100644 (file)
@@ -70,9 +70,9 @@ void cmd_pass::Handle (char **parameters, int pcnt, userrec *user)
                WriteServ(user->fd,"462 %s :You may not reregister",user->nick);
                return;
        }
-       ConnectClass* a = GetClass(user);
+       ConnectClass a = GetClass(user);
        strlcpy(user->password,parameters[0],MAXBUF);
-       if (!strcmp(parameters[0],a->pass.c_str()))
+       if (!strcmp(parameters[0],a.pass.c_str()))
        {
                user->haspassed = true;
        }
index 2ff939dc6b59018eef9d38f36f4505c133f666f7..fd39aa0b13e02cfa35dc35a3daf2a49b39e59dc4 100644 (file)
@@ -1153,16 +1153,16 @@ int usercount(chanrec *c)
 
 // looks up a users password for their connection class (<ALLOW>/<DENY> tags)
 
-ConnectClass* GetClass(userrec *user)
+ConnectClass GetClass(userrec *user)
 {
         for (ClassVector::iterator i = Config->Classes.begin(); i != Config->Classes.end(); i++)
         {
                 if (match(user->host,i->host.c_str()))
                 {
-                        return (ConnectClass*)i->second;
+                        return *i;
                 }
         }
-        return "";
+        return *(Config->Classes.begin());
 }
 
 /* sends out an error notice to all connected clients (not to be used
index fd7efb7aabd343eba638c5643a70432692650827..e913086c2d5c7ada102ae45ee8ebc97d2d71ebca 100644 (file)
@@ -642,14 +642,14 @@ void FullConnectUser(userrec* user, CullList* Goners)
         user->idle_lastmsg = TIME;
         log(DEBUG,"ConnectUser: %s",user->nick);
 
-       ConnectClass* a = GetClass(user);
+       ConnectClass a = GetClass(user);
        
-       if (a->type == CC_DENY)
+       if (a.type == CC_DENY)
        {
                Goners->AddItem(user,"Unauthorised connection");
                return;
        }
-       if ((*(a->pass.c_str())) && (!user->haspassed))
+       if ((*(a.pass.c_str())) && (!user->haspassed))
         {
                Goners->AddItem(user,"Invalid password");
                 return;