return;
}
}
- if ((user->registered == 7) && (!*user->oper))
+ if ((user->registered == 7) && (!*user->oper) && (*Config->DisabledCommands))
{
std::stringstream dcmds(Config->DisabledCommands);
- while (!dcmds.eof())
+ std::string thiscmd;
+ while (dcmds >> thiscmd)
{
- std::string thiscmd;
- dcmds >> thiscmd;
-
if (!strcasecmp(thiscmd.c_str(),command))
{
// command is disabled!
bool CommandParser::CreateCommand(command_t *f)
{
/* create the command and push it onto the table */
- cmdlist[f->command] = f;
- log(DEBUG,"Added command %s (%lu parameters)",f->command.c_str(),(unsigned long)f->min_params);
- return true;
+ if (cmdlist.find(f->command) == cmdlist.end())
+ {
+ cmdlist[f->command] = f;
+ log(DEBUG,"Added command %s (%lu parameters)",f->command.c_str(),(unsigned long)f->min_params);
+ return true;
+ }
+ else return false;
}
CommandParser::CommandParser()