This file is indexed.

/usr/share/icingaweb2/modules/monitoring/application/views/helpers/ContactFlags.php 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
<?php
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */

class Zend_View_Helper_ContactFlags extends Zend_View_Helper_Abstract
{

    /**
     * Get the human readable flag name for the given contact notification option
     *
     * @param string $tableName the name of the option table
     */
    public function getNotificationOptionName($tableName) {
        $exploded = explode('_', $tableName);
        $name = end($exploded);
        return ucfirst($name);
    }

    /**
     * Build all active notification options to a readable string
     *
     * @param object $contact   The contact retrieved from a backend
     * @param string $type      Whether to display the flags for 'host' or 'service'
     * @param string $glue      The symbol to use to concatenate the flag names
     *
     * @return string   A string that contains a human readable list of active options
     */
    public function contactFlags($contact, $type, $glue = ', ')
    {

        $optionName = 'contact_' . $type . '_notification_options';
        if (isset($contact->$optionName)) {
            return $contact->$optionName;
        }
        $out = array();
        foreach ($contact as $key => $value) {
            if (preg_match('/^contact_notify_' . $type . '_.*/', $key) && $value == True) {
                $option = $this->getNotificationOptionName($key);
                if (strtolower($option) != 'timeperiod') {
                    array_push($out, $option);
                }
            }
        }
        return implode($glue, $out);
    }
}