예제 #1
0
    function displayRow($row)
    {
        global $__FM_CONFIG;
        $disabled_class = $row->time_status == 'disabled' ? ' class="disabled"' : null;
        $edit_status = null;
        if (currentUserCan('manage_time', $_SESSION['module'])) {
            $edit_status = '<a class="edit_form_link" href="#">' . $__FM_CONFIG['icons']['edit'] . '</a>';
            $edit_status .= '<a class="status_form_link" href="#" rel="';
            $edit_status .= $row->time_status == 'active' ? 'disabled' : 'active';
            $edit_status .= '">';
            $edit_status .= $row->time_status == 'active' ? $__FM_CONFIG['icons']['disable'] : $__FM_CONFIG['icons']['enable'];
            $edit_status .= '</a>';
            if (!isItemInPolicy($row->time_id, 'time')) {
                $edit_status .= '<a href="#" class="delete">' . $__FM_CONFIG['icons']['delete'] . '</a>';
            }
            $edit_status = '<td id="edit_delete_img">' . $edit_status . '</td>';
        }
        /** Format date range */
        $date_range = $this->formatDates($row->time_start_date, $row->time_end_date);
        /** Format weekdays */
        $weekdays = $this->formatDays($row->time_weekdays);
        $comments = nl2br($row->time_comment);
        echo <<<HTML
\t\t\t<tr id="{$row->time_id}"{$disabled_class}>
\t\t\t\t<td>{$row->time_name}</td>
\t\t\t\t<td>{$date_range}</td>
\t\t\t\t<td>{$row->time_start_time} &rarr; {$row->time_end_time}</td>
\t\t\t\t<td>{$weekdays}</td>
\t\t\t\t<td>{$comments}</td>
\t\t\t\t{$edit_status}
\t\t\t</tr>

HTML;
    }
예제 #2
0
    function displayRow($row)
    {
        global $__FM_CONFIG;
        $disabled_class = $row->object_status == 'disabled' ? ' class="disabled"' : null;
        $edit_status = null;
        if (currentUserCan('manage_objects', $_SESSION['module'])) {
            $edit_status = '<a class="edit_form_link" name="' . $row->object_type . '" href="#">' . $__FM_CONFIG['icons']['edit'] . '</a>';
            if (!isItemInPolicy($row->object_id, 'object')) {
                $edit_status .= '<a href="#" class="delete">' . $__FM_CONFIG['icons']['delete'] . '</a>';
            }
            $edit_status = '<td id="edit_delete_img">' . $edit_status . '</td>';
        }
        $edit_name = $row->object_name;
        $netmask = $row->object_type != 'address' ? "<td>{$row->object_mask}</td>" : null;
        $comments = nl2br($row->object_comment);
        echo <<<HTML
\t\t\t<tr id="{$row->object_id}"{$disabled_class}>
\t\t\t\t<td>{$row->object_name}</td>
\t\t\t\t<td>{$row->object_address}</td>
\t\t\t\t{$netmask}
\t\t\t\t<td>{$comments}</td>
\t\t\t\t{$edit_status}
\t\t\t</tr>

HTML;
    }
예제 #3
0
    function displayRow($row)
    {
        global $__FM_CONFIG;
        $disabled_class = $row->service_status == 'disabled' ? ' class="disabled"' : null;
        $edit_status = null;
        if (currentUserCan('manage_services', $_SESSION['module'])) {
            $edit_status = '<a class="edit_form_link" name="' . $row->service_type . '" href="#">' . $__FM_CONFIG['icons']['edit'] . '</a>';
            if (!isItemInPolicy($row->service_id, 'service')) {
                $edit_status .= '<a href="#" class="delete">' . $__FM_CONFIG['icons']['delete'] . '</a>';
            }
            $edit_status = '<td id="edit_delete_img">' . $edit_status . '</td>';
        }
        $edit_name = $row->service_name;
        /** Process TCP Flags */
        if ($row->service_type == 'tcp') {
            $service_tcp_flags = $this->getTCPFlags($row->service_tcp_flags);
        } else {
            $service_tcp_flags = null;
        }
        echo <<<HTML
\t\t\t<tr id="{$row->service_id}"{$disabled_class}>
\t\t\t\t<td>{$row->service_name}</td>

HTML;
        if ($row->service_type == 'icmp') {
            $icmp_type = $row->service_icmp_type == -1 ? 'any' : $row->service_icmp_type;
            $icmp_code = $row->service_icmp_code == -1 ? 'any' : $row->service_icmp_code;
            echo <<<HTML
\t\t\t\t<td>{$icmp_type}</td>
\t\t\t\t<td>{$icmp_code}</td>

HTML;
        } else {
            $src_ports = $row->service_src_ports ? str_replace(':', ' &rarr; ', $row->service_src_ports) : 'any';
            $dest_ports = $row->service_dest_ports ? str_replace(':', ' &rarr; ', $row->service_dest_ports) : 'any';
            echo <<<HTML
\t\t\t\t<td>{$src_ports}</td>
\t\t\t\t<td>{$dest_ports}</td>
\t\t\t\t<td>{$service_tcp_flags}</td>

HTML;
        }
        $comments = nl2br($row->service_comment);
        echo <<<HTML
\t\t\t\t<td>{$comments}</td>
\t\t\t\t{$edit_status}
\t\t\t</tr>

HTML;
    }