summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_sajoin.cpp2
-rw-r--r--src/modules/m_samode.cpp5
-rw-r--r--src/users.cpp16
3 files changed, 8 insertions, 15 deletions
diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp
index f506a2e1c..d01339133 100644
--- a/src/modules/m_sajoin.cpp
+++ b/src/modules/m_sajoin.cpp
@@ -45,7 +45,7 @@ class CommandSajoin : public Command
User* dest = ServerInstance->FindNick(nickname);
if ((dest) && (dest->registered == REG_ALL))
{
- if (user != dest && !user->HasPrivPermission("users/sajoin-others", false))
+ if (user != dest && !user->HasPrivPermission("users/sajoin-others"))
{
user->WriteNotice("*** You are not allowed to /SAJOIN other users (the privilege users/sajoin-others is needed to /SAJOIN others).");
return CMD_FAILURE;
diff --git a/src/modules/m_samode.cpp b/src/modules/m_samode.cpp
index 322ee91b8..61d676d6a 100644
--- a/src/modules/m_samode.cpp
+++ b/src/modules/m_samode.cpp
@@ -49,8 +49,11 @@ class CommandSamode : public Command
}
// Changing the modes of another user requires a special permission
- if ((target != user) && (!user->HasPrivPermission("users/samode-usermodes", true)))
+ if ((target != user) && (!user->HasPrivPermission("users/samode-usermodes")))
+ {
+ user->WriteNotice("*** You are not allowed to /SAMODE other users (the privilege users/samode-usermodes is needed to /SAMODE others).");
return CMD_FAILURE;
+ }
}
// XXX: Make ModeParser clear LastParse
diff --git a/src/users.cpp b/src/users.cpp
index 3a6ddbc0f..827d818c3 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -195,27 +195,17 @@ bool LocalUser::HasPermission(const std::string &command)
return oper->AllowedOperCommands.Contains(command);
}
-bool User::HasPrivPermission(const std::string &privstr, bool noisy)
+bool User::HasPrivPermission(const std::string& privstr)
{
return true;
}
-bool LocalUser::HasPrivPermission(const std::string &privstr, bool noisy)
+bool LocalUser::HasPrivPermission(const std::string& privstr)
{
if (!this->IsOper())
- {
- if (noisy)
- this->WriteNotice("You are not an oper");
return false;
- }
-
- if (oper->AllowedPrivs.Contains(privstr))
- return true;
-
- if (noisy)
- this->WriteNotice("Oper type " + oper->name + " does not have access to priv " + privstr);
- return false;
+ return oper->AllowedPrivs.Contains(privstr);
}
void UserIOHandler::OnDataReady()