Merge pull request #7385 from Icinga/bugfix/api-downtime-params-revert

Revert schedule-downtime action time checks
This commit is contained in:
Michael Friedrich 2019-08-01 16:27:51 +02:00 committed by GitHub
commit 5d6649222d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -337,16 +337,6 @@ Dictionary::Ptr ApiActions::ScheduleDowntime(const ConfigObject::Ptr& object,
String comment = HttpUtility::GetLastParameter(params, "comment");
double startTime = HttpUtility::GetLastParameter(params, "start_time");
double endTime = HttpUtility::GetLastParameter(params, "end_time");
double now = Utility::GetTime() - 10; //Take a request delay into account.
if (author.IsEmpty() || comment.IsEmpty())
return ApiActions::CreateResult(400, "Options 'author' and 'comment' must not be empty");
if (startTime < now || endTime < now)
return ApiActions::CreateResult(400, "Options 'start_time' and 'end_time' must be greater than current timestamp");
if (endTime < startTime)
return ApiActions::CreateResult(400, "Option 'end_time' must be greater than 'start_time'");
Host::Ptr host;
Service::Ptr service;