Merge branch 'bugfix/users-with-no-permissions-can-check-multiple-services-10397'
fixes #10397
This commit is contained in:
commit
e407f6d116
|
@ -83,11 +83,13 @@ class HostsController extends Controller
|
|||
public function showAction()
|
||||
{
|
||||
$this->setAutorefreshInterval(15);
|
||||
$checkNowForm = new CheckNowCommandForm();
|
||||
$checkNowForm
|
||||
->setObjects($this->hostList)
|
||||
->handleRequest();
|
||||
$this->view->checkNowForm = $checkNowForm;
|
||||
if ($this->Auth()->hasPermission('monitoring/command/schedule-check')) {
|
||||
$checkNowForm = new CheckNowCommandForm();
|
||||
$checkNowForm
|
||||
->setObjects($this->hostList)
|
||||
->handleRequest();
|
||||
$this->view->checkNowForm = $checkNowForm;
|
||||
}
|
||||
|
||||
$acknowledgedObjects = $this->hostList->getAcknowledgedObjects();
|
||||
if (! empty($acknowledgedObjects)) {
|
||||
|
|
|
@ -90,11 +90,13 @@ class ServicesController extends Controller
|
|||
public function showAction()
|
||||
{
|
||||
$this->setAutorefreshInterval(15);
|
||||
$checkNowForm = new CheckNowCommandForm();
|
||||
$checkNowForm
|
||||
->setObjects($this->serviceList)
|
||||
->handleRequest();
|
||||
$this->view->checkNowForm = $checkNowForm;
|
||||
if ($this->Auth()->hasPermission('monitoring/command/schedule-check')) {
|
||||
$checkNowForm = new CheckNowCommandForm();
|
||||
$checkNowForm
|
||||
->setObjects($this->serviceList)
|
||||
->handleRequest();
|
||||
$this->view->checkNowForm = $checkNowForm;
|
||||
}
|
||||
|
||||
$acknowledgedObjects = $this->serviceList->getAcknowledgedObjects();
|
||||
if (! empty($acknowledgedObjects)) {
|
||||
|
|
|
@ -174,10 +174,12 @@
|
|||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th> <?= $this->translate('Schedule Check') ?> </th>
|
||||
<td> <?= $checkNowForm ?> </td>
|
||||
</tr>
|
||||
<?php if (isset($checkNowForm)): // Form is unset if the current user lacks the respective permission ?>
|
||||
<tr>
|
||||
<th> <?= $this->translate('Schedule Check') ?> </th>
|
||||
<td> <?= $checkNowForm ?> </td>
|
||||
</tr>
|
||||
<?php endif ?>
|
||||
|
||||
<tr>
|
||||
<th></th>
|
||||
|
|
|
@ -176,10 +176,12 @@
|
|||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th> <?= $this->translate('Schedule Check') ?> </th>
|
||||
<td> <?= $checkNowForm ?> </td>
|
||||
</tr>
|
||||
<?php if (isset($checkNowForm)): // Form is unset if the current user lacks the respective permission ?>
|
||||
<tr>
|
||||
<th> <?= $this->translate('Schedule Check') ?> </th>
|
||||
<td> <?= $checkNowForm ?> </td>
|
||||
</tr>
|
||||
<?php endif ?>
|
||||
|
||||
<tr>
|
||||
<th></th>
|
||||
|
|
Loading…
Reference in New Issue