} $data['data'] .= "</tbody>\n </table>"; } else { $config_nt = array('content' => _($header) . " <span style='font-weight: bold;'>" . _('No results') . "</span>", 'options' => array('type' => 'nf_info', 'cancel_button' => FALSE), 'style' => 'width: 80%; margin: 20px auto; text-align: left;'); $nt = new Notification('nt_1', $config_nt); $data['data'] = $nt->show(FALSE); } } catch (Exception $e) { $data['status'] = 'error'; $data['data'] = _('Error! Modified registry files could not be extracted for this agent'); } break; case 'rootcheck': try { $data['status'] = 'success'; $res = Ossec_agent::launch_rootcheck($sensor_id, $id); $header = _('Policy and auditing database'); if (count($res) > 0) { $data['data'] = "<div style='font-weight: bold; font-size: 11px; padding: 10px 0px;'>" . _($header) . ":</div>\n <table class='table_files table_data' id='tf'>\n <thead>\n <tr>\n <th class='cf_type'>" . _('Type') . "</th>\n <th class='cf_date'>" . _('Last Date') . "</th>\n <th class='cf_date'>" . _('First Date') . "</th>\n <th>" . _('Event') . "</th>\n </tr>\n </thead>\n \n <tbody>"; $days = 0; $dates = array(); foreach ($res as $line) { $r_data = explode(',', $line); if (!empty($r_data)) { if (empty($dates[$r_data[1]])) { $dates[$data[1]] = $r_data[1]; $days = $days + 1; $color = $days % 2 == 0 ? 'class="odd"' : 'class="even"'; } $data['data'] .= "<tr {$color}>\n <td class='cf_type'>" . $r_data[0] . "</td>\n <td class='cf_date'>" . $r_data[1] . "</td>\n <td class='cf_date'>" . $r_data[2] . "</td>\n <td class='cf_path'>" . $r_data[3] . "</td>\n </tr>"; }