* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
- * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
- * E-mail:
- * <brain@chatspike.net>
- * <Craig@chatspike.net>
+ * InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
*
- * Written by Craig Edwards, Craig McLure, and others.
* This program is free but copyrighted software; see
* the file COPYING for details.
*
return (find(Config->ulines.begin(),Config->ulines.end(),server) != Config->ulines.end());
}
-int InspIRCd::OperPassCompare(const char* data,const char* input)
+int InspIRCd::OperPassCompare(const char* data,const char* input, int tagnumber)
{
int MOD_RESULT = 0;
- FOREACH_RESULT_I(this,I_OnOperCompare,OnOperCompare(data,input))
+ FOREACH_RESULT_I(this,I_OnOperCompare,OnOperCompare(data, input, tagnumber))
Log(DEBUG,"OperPassCompare: %d",MOD_RESULT);
if (MOD_RESULT == 1)
return 0;
* By using std::map (thanks for the idea w00t) we can cut this down a ton.
* ...VOOODOOOO!
*/
- std::map<std::string, bool> dupes;
+ std::map<irc::string, bool> dupes;
/* Create two lists, one for channel names, one for keys
*/
*/
while (((item = items1.GetToken()) != "") && (max++ < ServerInstance->Config->MaxTargets))
{
- if (dupes.find(item) == dupes.end())
+ if (dupes.find(item.c_str()) == dupes.end())
{
const char* new_parameters[127];
new_parameters[splithere] = item.c_str();
new_parameters[extra] = extrastuff.c_str();
- CommandObj->Handle(new_parameters,pcnt,user);
+ if (CommandObj->Handle(new_parameters,pcnt,user) == CMD_USER_DELETED)
+ return 1;
- dupes[item] = true;
+ dupes[item.c_str()] = true;
}
}
return 1;
if (!strchr(parameters[splithere],','))
return 0;
- std::map<std::string, bool> dupes;
+ std::map<irc::string, bool> dupes;
/* Only one commasepstream here */
ServerInstance->Log(DEBUG,"Splitting '%s'",parameters[splithere]);
*/
while (((item = items1.GetToken()) != "") && (max++ < ServerInstance->Config->MaxTargets))
{
- if (dupes.find(item) == dupes.end())
+ if (dupes.find(item.c_str()) == dupes.end())
{
const char* new_parameters[127];
new_parameters[splithere] = item.c_str();
parameters[splithere] = item.c_str();
- CommandObj->Handle(new_parameters,pcnt,user);
- dupes[item] = true;
+ /* Execute the command handler over and over. If someone pulls our user
+ * record out from under us (e.g. if we /kill a comma sep list, and we're
+ * in that list ourselves) abort if we're gone.
+ */
+ if (CommandObj->Handle(new_parameters,pcnt,user) == CMD_USER_DELETED)
+ return 1;
+
+ dupes[item.c_str()] = true;
}
}
/* By returning 1 we tell our caller that nothing is to be done,
{
if (!user->IsModeSet(cm->second->flags_needed))
{
- user->WriteServ("481 %s :Permission Denied- You do not have the required operator privilages",user->nick);
+ user->WriteServ("481 %s :Permission Denied- You do not have the required operator privileges",user->nick);
return;
}
if (!user->HasPermission(command))
if (ServerInstance->Parser->ReloadCommand(parameters[0]))
{
user->WriteServ("NOTICE %s :*** Successfully reloaded command '%s'", user->nick, parameters[0]);
+ ServerInstance->WriteOpers("*** RELOAD: %s reloaded the '%s' command.", user->nick, parameters[0]);
return CMD_SUCCESS;
}
else