diff options
| author | Adam <Adam@anope.org> | 2011-03-14 13:52:26 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2011-03-14 13:52:26 -0400 |
| commit | ed73d7675152ccc66f20daedca8586a8de254a84 (patch) | |
| tree | 18f7a1a53a717f24d061550c6670ca6f0ed54f9f /modules/core | |
| parent | 4fe49af8401b956249d924b89b3e69bce5fb6744 (diff) | |
Rewrote some of the opertype system, added os_login
Diffstat (limited to 'modules/core')
43 files changed, 176 insertions, 90 deletions
diff --git a/modules/core/bs_assign.cpp b/modules/core/bs_assign.cpp index d86a07c23..f1000cb11 100644 --- a/modules/core/bs_assign.cpp +++ b/modules/core/bs_assign.cpp @@ -41,13 +41,13 @@ class CommandBSAssign : public Command return MOD_CONT; } - if (ci->botflags.HasFlag(BS_NOBOT) || (!check_access(u, ci, CA_ASSIGN) && !u->Account()->HasPriv("botserv/administration"))) + if (ci->botflags.HasFlag(BS_NOBOT) || (!check_access(u, ci, CA_ASSIGN) && !u->HasPriv("botserv/administration"))) { source.Reply(_(ACCESS_DENIED)); return MOD_CONT; } - if (bi->HasFlag(BI_PRIVATE) && !u->Account()->HasCommand("botserv/assign/private")) + if (bi->HasFlag(BI_PRIVATE) && !u->HasCommand("botserv/assign/private")) { source.Reply(_(ACCESS_DENIED)); return MOD_CONT; diff --git a/modules/core/bs_badwords.cpp b/modules/core/bs_badwords.cpp index 7de30afe2..5117055a3 100644 --- a/modules/core/bs_badwords.cpp +++ b/modules/core/bs_badwords.cpp @@ -58,7 +58,7 @@ class BadwordsDelCallback : public NumberList public: BadwordsDelCallback(CommandSource &_source, Command *_c, const Anope::string &list) : NumberList(list, true), source(_source), c(_c), Deleted(0), override(false) { - if (!check_access(source.u, source.ci, CA_BADWORDS) && source.u->Account()->HasPriv("botserv/administration")) + if (!check_access(source.u, source.ci, CA_BADWORDS) && source.u->HasPriv("botserv/administration")) this->override = true; } @@ -245,7 +245,7 @@ class CommandBSBadwords : public Command return MOD_CONT; } - if (!check_access(u, ci, CA_BADWORDS) && (!need_args || !u->Account()->HasPriv("botserv/administration"))) + if (!check_access(u, ci, CA_BADWORDS) && (!need_args || !u->HasPriv("botserv/administration"))) { source.Reply(_(ACCESS_DENIED)); return MOD_CONT; diff --git a/modules/core/bs_bot.cpp b/modules/core/bs_bot.cpp index 50812d0d0..d35d90ec1 100644 --- a/modules/core/bs_bot.cpp +++ b/modules/core/bs_bot.cpp @@ -321,7 +321,7 @@ class CommandBSBot : public Command if (cmd.equals_ci("ADD")) { // ADD nick user host real - 5 - if (!u->Account()->HasCommand("botserv/bot/add")) + if (!u->HasCommand("botserv/bot/add")) { source.Reply(_(ACCESS_DENIED)); return MOD_CONT; @@ -344,7 +344,7 @@ class CommandBSBot : public Command { // CHANGE oldn newn user host real - 6 // but only oldn and newn are required - if (!u->Account()->HasCommand("botserv/bot/change")) + if (!u->HasCommand("botserv/bot/change")) { source.Reply(_(ACCESS_DENIED)); return MOD_CONT; @@ -361,7 +361,7 @@ class CommandBSBot : public Command else if (cmd.equals_ci("DEL")) { // DEL nick - if (!u->Account()->HasCommand("botserv/bot/del")) + if (!u->HasCommand("botserv/bot/del")) { source.Reply(_(ACCESS_DENIED)); return MOD_CONT; diff --git a/modules/core/bs_botlist.cpp b/modules/core/bs_botlist.cpp index b9c1f9287..bd2413b36 100644 --- a/modules/core/bs_botlist.cpp +++ b/modules/core/bs_botlist.cpp @@ -39,7 +39,7 @@ class CommandBSBotList : public Command } } - if (u->Account()->HasCommand("botserv/botlist") && count < BotListByNick.size()) + if (u->HasCommand("botserv/botlist") && count < BotListByNick.size()) { source.Reply(_("Bots reserved to IRC operators:")); diff --git a/modules/core/bs_help.cpp b/modules/core/bs_help.cpp index 7c0d2da70..f8fc414b5 100644 --- a/modules/core/bs_help.cpp +++ b/modules/core/bs_help.cpp @@ -41,7 +41,7 @@ class CommandBSHelp : public Command "%s HELP \037command\037\002."), BotServ->nick.c_str(), BotServ->nick.c_str(), BotServ->nick.c_str()); for (CommandMap::const_iterator it = BotServ->Commands.begin(), it_end = BotServ->Commands.end(); it != it_end; ++it) - if (!Config->HidePrivilegedCommands || it->second->permission.empty() || (u->Account() && u->Account()->HasCommand(it->second->permission))) + if (!Config->HidePrivilegedCommands || it->second->permission.empty() || u->HasCommand(it->second->permission)) it->second->OnServHelp(source); source.Reply(_("Bot will join a channel whenever there is at least\n" "\002%d\002 user(s) on it. Additionally, all %s commands\n" diff --git a/modules/core/bs_info.cpp b/modules/core/bs_info.cpp index 828a1bf2d..a5853f611 100644 --- a/modules/core/bs_info.cpp +++ b/modules/core/bs_info.cpp @@ -65,12 +65,12 @@ class CommandBSInfo : public Command source.Reply(_(" Options : %s"), bi->HasFlag(BI_PRIVATE) ? _("Private") : _("None")); source.Reply(_(" Used on : %d channel(s)"), bi->chancount); - if (u->Account()->HasPriv("botserv/administration")) + if (u->HasPriv("botserv/administration")) this->send_bot_channels(source, bi); } else if ((ci = cs_findchan(query))) { - if (!check_access(u, ci, CA_FOUNDER) && !u->Account()->HasPriv("botserv/administration")) + if (!check_access(u, ci, CA_FOUNDER) && !u->HasPriv("botserv/administration")) { source.Reply(_(ACCESS_DENIED)); return MOD_CONT; diff --git a/modules/core/bs_kick.cpp b/modules/core/bs_kick.cpp index 7ca21f9ce..316b50be6 100644 --- a/modules/core/bs_kick.cpp +++ b/modules/core/bs_kick.cpp @@ -38,7 +38,7 @@ class CommandBSKick : public Command SyntaxError(source, "KICK", _("KICK \037channel\037 \037option\037 {\037ON|\037} [\037settings\037]")); else if (!value.equals_ci("ON") && !value.equals_ci("OFF")) SyntaxError(source, "KICK", _("KICK \037channel\037 \037option\037 {\037ON|\037} [\037settings\037]")); - else if (!check_access(u, ci, CA_SET) && !u->Account()->HasPriv("botserv/administration")) + else if (!check_access(u, ci, CA_SET) && !u->HasPriv("botserv/administration")) source.Reply(_(ACCESS_DENIED)); else if (!ci->bi) source.Reply(_(BOT_NOT_ASSIGNED)); diff --git a/modules/core/bs_set.cpp b/modules/core/bs_set.cpp index b149857d0..96a8c2b83 100644 --- a/modules/core/bs_set.cpp +++ b/modules/core/bs_set.cpp @@ -33,7 +33,7 @@ class CommandBSSet : public Command if (readonly) source.Reply(_("Sorry, bot option setting is temporarily disabled.")); - else if (u->Account()->HasCommand("botserv/set/private") && option.equals_ci("PRIVATE")) + else if (u->HasCommand("botserv/set/private") && option.equals_ci("PRIVATE")) { BotInfo *bi; @@ -59,7 +59,7 @@ class CommandBSSet : public Command } else if (!(ci = cs_findchan(chan))) source.Reply(_(CHAN_X_NOT_REGISTERED), chan.c_str()); - else if (!u->Account()->HasPriv("botserv/administration") && !check_access(u, ci, CA_SET)) + else if (!u->HasPriv("botserv/administration") && !check_access(u, ci, CA_SET)) source.Reply(_(ACCESS_DENIED)); else { @@ -126,7 +126,7 @@ class CommandBSSet : public Command else SyntaxError(source, "SET GREET", _("SET \037channel\037 GREET {\037ON|\037}")); } - else if (u->Account()->HasCommand("botserv/set/nobot") && option.equals_ci("NOBOT")) + else if (u->HasCommand("botserv/set/nobot") && option.equals_ci("NOBOT")) { if (value.equals_ci("ON")) { @@ -218,7 +218,7 @@ class CommandBSSet : public Command "Note: access to this command is controlled by the\n" "level SET."), BotServ->nick.c_str()); User *u = source.u; - if (u->Account() && u->Account()->IsServicesOper()) + if (u->IsServicesOper()) source.Reply(_("These options are reserved to Services Operators:\n" " \n" " NOBOT Prevent a bot from being assigned to \n" diff --git a/modules/core/bs_unassign.cpp b/modules/core/bs_unassign.cpp index 884939f84..f64cb526d 100644 --- a/modules/core/bs_unassign.cpp +++ b/modules/core/bs_unassign.cpp @@ -30,7 +30,7 @@ class CommandBSUnassign : public Command if (readonly) source.Reply(_(BOT_ASSIGN_READONLY)); - else if (!u->Account()->HasPriv("botserv/administration") && !check_access(u, ci, CA_ASSIGN)) + else if (!u->HasPriv("botserv/administration") && !check_access(u, ci, CA_ASSIGN)) source.Reply(_(ACCESS_DENIED)); else if (!ci->bi) source.Reply(_(BOT_NOT_ASSIGNED)); diff --git a/modules/core/cs_access.cpp b/modules/core/cs_access.cpp index d65f0b718..e2e2a946e 100644 --- a/modules/core/cs_access.cpp +++ b/modules/core/cs_access.cpp @@ -110,7 +110,7 @@ class AccessDelCallback : public NumberList public: AccessDelCallback(CommandSource &_source, Command *_c, const Anope::string &numlist) : NumberList(numlist, true), source(_source), c(_c), Deleted(0), Denied(false) { - if (!check_access(source.u, source.ci, CA_ACCESS_CHANGE) && source.u->Account()->HasPriv("chanserv/access/modify")) + if (!check_access(source.u, source.ci, CA_ACCESS_CHANGE) && source.u->HasPriv("chanserv/access/modify")) this->override = true; } @@ -143,7 +143,7 @@ class AccessDelCallback : public NumberList ChanAccess *u_access = ci->GetAccess(u); int16 u_level = u_access ? u_access->level : 0; - if (u_level <= access->level && !u->Account()->HasPriv("chanserv/access/modify")) + if (u_level <= access->level && !u->HasPriv("chanserv/access/modify")) { Denied = true; return; @@ -179,7 +179,7 @@ class CommandCSAccess : public Command ChanAccess *u_access = ci->GetAccess(u); int16 u_level = u_access ? u_access->level : 0; - if (level >= u_level && !u->Account()->HasPriv("chanserv/access/modify")) + if (level >= u_level && !u->HasPriv("chanserv/access/modify")) { source.Reply(_(ACCESS_DENIED)); return MOD_CONT; @@ -211,7 +211,7 @@ class CommandCSAccess : public Command if (access) { /* Don't allow lowering from a level >= u_level */ - if (access->level >= u_level && !u->Account()->HasPriv("chanserv/access/modify")) + if (access->level >= u_level && !u->HasPriv("chanserv/access/modify")) { source.Reply(_(ACCESS_DENIED)); return MOD_CONT; @@ -267,7 +267,7 @@ class CommandCSAccess : public Command int16 u_level = u_access ? u_access->level : 0; if (!access) source.Reply(_("\002%s\002 not found on %s access list."), mask.c_str(), ci->name.c_str()); - else if (access->nc != u->Account() && check_access(u, ci, CA_NOJOIN) && u_level <= access->level && !u->Account()->HasPriv("chanserv/access/modify")) + else if (access->nc != u->Account() && check_access(u, ci, CA_NOJOIN) && u_level <= access->level && !u->HasPriv("chanserv/access/modify")) source.Reply(_(ACCESS_DENIED)); else { @@ -373,7 +373,7 @@ class CommandCSAccess : public Command User *u = source.u; ChannelInfo *ci = source.ci; - if (!IsFounder(u, ci) && !u->Account()->HasPriv("chanserv/access/modify")) + if (!IsFounder(u, ci) && !u->HasPriv("chanserv/access/modify")) source.Reply(_(ACCESS_DENIED)); else { @@ -688,7 +688,7 @@ class CommandCSLevels : public Command this->OnSyntaxError(source, cmd); else if (ci->HasFlag(CI_XOP)) source.Reply(_("Levels are not available as xOP is enabled on this channel.")); - else if (!check_access(u, ci, CA_FOUNDER) && !u->Account()->HasPriv("chanserv/access/modify")) + else if (!check_access(u, ci, CA_FOUNDER) && !u->HasPriv("chanserv/access/modify")) source.Reply(_(ACCESS_DENIED)); else if (cmd.equals_ci("SET")) this->DoSet(source, params); diff --git a/modules/core/cs_akick.cpp b/modules/core/cs_akick.cpp index 920dfc6f7..bad0e6d22 100644 --- a/modules/core/cs_akick.cpp +++ b/modules/core/cs_akick.cpp @@ -488,7 +488,7 @@ class CommandCSAKick : public Command if (mask.empty() && (cmd.equals_ci("ADD") || cmd.equals_ci("DEL"))) this->OnSyntaxError(source, cmd); - else if (!check_access(u, ci, CA_AKICK) && !u->Account()->HasPriv("chanserv/access/modify")) + else if (!check_access(u, ci, CA_AKICK) && !u->HasPriv("chanserv/access/modify")) source.Reply(_(ACCESS_DENIED)); else if (!cmd.equals_ci("LIST") && !cmd.equals_ci("VIEW") && !cmd.equals_ci("ENFORCE") && readonly) source.Reply(_("Sorry, channel autokick list modification is temporarily disabled.")); diff --git a/modules/core/cs_clone.cpp b/modules/core/cs_clone.cpp index f816eb2f5..5b264c8df 100644 --- a/modules/core/cs_clone.cpp +++ b/modules/core/cs_clone.cpp @@ -47,7 +47,7 @@ public: return MOD_CONT; } - if (Config->CSMaxReg && u->Account()->channelcount >= Config->CSMaxReg && !u->Account()->HasPriv("chanserv/no-register-limit")) + if (Config->CSMaxReg && u->Account()->channelcount >= Config->CSMaxReg && !u->HasPriv("chanserv/no-register-limit")) { source.Reply(u->Account()->channelcount > Config->CSMaxReg ? _(CHAN_EXCEEDED_CHANNEL_LIMIT) : _(CHAN_REACHED_CHANNEL_LIMIT), Config->CSMaxReg); return MOD_CONT; diff --git a/modules/core/cs_drop.cpp b/modules/core/cs_drop.cpp index 44e58693e..248cfa37e 100644 --- a/modules/core/cs_drop.cpp +++ b/modules/core/cs_drop.cpp @@ -38,19 +38,19 @@ class CommandCSDrop : public Command ci = cs_findchan(chan); - if (ci->HasFlag(CI_FORBIDDEN) && !u->Account()->HasCommand("chanserv/drop")) + if (ci->HasFlag(CI_FORBIDDEN) && !u->HasCommand("chanserv/drop")) { source.Reply(_(CHAN_X_FORBIDDEN), chan.c_str()); return MOD_CONT; } - if (ci->HasFlag(CI_SUSPENDED) && !u->Account()->HasCommand("chanserv/drop")) + if (ci->HasFlag(CI_SUSPENDED) && !u->HasCommand("chanserv/drop")) { source.Reply(_(CHAN_X_FORBIDDEN), chan.c_str()); return MOD_CONT; } - if ((ci->HasFlag(CI_SECUREFOUNDER) ? !IsFounder(u, ci) : !check_access(u, ci, CA_FOUNDER)) && !u->Account()->HasCommand("chanserv/drop")) + if ((ci->HasFlag(CI_SECUREFOUNDER) ? !IsFounder(u, ci) : !check_access(u, ci, CA_FOUNDER)) && !u->HasCommand("chanserv/drop")) { source.Reply(_(ACCESS_DENIED)); return MOD_CONT; @@ -82,7 +82,7 @@ class CommandCSDrop : public Command bool OnHelp(CommandSource &source, const Anope::string &subcommand) { User *u = source.u; - if (u->Account() && u->Account()->IsServicesOper()) + if (u->IsServicesOper()) source.Reply(_("Syntax: \002DROP \037channel\037\002\n" " \n" "Unregisters the named channel. Only \002Services Operators\002\n" diff --git a/modules/core/cs_getkey.cpp b/modules/core/cs_getkey.cpp index e9b685a34..da71e690e 100644 --- a/modules/core/cs_getkey.cpp +++ b/modules/core/cs_getkey.cpp @@ -28,7 +28,7 @@ class CommandCSGetKey : public Command User *u = source.u; ChannelInfo *ci = source.ci; - if (!check_access(u, ci, CA_GETKEY) && !u->Account()->HasCommand("chanserv/getkey")) + if (!check_access(u, ci, CA_GETKEY) && !u->HasCommand("chanserv/getkey")) { source.Reply(_(ACCESS_DENIED)); return MOD_CONT; diff --git a/modules/core/cs_help.cpp b/modules/core/cs_help.cpp index db34fc8ea..67b2354f9 100644 --- a/modules/core/cs_help.cpp +++ b/modules/core/cs_help.cpp @@ -42,13 +42,13 @@ class CommandCSHelp : public Command ChanServ->nick.c_str(), ChanServ->nick.c_str(), ChanServ->nick.c_str(), ChanServ->nick.c_str()); for (CommandMap::const_iterator it = ChanServ->Commands.begin(); it != ChanServ->Commands.end(); ++it) - if (!Config->HidePrivilegedCommands || it->second->permission.empty() || (u->Account() && u->Account()->HasCommand(it->second->permission))) + if (!Config->HidePrivilegedCommands || it->second->permission.empty() || u->HasCommand(it->second->permission)) it->second->OnServHelp(source); if (Config->CSExpire >= 86400) source.Reply(_("Note that any channel which is not used for %d days\n" "(i.e. which no user on the channel's access list enters\n" "for that period of time) will be automatically dropped."), Config->CSExpire / 86400); - if (u->Account() && u->Account()->IsServicesOper()) + if (u->IsServicesOper()) source.Reply(_(" \n" "Services Operators can also drop any channel without needing\n" "to identify via password, and may view the access, AKICK,\n" diff --git a/modules/core/cs_info.cpp b/modules/core/cs_info.cpp index a0b07d759..48baa67ae 100644 --- a/modules/core/cs_info.cpp +++ b/modules/core/cs_info.cpp @@ -42,7 +42,7 @@ class CommandCSInfo : public Command User *u = source.u; ChannelInfo *ci = source.ci; - bool has_auspex = u->IsIdentified() && u->Account()->HasPriv("chanserv/auspex"); + bool has_auspex = u->IsIdentified() && u->HasPriv("chanserv/auspex"); bool show_all = false; if (ci->HasFlag(CI_FORBIDDEN)) diff --git a/modules/core/cs_list.cpp b/modules/core/cs_list.cpp index 32894242b..8e3d75e5f 100644 --- a/modules/core/cs_list.cpp +++ b/modules/core/cs_list.cpp @@ -30,7 +30,7 @@ class CommandCSList : public Command Anope::string pattern = params[0]; unsigned nchans; char buf[BUFSIZE]; - bool is_servadmin = u->Account()->HasCommand("chanserv/list"); + bool is_servadmin = u->HasCommand("chanserv/list"); int count = 0, from = 0, to = 0; bool forbidden = false, suspended = false, channoexpire = false; diff --git a/modules/core/cs_mode.cpp b/modules/core/cs_mode.cpp index 209ee751f..55da9762c 100644 --- a/modules/core/cs_mode.cpp +++ b/modules/core/cs_mode.cpp @@ -314,7 +314,7 @@ class CommandCSMode : public Command if (!ci || !ci->c) source.Reply(_(CHAN_X_NOT_IN_USE), ci->name.c_str()); - else if (!check_access(u, ci, CA_MODE) && !u->Account()->HasCommand("chanserv/mode")) + else if (!check_access(u, ci, CA_MODE) && !u->HasCommand("chanserv/mode")) source.Reply(_(ACCESS_DENIED)); else if (subcommand.equals_ci("LOCK")) this->DoLock(source, params); diff --git a/modules/core/cs_register.cpp b/modules/core/cs_register.cpp index 995c0e65b..13aa17d35 100644 --- a/modules/core/cs_register.cpp +++ b/modules/core/cs_register.cpp @@ -45,7 +45,7 @@ class CommandCSRegister : public Command source.Reply(_("Channel \002%s\002 is already registered!"), chan.c_str()); else if (c && !c->HasUserStatus(u, CMODE_OP)) source.Reply(_("You must be a channel operator to register the channel.")); - else if (Config->CSMaxReg && u->Account()->channelcount >= Config->CSMaxReg && !u->Account()->HasPriv("chanserv/no-register-limit")) + else if (Config->CSMaxReg && u->Account()->channelcount >= Config->CSMaxReg && !u->HasPriv("chanserv/no-register-limit")) source.Reply(u->Account()->channelcount > Config->CSMaxReg ? _(CHAN_EXCEEDED_CHANNEL_LIMIT) : _(CHAN_REACHED_CHANNEL_LIMIT), Config->CSMaxReg); else { diff --git a/modules/core/cs_set_founder.cpp b/modules/core/cs_set_founder.cpp index b6f7dab95..200d32e95 100644 --- a/modules/core/cs_set_founder.cpp +++ b/modules/core/cs_set_founder.cpp @@ -49,7 +49,7 @@ class CommandCSSetFounder : public Command } nc = na->nc; - if (Config->CSMaxReg && nc->channelcount >= Config->CSMaxReg && !u->Account()->HasPriv("chanserv/no-register-limit")) + if (Config->CSMaxReg && nc->channelcount >= Config->CSMaxReg && !u->HasPriv("chanserv/no-register-limit")) { source.Reply(_("\002%s\002 has too many channels registered."), na->nick.c_str()); return MOD_CONT; diff --git a/modules/core/cs_topic.cpp b/modules/core/cs_topic.cpp index 9798a12c0..8fd23f7f1 100644 --- a/modules/core/cs_topic.cpp +++ b/modules/core/cs_topic.cpp @@ -31,7 +31,7 @@ class CommandCSTopic : public Command if (!c) source.Reply(_(CHAN_X_NOT_IN_USE), ci->name.c_str()); - else if (!check_access(u, ci, CA_TOPIC) && !u->Account()->HasCommand("chanserv/topic")) + else if (!check_access(u, ci, CA_TOPIC) && !u->HasCommand("chanserv/topic")) source.Reply(_(ACCESS_DENIED)); else { diff --git a/modules/core/cs_xop.cpp b/modules/core/cs_xop.cpp index b556e210e..38c82d183 100644 --- a/modules/core/cs_xop.cpp +++ b/modules/core/cs_xop.cpp @@ -131,7 +131,7 @@ class XOPBase : public Command ChanAccess *access = ci->GetAccess(u); uint16 ulev = access ? access->level : 0; - if ((level >= ulev || ulev < ACCESS_AOP) && !u->Account()->HasPriv("chanserv/access/modify")) + if ((level >= ulev || ulev < ACCESS_AOP) && !u->HasPriv("chanserv/access/modify")) { source.Reply(_(ACCESS_DENIED)); return MOD_CONT; @@ -152,7 +152,7 @@ class XOPBase : public Command /** * Patch provided by PopCorn to prevert AOP's reducing SOP's levels **/ - if (access->level >= ulev && !u->Account()->HasPriv("chanserv/access/modify")) + if (access->level >= ulev && !u->HasPriv("chanserv/access/modify")) { source.Reply(_(ACCESS_DENIED)); return MOD_CONT; @@ -220,7 +220,7 @@ class XOPBase : public Command ChanAccess *access = ci->GetAccess(u); uint16 ulev = access ? access->level : 0; - if ((!access || access->nc != u->Account()) && (level >= ulev || ulev < ACCESS_AOP) && !u->Account()->HasPriv("chanserv/access/modify")) + if ((!access || access->nc != u->Account()) && (level >= ulev || ulev < ACCESS_AOP) && !u->HasPriv("chanserv/access/modify")) { source.Reply(_(ACCESS_DENIED)); return MOD_CONT; @@ -242,7 +242,7 @@ class XOPBase : public Command } else { - if (access->nc != u->Account() && ulev <= access->level && !u->Account()->HasPriv("chanserv/access/modify")) + if (access->nc != u->Account() && ulev <= access->level && !u->HasPriv("chanserv/access/modify")) source.Reply(_(ACCESS_DENIED)); else { @@ -270,7 +270,7 @@ class XOPBase : public Command ChanAccess *access = ci->GetAccess(u); uint16 ulev = access ? access->level : 0; - if (!ulev && !u->Account()->HasCommand("chanserv/access/list")) + if (!ulev && !u->HasCommand("chanserv/access/list")) { source.Reply(_(ACCESS_DENIED)); return MOD_CONT; @@ -336,7 +336,7 @@ class XOPBase : public Command return MOD_CONT; } - if (!check_access(u, ci, CA_FOUNDER) && !u->Account()->HasPriv("chanserv/access/modify")) + if (!check_access(u, ci, CA_FOUNDER) && !u->HasPriv("chanserv/access/modify")) { source.Reply(_(ACCESS_DENIED)); return MOD_CONT; diff --git a/modules/core/hs_help.cpp b/modules/core/hs_help.cpp index 35d2b99cb..c360376c7 100644 --- a/modules/core/hs_help.cpp +++ b/modules/core/hs_help.cpp @@ -32,7 +32,7 @@ class CommandHSHelp : public Command User *u = source.u; source.Reply(_("%s commands"), Config->s_HostServ.c_str()); for (CommandMap::const_iterator it = HostServ->Commands.begin(), it_end = HostServ->Commands.end(); it != it_end; ++it) - if (!Config->HidePrivilegedCommands || it->second->permission.empty() || (u->Account() && u->Account()->HasCommand(it->second->permission))) + if (!Config->HidePrivilegedCommands || it->second->permission.empty() || u->HasCommand(it->second->permission)) it->second->OnServHelp(source); } }; diff --git a/modules/core/ms_help.cpp b/modules/core/ms_help.cpp index c27f1791b..54210e4fe 100644 --- a/modules/core/ms_help.cpp +++ b/modules/core/ms_help.cpp @@ -37,7 +37,7 @@ class CommandMSHelp : public Command "registered in order to send a memo.\n" "%s's commands include:"), MemoServ->nick.c_str(), MemoServ->nick.c_str()); for (CommandMap::const_iterator it = MemoServ->Commands.begin(), it_end = MemoServ->Commands.end(); it != it_end; ++it) - if (!Config->HidePrivilegedCommands || it->second->permission.empty() || (u->Account() && u->Account()->HasCommand(it->second->permission))) + if (!Config->HidePrivilegedCommands || it->second->permission.empty() || u->HasCommand(it->second->permission)) it->second->OnServHelp(source); source.Reply(_("Type \002%R%s HELP \037command\037\002 for help on any of the\n" "above commands.\n" diff --git a/modules/core/ms_info.cpp b/modules/core/ms_info.cpp index af0dddd21..f87b8af60 100644 --- a/modules/core/ms_info.cpp +++ b/modules/core/ms_info.cpp @@ -31,7 +31,7 @@ class CommandMSInfo : public Command const Anope::string &nname = !params.empty() ? params[0] : ""; int hardmax = 0; - if (!nname.empty() && nname[0] != '#' && u->Account()->HasPriv("memoserv/info")) + if (!nname.empty() && |
