* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
* MA  02110-1301  USA
*
*
* On Debian GNU/Linux systems, the complete text of the GNU General
* Public License can be found in `/usr/share/common-licenses/GPL-2'.
*
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
*
*/
require_once 'av_init.php';
// Check permissions
Session::useractive();
$cell_id = GET('id');
ossim_valid($cell_id, OSS_ALPHA, OSS_DIGIT . OSS_SCORE, 'illegal: Message Id');
if (ossim_error()) {
    die(ossim_error());
}
list($msg_id, $component_id) = explode("_", $cell_id);
$msg_id = intval($msg_id);
if (!valid_hex32($component_id, true)) {
    die(_("Invalid canonical uuid"));
}
// Call API
try {
    $status = new System_status();
    $status->set_viewed($msg_id, $component_id);
    list($detail) = $status->get_message_detail($msg_id);
} catch (Exception $e) {
    // Do nothing
}
Exemple #2
0
}
$cell_id = GET('id');
$ctime = GET('date');
ossim_valid($cell_id, OSS_ALPHA, OSS_DIGIT . OSS_SCORE, 'illegal: Message Id');
ossim_valid($ctime, OSS_DATETIME, 'illegal: Creation Time');
if (ossim_error()) {
    die(ossim_error());
}
list($msg_id, $component_id) = explode("_", $cell_id);
$msg_id = intval($msg_id);
if (!valid_hex32($component_id, true)) {
    die(_("Invalid canonical uuid"));
}
// Call API
try {
    $status = new System_status();
    $status->set_viewed($msg_id, $component_id);
    list($detail) = $status->get_message_detail($msg_id);
} catch (Exception $e) {
    die($e->getMessage());
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
	<title> <?php 
echo gettext("OSSIM Framework");
?>
 </title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
Exemple #3
0
            </table>
        </div>
    </div>		
    
    
    <!-- Suggestions -->
    <div class='suggestions_header sec_title'><?php 
echo _('Suggestions');
?>
</div>
    
    <div class='suggestions_content'>
    <?php 
$message = _("Currently no suggestions");
try {
    $status = new System_status();
    $filters = array('component_id' => Util::uuid_format($id), 'level' => 'info,warning,error', 'order_by' => $order, 'order_desc' => 'desc');
    list($message_list, $total) = $status->get_status_messages($filters);
} catch (Exception $e) {
    $total = 0;
    $message_list = array();
    $message = $e->getMessage();
}
if (!$total) {
    ?>
            <div class="no_suggestions"><?php 
    echo $message;
    ?>
</div>
            <?php 
} else {
/**
 * @param object $conn  DataBase access object
 *
 * @return array
 */
function calc_sensors_status($conn)
{
    // Get component list
    $avc_list = Av_center::get_avc_list($conn);
    $total = count($avc_list['data']);
    $up = $total;
    $down = 0;
    // Get notifications list
    $filters = array('level' => 'notification', 'message_id' => 11);
    $pagination = array('page' => 1, 'page_rows' => $total);
    $status = new System_status();
    list($notification_list, $total_notifications) = $status->get_status_messages($filters, $pagination);
    if ($total_notifications > 0) {
        $notification_components = array();
        foreach ($notification_list as $notification) {
            $notification_components[$notification['component_id']] = 1;
        }
        foreach ($avc_list['data'] as $avc_data) {
            if (preg_match('/sensor/i', $avc_data['profile'])) {
                if (isset($notification_components[Util::uuid_format($avc_data['system_id'])])) {
                    $down++;
                    $up--;
                }
            }
        }
    }
    return array($total, $up, $down);
}
Exemple #5
0
    case 1:
        $level = 'info,warning,error';
        break;
    case 2:
        $level = 'warning,error';
        break;
    case 3:
        $level = 'error';
        break;
}
$page = intval($from / $maxrows) + ($from % $maxrows == 0 ? 1 : 0);
// Call API
try {
    $filters = array('level' => $level, 'order_by' => $order, 'order_desc' => $torder);
    $pagination = array('page' => $page, 'page_rows' => $maxrows);
    $status = new System_status();
    list($message_list, $total) = $status->get_status_messages($filters, $pagination);
} catch (Exception $e) {
    $response['sEcho'] = $sec;
    $response['iTotalRecords'] = 0;
    $response['iTotalDisplayRecords'] = 0;
    $response['error'] = $e->getMessage();
    $response['aaData'] = array();
    echo json_encode($response);
    exit;
}
$data = array();
foreach ($message_list as $message) {
    $res = array();
    $res['DT_RowId'] = $message['message_id'] . '_' . $message['component_id'];
    $res['viewed'] = $message['viewed'];