X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fusers.cpp;h=0d5d2a7d70c509f883cc15c0f5ee504f0cec7924;hb=b6935108cac7395565034db58d21b7a861133083;hp=cf676d2dcba676a3b2fbcf42fa982c0e0b41d97e;hpb=a7fc2fe0dc845ffba1f4575e694aa1bb7f60756b;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/users.cpp b/src/users.cpp index cf676d2dc..0d5d2a7d7 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -46,7 +46,7 @@ std::string User::GetModeLetters(bool includeparams) const std::string ret(1, '+'); std::string params; - for (unsigned char i = 'A'; i < 'z'; i++) + for (unsigned char i = 'A'; i <= 'z'; i++) { const ModeHandler* const mh = ServerInstance->Modes.FindMode(i, MODETYPE_USER); if ((!mh) || (!IsModeSet(mh))) @@ -167,7 +167,8 @@ bool LocalUser::HasModePermission(const ModeHandler* mh) const return false; const unsigned char mode = mh->GetModeChar(); - if (mode < 'A' || mode > ('A' + 64)) return false; + if (ModeParser::IsModeChar(mode)) + return false; return ((mh->GetModeType() == MODETYPE_USER ? oper->AllowedUserModes : oper->AllowedChanModes))[(mode - 'A')]; @@ -179,12 +180,12 @@ bool LocalUser::HasModePermission(const ModeHandler* mh) const * allowing remote kills, etc - but if they have access to the src, they most likely have * access to the conf - so it's an end to a means either way. */ -bool User::HasPermission(const std::string&) +bool User::HasCommandPermission(const std::string&) { return true; } -bool LocalUser::HasPermission(const std::string &command) +bool LocalUser::HasCommandPermission(const std::string& command) { // are they even an oper at all? if (!this->IsOper()) @@ -195,27 +196,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()