diff options
author | Adam <Adam@anope.org> | 2013-07-20 09:19:52 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-07-20 09:19:52 -0400 |
commit | cb70d976ba3b500418264a0d1b891bae6e8216a2 (patch) | |
tree | a757320010d4889aabfbeb7a5e051341bf6b1fcc /modules/commands/cs_xop.cpp | |
parent | 6db01869479c878753fc6da49f2fb0bc44511359 (diff) |
Change cs_xop access check to use command order
Diffstat (limited to 'modules/commands/cs_xop.cpp')
-rw-r--r-- | modules/commands/cs_xop.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/commands/cs_xop.cpp b/modules/commands/cs_xop.cpp index db4faa657..10d28fc03 100644 --- a/modules/commands/cs_xop.cpp +++ b/modules/commands/cs_xop.cpp @@ -121,7 +121,10 @@ class CommandCSXOP : public Command const ChanAccess *highest = access.Highest(); bool override = false; - if ((!access.founder && !access.HasPriv("ACCESS_CHANGE")) || ((!highest || *highest <= tmp_access) && !access.founder)) + std::vector<Anope::string>::iterator cmd_it = std::find(order.begin(), order.end(), source.command.upper()), + access_it = highest ? std::find(order.begin(), order.end(), XOPChanAccess::DetermineLevel(highest)) : order.end(); + + if (!access.founder && (!access.HasPriv("ACCESS_CHANGE") || cmd_it <= access_it)) { if (source.HasPriv("chanserv/access/modify")) override = true; @@ -260,7 +263,10 @@ class CommandCSXOP : public Command } } - if ((!mask.equals_ci(nc->display) && !access.HasPriv("ACCESS_CHANGE") && !access.founder) || ((!highest || tmp_access >= *highest) && !access.founder)) + std::vector<Anope::string>::iterator cmd_it = std::find(order.begin(), order.end(), source.command.upper()), + access_it = highest ? std::find(order.begin(), order.end(), XOPChanAccess::DetermineLevel(highest)) : order.end(); + + if (!mask.equals_ci(nc->display) && !access.founder && (!access.HasPriv("ACCESS_CHANGE") || cmd_it <= access_it)) { if (source.HasPriv("chanserv/access/modify")) override = true; |