This file is indexed.

/usr/share/icingaweb2/modules/monitoring/application/views/scripts/show/components/downtime.phtml is in icingaweb2-module-monitoring 2.1.0-1ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
<?php
$addLink = false;
if ($this->hasPermission('monitoring/command/downtime/schedule')) {
    /** @var \Icinga\Module\Monitoring\Object\MonitoredObject $object */
    if ($object->getType() === $object::TYPE_HOST) {
        $addLink = $this->qlink(
            $this->translate('Schedule downtime'),
            'monitoring/host/schedule-downtime',
            array('host' => $object->getName()),
            array(
                'class'             => 'action-link',
                'data-base-target'  => '_self',
                'icon'              => 'plug',
                'title'             => $this->translate(
                    'Schedule a downtime to suppress all problem notifications within a specific period of time'
                )
            )
        );
    } else {
        $addLink = $this->qlink(
            $this->translate('Schedule downtime'),
            'monitoring/service/schedule-downtime',
            array('host' => $object->getHost()->getName(), 'service' => $object->getName()),
            array(
                'class'             => 'action-link',
                'data-base-target'  => '_self',
                'icon'              => 'plug',
                'title'             => $this->translate(
                    'Schedule a downtime to suppress all problem notifications within a specific period of time'
                )
            )
        );
    }
}
if (empty($object->comments) && ! $addLink) {
    return;
}
?>
<tr>
    <th><?php
    echo $this->translate('Downtimes');
    if (! empty($object->downtimes) && $addLink) {
        echo '<br>' . $addLink;
    }
    ?></th>
    <td data-base-target="_self">
    <?php if (empty($object->downtimes)):
        echo $addLink;
    else: ?>
        <dl class="comment-list">
        <?php foreach ($object->downtimes as $downtime):
            if ((bool) $downtime->is_in_effect) {
                $state = sprintf(
                    $this->translate('expires %s', 'Last format parameter represents the downtime expire time'),
                    $this->timeUntil($downtime->end)
                );
            } else {
                if ($downtime->start <= time()) {
                    $state = sprintf(
                        $this->translate('ends %s', 'Last format parameter represents the end time'),
                        $this->timeUntil($downtime->is_flexible ? $downtime->scheduled_end : $downtime->end)
                    );
                } elseif ((bool) $downtime->is_fixed) {
                    $state = sprintf(
                        $this->translate('scheduled %s', 'Last format parameter represents the time scheduled'),
                        $this->timeUntil($downtime->start)
                    );
                } else {
                    $state = sprintf(
                        $this->translate('scheduled flexible %s', 'Last format parameter represents the time scheduled'),
                        $this->timeUntil($downtime->start)
                    );
                }
            }
        ?>
            <dt class="comment-header">
                <?= $this->escape($downtime->author_name) ?>
                <span class="comment-meta">
                    <?= $this->translate('created') ?>
                    <?= $this->timeAgo($downtime->entry_time) ?>
                    <span aria-hidden="true">&#448;</span>
                    <?= $state ?>
                <?php if (isset($delDowntimeForm)): // Form is unset if the current user lacks the respective permission ?>
                    <span class="meta-icons">
                    <?php
                        $deleteButton = clone($delDowntimeForm);
                        /** @var \Icinga\Module\Monitoring\Forms\Command\Object\DeleteDowntimeCommandForm $deleteButton */
                        $deleteButton->setAttrib('class', $deleteButton->getAttrib('class') . ' remove-action');
                        $deleteButton->populate(
                            array(
                                'downtime_id'           => $downtime->id,
                                'downtime_is_service'   => $object->getType() === $object::TYPE_SERVICE
                            )
                        );
                        echo $deleteButton;
                    ?>
                    </span>
                <?php endif ?>
                </span>
            </dt>
            <dd class="comment-text">
                <p><?= nl2br($this->createTicketLinks($this->escape($downtime->comment)), false) ?></p>
            </dd>
        <?php endforeach ?>
        </dl>
    <?php endif ?>
    </td>
</tr>