diff --git a/lib/icinga/apiactions.cpp b/lib/icinga/apiactions.cpp index 76cb51788..66c8912a6 100644 --- a/lib/icinga/apiactions.cpp +++ b/lib/icinga/apiactions.cpp @@ -659,11 +659,11 @@ Dictionary::Ptr ApiActions::ExecuteCommand(const ConfigObject::Ptr& object, return ApiActions::CreateResult(404, "Can't find a valid notification for '" + resolved_notification + "'."); /* Get author */ - if (!ActionsHandler::authenticatedApiUser) + if (!ActionsHandler::AuthenticatedApiUser) BOOST_THROW_EXCEPTION(std::invalid_argument("Can't find API user.")); cmd->Execute(notification, user, cr, NotificationType::NotificationCustom, - ActionsHandler::authenticatedApiUser->GetName(), "", execMacros, false); + ActionsHandler::AuthenticatedApiUser->GetName(), "", execMacros, false); } } diff --git a/lib/remote/actionshandler.cpp b/lib/remote/actionshandler.cpp index 175e38a3a..f8a823632 100644 --- a/lib/remote/actionshandler.cpp +++ b/lib/remote/actionshandler.cpp @@ -11,7 +11,7 @@ using namespace icinga; -thread_local ApiUser::Ptr ActionsHandler::authenticatedApiUser; +thread_local ApiUser::Ptr ActionsHandler::AuthenticatedApiUser; REGISTER_URLHANDLER("/v1/actions", ActionsHandler); @@ -74,9 +74,9 @@ bool ActionsHandler::HandleRequest( bool verbose = false; - ActionsHandler::authenticatedApiUser = user; - Defer a ([&]() { - ActionsHandler::authenticatedApiUser = nullptr; + ActionsHandler::AuthenticatedApiUser = user; + Defer a ([]() { + ActionsHandler::AuthenticatedApiUser = nullptr; }); if (params) diff --git a/lib/remote/actionshandler.hpp b/lib/remote/actionshandler.hpp index e99b40cd9..ca662caba 100644 --- a/lib/remote/actionshandler.hpp +++ b/lib/remote/actionshandler.hpp @@ -13,7 +13,7 @@ class ActionsHandler final : public HttpHandler public: DECLARE_PTR_TYPEDEFS(ActionsHandler); - static thread_local ApiUser::Ptr authenticatedApiUser; + static thread_local ApiUser::Ptr AuthenticatedApiUser; bool HandleRequest( AsioTlsStream& stream,