From a5b8788014dbc466f392a256901a93588958f35e Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 5 Apr 2013 16:27:12 -0500 Subject: Made the securefounder checks in cs_set more consistent --- modules/commands/cs_set.cpp | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) (limited to 'modules/commands/cs_set.cpp') diff --git a/modules/commands/cs_set.cpp b/modules/commands/cs_set.cpp index 7c17a3769..f20866e2a 100644 --- a/modules/commands/cs_set.cpp +++ b/modules/commands/cs_set.cpp @@ -345,13 +345,7 @@ class CommandCSSetFounder : public Command if (MOD_RESULT == EVENT_STOP) return; - if (MOD_RESULT != EVENT_ALLOW && source.permission.empty() && !source.AccessFor(ci).HasPriv("SET")) - { - source.Reply(ACCESS_DENIED); - return; - } - - if (source.permission.empty() && (ci->HasExt("SECUREFOUNDER") ? !source.IsFounder(ci) : !source.AccessFor(ci).HasPriv("FOUNDER"))) + if (MOD_RESULT != EVENT_ALLOW && source.permission.empty() && (ci->HasExt("SECUREFOUNDER") ? !source.IsFounder(ci) : !source.AccessFor(ci).HasPriv("FOUNDER"))) { source.Reply(ACCESS_DENIED); return; @@ -835,7 +829,7 @@ class CommandCSSetSecureFounder : public Command if (MOD_RESULT == EVENT_STOP) return; - if (MOD_RESULT != EVENT_ALLOW && source.permission.empty() && !source.AccessFor(ci).HasPriv("SET")) + if (MOD_RESULT != EVENT_ALLOW && source.permission.empty() && (ci->HasExt("SECUREFOUNDER") ? !source.IsFounder(ci) : !source.AccessFor(ci).HasPriv("FOUNDER"))) { source.Reply(ACCESS_DENIED); return; @@ -1017,19 +1011,10 @@ class CommandCSSetSuccessor : public Command if (MOD_RESULT == EVENT_STOP) return; - if (MOD_RESULT != EVENT_ALLOW && source.permission.empty()) + if (MOD_RESULT != EVENT_ALLOW && source.permission.empty() && (ci->HasExt("SECUREFOUNDER") ? !source.IsFounder(ci) : !source.AccessFor(ci).HasPriv("FOUNDER"))) { - if (!source.AccessFor(ci).HasPriv("SET")) - { - source.Reply(ACCESS_DENIED); - return; - } - - if (ci->HasExt("SECUREFOUNDER") ? !source.IsFounder(ci) : !source.AccessFor(ci).HasPriv("FOUNDER")) - { - source.Reply(ACCESS_DENIED); - return; - } + source.Reply(ACCESS_DENIED); + return; } NickCore *nc; -- cgit