summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-02-26 20:46:21 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-02-26 20:46:21 +0000
commit68216fd12cd2ee9580e9e94ac2123dae835e2332 (patch)
tree67f9982d9acbc2b8866e936100ad0eda6877ccf4
parentb8412d56a27ef5f09b1febe0cb682aee2eb57bff (diff)
Fix for bug #466 reported by John
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9042 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/mode.cpp2
-rw-r--r--src/users.cpp20
2 files changed, 18 insertions, 4 deletions
diff --git a/src/mode.cpp b/src/mode.cpp
index b3f05bd37..efb1a4cf0 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -521,13 +521,11 @@ void ModeParser::Process(const char* const* parameters, int pcnt, User *user, bo
if (!SkipAccessChecks && IS_LOCAL(user) && (MOD_RESULT != ACR_ALLOW))
{
- ServerInstance->Logs->Log("MODE", DEBUG,"Enter minimum prefix check");
/* Check access to this mode character */
if ((type == MODETYPE_CHANNEL) && (modehandlers[handler_id]->GetNeededPrefix()))
{
char needed = modehandlers[handler_id]->GetNeededPrefix();
ModeHandler* prefixmode = FindPrefix(needed);
- ServerInstance->Logs->Log("MODE", DEBUG,"Needed prefix: %c", needed);
/* If the mode defined by the handler is not '\0', but the handler for it
* cannot be found, they probably dont have the right module loaded to implement
diff --git a/src/users.cpp b/src/users.cpp
index 9da905918..aeb985237 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -703,11 +703,27 @@ void User::UnOper()
{
if (IS_OPER(this))
{
- // unset their oper type (what IS_OPER checks), and remove +o
+ /* Remove all oper only modes from the user when the deoper - Bug #466*/
+ std::string moderemove("-");
+
+ for (unsigned char letter = 'A'; letter <= 'z'; letter++)
+ {
+ if (letter != 'o')
+ {
+ ModeHandler* mh = ServerInstance->Modes->FindMode(letter, MODETYPE_USER);
+ if (mh && mh->NeedsOper())
+ moderemove += letter;
+ }
+ }
+
+ const char* parameters[] = { this->nick, moderemove.c_str() };
+ ServerInstance->Parser->CallHandler("MODE", parameters, 2, this);
+
+ /* unset their oper type (what IS_OPER checks), and remove +o */
*this->oper = 0;
this->modes[UM_OPERATOR] = 0;
- // remove the user from the oper list. Will remove multiple entries as a safeguard against bug #404
+ /* remove the user from the oper list. Will remove multiple entries as a safeguard against bug #404 */
ServerInstance->Users->all_opers.remove(this);
if (AllowedOperCommands)