mirror of
https://github.com/anope/anope.git
synced 2026-06-29 11:36:38 +02:00
Set required command string for botserv modules.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2070 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
@@ -43,7 +43,7 @@ class CommandBSAssign : public Command
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (bi->flags & BI_PRIVATE && !is_oper(u))
|
||||
if (bi->flags & BI_PRIVATE && !u->na->nc->HasCommand("botserv/assign/private"))
|
||||
{
|
||||
notice_lang(s_BotServ, u, PERMISSION_DENIED);
|
||||
return MOD_CONT;
|
||||
@@ -66,8 +66,13 @@ class CommandBSAssign : public Command
|
||||
notice_lang(s_BotServ, u, BOT_ASSIGN_ALREADY, ci->bi->nick, chan);
|
||||
return MOD_CONT;
|
||||
}
|
||||
<<<<<<< HEAD:src/core/bs_assign.c
|
||||
|
||||
if ((ci->botflags & BS_NOBOT) || (!check_access(u, ci, CA_ASSIGN) && !is_services_admin(u)))
|
||||
=======
|
||||
|
||||
if ((ci->botflags & BS_NOBOT) || (!check_access(u, ci, CA_ASSIGN) && !u->na->nc->HasCommand("botserv/administration")))
|
||||
>>>>>>> Set required command string for botserv modules.:src/core/bs_assign.c
|
||||
{
|
||||
notice_lang(s_BotServ, u, PERMISSION_DENIED);
|
||||
return MOD_CONT;
|
||||
|
||||
@@ -261,7 +261,7 @@ class CommandBSBadwords : public Command
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (!check_access(u, ci, CA_BADWORDS) && (!need_args || !is_services_admin(u)))
|
||||
if (!check_access(u, ci, CA_BADWORDS) && (!need_args || !u->na->nc->HasCommand("botserv/administration")))
|
||||
{
|
||||
notice_lang(s_BotServ, u, ACCESS_DENIED);
|
||||
return MOD_CONT;
|
||||
|
||||
+21
-8
@@ -361,6 +361,12 @@ class CommandBSBot : public Command
|
||||
if (!stricmp(cmd, "ADD"))
|
||||
{
|
||||
// ADD nick user host real - 5
|
||||
if (!u->na->nc->HasCommand("botserv/bot/add"))
|
||||
{
|
||||
notice_lang(s_BotServ, u, PERMISSION_DENIED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (params.size() < 5)
|
||||
{
|
||||
this->OnSyntaxError(u);
|
||||
@@ -376,7 +382,13 @@ class CommandBSBot : public Command
|
||||
else if (!stricmp(cmd, "CHANGE"))
|
||||
{
|
||||
// CHANGE oldn newn user host real - 6
|
||||
// but only oldn and newn are required - Adam
|
||||
// but only oldn and newn are required
|
||||
if (!u->na->nc->HasCommand("botserv/bot/change"))
|
||||
{
|
||||
notice_lang(s_BotServ, u, PERMISSION_DENIED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (params.size() < 3)
|
||||
{
|
||||
this->OnSyntaxError(u);
|
||||
@@ -388,6 +400,12 @@ class CommandBSBot : public Command
|
||||
else if (!stricmp(cmd, "DEL"))
|
||||
{
|
||||
// DEL nick
|
||||
if (!u->na->nc->HasCommand("botserv/bot/del"))
|
||||
{
|
||||
notice_lang(s_BotServ, u, PERMISSION_DENIED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (params.size() < 1)
|
||||
{
|
||||
this->OnSyntaxError(u);
|
||||
@@ -404,10 +422,7 @@ class CommandBSBot : public Command
|
||||
|
||||
bool OnHelp(User *u, const std::string &subcommand)
|
||||
{
|
||||
if (!is_services_admin(u) && !is_services_root(u))
|
||||
return false;
|
||||
|
||||
notice_help(s_BotServ, u, BOT_SERVADMIN_HELP_BOT);
|
||||
notice_lang(s_BotServ, u, BOT_SERVADMIN_HELP_BOT);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -438,9 +453,7 @@ class BSBot : public Module
|
||||
**/
|
||||
void myBotServHelp(User * u)
|
||||
{
|
||||
if (is_services_admin(u)) {
|
||||
notice_lang(s_BotServ, u, BOT_HELP_CMD_BOT);
|
||||
}
|
||||
notice_lang(s_BotServ, u, BOT_HELP_CMD_BOT);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ class CommandBSBotList : public Command
|
||||
}
|
||||
}
|
||||
|
||||
if (is_oper(u) && count < nbots) {
|
||||
if (u->na->nc->HasCommand("botserv/botlist") && count < nbots) {
|
||||
notice_lang(s_BotServ, u, BOT_BOTLIST_PRIVATE_HEADER);
|
||||
|
||||
for (i = 0; i < 256; i++) {
|
||||
|
||||
+9
-5
@@ -59,11 +59,12 @@ class CommandBSInfo : public Command
|
||||
ChannelInfo *ci;
|
||||
const char *query = params[0].c_str();
|
||||
|
||||
int need_comma = 0, is_servadmin = is_services_admin(u);
|
||||
int need_comma = 0;
|
||||
char buf[BUFSIZE], *end;
|
||||
const char *commastr = getstring(u->na, COMMA_SPACE);
|
||||
|
||||
if ((bi = findbot(query))) {
|
||||
if ((bi = findbot(query)))
|
||||
{
|
||||
struct tm *tm;
|
||||
|
||||
notice_lang(s_BotServ, u, BOT_INFO_BOT_HEADER, bi->nick);
|
||||
@@ -79,10 +80,13 @@ class CommandBSInfo : public Command
|
||||
BOT_INFO_OPT_NONE));
|
||||
notice_lang(s_BotServ, u, BOT_INFO_BOT_USAGE, bi->chancount);
|
||||
|
||||
if (is_services_admin(u))
|
||||
if (u->na->nc->HasCommand("botserv/administration"))
|
||||
this->send_bot_channels(u, bi);
|
||||
} else if ((ci = cs_findchan(query))) {
|
||||
if (!is_servadmin && !is_founder(u, ci)) {
|
||||
}
|
||||
else if ((ci = cs_findchan(query)))
|
||||
{
|
||||
if (!is_founder(u, ci) && !u->na->nc->HasCommand("botserv/administration"))
|
||||
{
|
||||
notice_lang(s_BotServ, u, PERMISSION_DENIED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ class CommandBSKick : public Command
|
||||
notice_lang(s_BotServ, u, CHAN_X_NOT_REGISTERED, chan);
|
||||
else if (ci->flags & CI_FORBIDDEN)
|
||||
notice_lang(s_BotServ, u, CHAN_X_FORBIDDEN, chan);
|
||||
else if (!is_services_admin(u) && !check_access(u, ci, CA_SET))
|
||||
else if (!check_access(u, ci, CA_SET) && !u->na->nc->HasCommand("botserv/administration"))
|
||||
notice_lang(s_BotServ, u, ACCESS_DENIED);
|
||||
else if (!ci->bi)
|
||||
notice_help(s_BotServ, u, BOT_NOT_ASSIGNED);
|
||||
|
||||
+8
-9
@@ -29,7 +29,6 @@ class CommandBSSet : public Command
|
||||
const char *chan = params[0].c_str();
|
||||
const char *option = params[1].c_str();
|
||||
const char *value = params[2].c_str();
|
||||
int is_servadmin = is_services_admin(u);
|
||||
ChannelInfo *ci;
|
||||
|
||||
if (readonly)
|
||||
@@ -38,7 +37,7 @@ class CommandBSSet : public Command
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (is_servadmin && !stricmp(option, "PRIVATE"))
|
||||
if (u->na->nc->HasCommand("botserv/set/private") && !stricmp(option, "PRIVATE"))
|
||||
{
|
||||
BotInfo *bi;
|
||||
|
||||
@@ -67,7 +66,7 @@ class CommandBSSet : public Command
|
||||
notice_lang(s_BotServ, u, CHAN_X_NOT_REGISTERED, chan);
|
||||
else if (ci->flags & CI_FORBIDDEN)
|
||||
notice_lang(s_BotServ, u, CHAN_X_FORBIDDEN, chan);
|
||||
else if (!is_servadmin && !check_access(u, ci, CA_SET))
|
||||
else if (!u->na->nc->HasCommand("botserv/administration") && !check_access(u, ci, CA_SET))
|
||||
notice_lang(s_BotServ, u, ACCESS_DENIED);
|
||||
else {
|
||||
if (!stricmp(option, "DONTKICKOPS")) {
|
||||
@@ -118,7 +117,7 @@ class CommandBSSet : public Command
|
||||
syntax_error(s_BotServ, u, "SET GREET",
|
||||
BOT_SET_GREET_SYNTAX);
|
||||
}
|
||||
} else if (is_servadmin && !stricmp(option, "NOBOT")) {
|
||||
} else if (u->na->nc->HasCommand("botserv/set/nobot") && !stricmp(option, "NOBOT")) {
|
||||
if (!stricmp(value, "ON")) {
|
||||
ci->botflags |= BS_NOBOT;
|
||||
if (ci->bi)
|
||||
@@ -160,11 +159,11 @@ class CommandBSSet : public Command
|
||||
else if (subcommand == "GREET")
|
||||
notice_help(s_BotServ, u, BOT_HELP_SET_GREET);
|
||||
else if (subcommand == "SYMBIOSIS")
|
||||
notice_help(s_BotServ, u, BOT_HELP_SET_SYMBIOSIS, s_ChanServ);
|
||||
else if (subcommand == "NOBOT" && (is_services_admin(u) || is_services_root(u)))
|
||||
notice_help(s_BotServ, u, BOT_SERVADMIN_HELP_SET_NOBOT);
|
||||
else if (subcommand == "PRIVATE" && (is_services_admin(u) || is_services_root(u)))
|
||||
notice_help(s_BotServ, u, BOT_SERVADMIN_HELP_SET_PRIVATE);
|
||||
notice_lang(s_BotServ, u, BOT_HELP_SET_SYMBIOSIS);
|
||||
else if (subcommand == "NOBOT")
|
||||
notice_lang(s_BotServ, u, BOT_SERVADMIN_HELP_SET_NOBOT);
|
||||
else if (subcommand == "PRIVATE")
|
||||
notice_lang(s_BotServ, u, BOT_SERVADMIN_HELP_SET_PRIVATE);
|
||||
else if (subcommand.empty())
|
||||
{
|
||||
notice_help(s_BotServ, u, BOT_HELP_SET);
|
||||
|
||||
@@ -36,7 +36,7 @@ class CommandBSUnassign : public Command
|
||||
notice_lang(s_BotServ, u, CHAN_X_NOT_REGISTERED, chan);
|
||||
else if (ci->flags & CI_FORBIDDEN)
|
||||
notice_lang(s_BotServ, u, CHAN_X_FORBIDDEN, chan);
|
||||
else if (!is_services_admin(u) && !check_access(u, ci, CA_ASSIGN))
|
||||
else if (!u->na->nc->HasCommand("botserv/administration") && !check_access(u, ci, CA_ASSIGN))
|
||||
notice_lang(s_BotServ, u, ACCESS_DENIED);
|
||||
else if (!ci->bi)
|
||||
notice_help(s_BotServ, u, BOT_NOT_ASSIGNED);
|
||||
|
||||
Reference in New Issue
Block a user