Merge branch 'bugfix/users-with-no-permissions-can-check-multiple-services-10397'

fixes #10397
This commit is contained in:
Eric Lippmann 2016-02-24 12:42:46 +01:00
commit e407f6d116
4 changed files with 26 additions and 18 deletions

View File

@ -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)) {

View File

@ -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)) {

View File

@ -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>

View File

@ -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>