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);
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;
}
// 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
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;