diff options
author | adam- <adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-07-02 19:02:35 +0000 |
---|---|---|
committer | adam- <adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-07-02 19:02:35 +0000 |
commit | 4d19a783bd0dc0c6ed904850c7090e56df774655 (patch) | |
tree | 02a07a44b12fc82dd23fdbb0dccc17cbb2168002 /src/commands.c | |
parent | bd6a593b6c564ae2d5e39f761fe8b16d0fa29236 (diff) |
Really fix bug #1088
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2355 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/commands.c')
-rw-r--r-- | src/commands.c | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/src/commands.c b/src/commands.c index 7fe9f829b..034725b31 100644 --- a/src/commands.c +++ b/src/commands.c @@ -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; } } |