mirror of
https://github.com/anope/anope.git
synced 2026-07-09 22:43:13 +02:00
Really fix bug #1088
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2355 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
+22
-13
@@ -125,28 +125,37 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], const char *
|
||||
if (MOD_RESULT == EVENT_STOP)
|
||||
return;
|
||||
|
||||
if (params.size() > 0 && ircdproto->IsChannelValid(params[0].c_str()))
|
||||
if (params.size() > 0)
|
||||
{
|
||||
if ((ci = cs_findchan(params[0].c_str())))
|
||||
if (ircdproto->IsChannelValid(params[0].c_str()))
|
||||
{
|
||||
if ((ci->flags & CI_FORBIDDEN) && (!c->HasFlag(CFLAG_ALLOW_FORBIDDEN)))
|
||||
if ((ci = cs_findchan(params[0].c_str())))
|
||||
{
|
||||
notice_lang(service, u, CHAN_X_FORBIDDEN, ci->name);
|
||||
alog("Access denied for user %s with service %s and command %s because of FORBIDDEN channel %s",
|
||||
u->nick, service, cmd, ci->name);
|
||||
return;
|
||||
if ((ci->flags & CI_FORBIDDEN) && (!c->HasFlag(CFLAG_ALLOW_FORBIDDEN)))
|
||||
{
|
||||
notice_lang(service, u, CHAN_X_FORBIDDEN, ci->name);
|
||||
alog("Access denied for user %s with service %s and command %s because of FORBIDDEN channel %s",
|
||||
u->nick, service, cmd, ci->name);
|
||||
return;
|
||||
}
|
||||
else if ((ci->flags & CI_SUSPENDED) && (!c->HasFlag(CFLAG_ALLOW_SUSPENDED)))
|
||||
{
|
||||
notice_lang(service, u, CHAN_X_FORBIDDEN, ci->name);
|
||||
alog("Access denied for user %s with service %s and command %s because of SUSPENDED channel %s",
|
||||
u->nick, service, cmd, ci->name);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if ((ci->flags & CI_SUSPENDED) && (!c->HasFlag(CFLAG_ALLOW_SUSPENDED)))
|
||||
else if (!c->HasFlag(CFLAG_ALLOW_UNREGISTEREDCHANNEL))
|
||||
{
|
||||
notice_lang(service, u, CHAN_X_FORBIDDEN, ci->name);
|
||||
alog("Access denied for user %s with service %s and command %s because of SUSPENDED channel %s",
|
||||
u->nick, service, cmd, ci->name);
|
||||
notice_lang(service, u, CHAN_X_NOT_REGISTERED, params[0].c_str());
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (!c->HasFlag(CFLAG_ALLOW_UNREGISTEREDCHANNEL))
|
||||
/* A user not giving a channel name for a param that should be a channel */
|
||||
else if ((cmdTable == CHANSERV || cmdTable == BOTSERV) && !c->HasFlag(CFLAG_STRIP_CHANNEL))
|
||||
{
|
||||
notice_lang(service, u, CHAN_X_NOT_REGISTERED, params[0].c_str());
|
||||
notice_lang(service, u, CHAN_X_INVALID, params[0].c_str());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -350,6 +350,7 @@ class CommandBSBot : public Command
|
||||
public:
|
||||
CommandBSBot() : Command("BOT", 1, 6)
|
||||
{
|
||||
this->SetFlag(CFLAG_STRIP_CHANNEL);
|
||||
}
|
||||
|
||||
CommandReturn Execute(User *u, std::vector<std::string> ¶ms)
|
||||
|
||||
@@ -21,6 +21,7 @@ class CommandBSHelp : public Command
|
||||
CommandBSHelp() : Command("HELP", 1, 1)
|
||||
{
|
||||
this->SetFlag(CFLAG_ALLOW_UNREGISTERED);
|
||||
this->SetFlag(CFLAG_STRIP_CHANNEL);
|
||||
}
|
||||
|
||||
CommandReturn Execute(User *u, std::vector<std::string> ¶ms)
|
||||
|
||||
@@ -49,6 +49,7 @@ class CommandBSInfo : public Command
|
||||
public:
|
||||
CommandBSInfo() : Command("INFO", 1, 1)
|
||||
{
|
||||
this->SetFlag(CFLAG_STRIP_CHANNEL);
|
||||
}
|
||||
|
||||
CommandReturn Execute(User *u, std::vector<std::string> ¶ms)
|
||||
|
||||
Reference in New Issue
Block a user