List[I_OnPreCommand] = List[I_On005Numeric] = 1;
}
- virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated)
+ virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated)
{
/* If the command doesnt appear to be valid, we dont want to mess with it. */
if (!validated)
return 0;
- if (*user->oper)
+ if ((*user->oper) && (IS_LOCAL(user)) && (user->HasPermission(command)))
{
std::string plist = "";
for (int j = 0; j < pcnt; j++)
{
- plist.append(" "+parameters[j]);
+ plist.append(std::string(" ")+std::string(parameters[j]));
}
log(DEFAULT,"OPERLOG: [%s!%s@%s] %s%s",user->nick,user->ident,user->host,command.c_str(),plist.c_str());
}