| 731 | } |
| 732 | |
| 733 | Value ClusterEvents::ForceNextNotificationChangedAPIHandler(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& params) |
| 734 | { |
| 735 | Endpoint::Ptr endpoint = origin->FromClient->GetEndpoint(); |
| 736 | |
| 737 | if (!endpoint) { |
| 738 | Log(LogNotice, "ClusterEvents") |
| 739 | << "Discarding 'force next notification changed' message from '" << origin->FromClient->GetIdentity() << "': Invalid endpoint origin (client not allowed)."; |
| 740 | return Empty; |
| 741 | } |
| 742 | |
| 743 | Host::Ptr host = Host::GetByName(params->Get("host")); |
| 744 | |
| 745 | if (!host) |
| 746 | return Empty; |
| 747 | |
| 748 | Checkable::Ptr checkable; |
| 749 | |
| 750 | if (params->Contains("service")) |
| 751 | checkable = host->GetServiceByShortName(params->Get("service")); |
| 752 | else |
| 753 | checkable = host; |
| 754 | |
| 755 | if (!checkable) |
| 756 | return Empty; |
| 757 | |
| 758 | if (origin->FromZone && !origin->FromZone->CanAccessObject(checkable)) { |
| 759 | Log(LogNotice, "ClusterEvents") |
| 760 | << "Discarding 'force next notification' message for checkable '" << checkable->GetName() |
| 761 | << "' from '" << origin->FromClient->GetIdentity() << "': Unauthorized access."; |
| 762 | return Empty; |
| 763 | } |
| 764 | |
| 765 | checkable->SetForceNextNotification(params->Get("forced"), false, origin); |
| 766 | |
| 767 | return Empty; |
| 768 | } |
| 769 | |
| 770 | void ClusterEvents::AcknowledgementSetHandler(const Checkable::Ptr& checkable, |
| 771 | const String& author, const String& comment, AcknowledgementType type, |
nothing calls this directly
no test coverage detected