コード例 #1
0
ファイル: dt_schedule_scan.php プロジェクト: alienfault/ossim
session_write_close();
if (!array_key_exists($s_type, $scan_types)) {
    $e_message = _('You do not have the correct permissions to see this page. Please contact system administrator with any questions');
    Util::response_bad_request($e_message);
}
// Logcheck by s_type
if ($s_type == 'ocs') {
    Session::logcheck_ajax('configuration-menu', 'AlienVaultInventory');
} else {
    Session::logcheck_ajax('environment-menu', 'AlienVaultInventory');
}
$data = array();
try {
    $db = new ossim_db();
    $conn = $db->connect();
    $task_list = Inventory::get_list($conn, '', $scan_types[$s_type]);
    foreach ($task_list as $task) {
        $sensor_name = Av_sensor::get_name_by_id($conn, $task['task_sensor']);
        if ($sensor_name == '') {
            $sensor_name = _('Unknown');
        }
        if ($s_type == 'wmi') {
            preg_match('/wmipass:(.*)/', $task['task_params'], $matches);
            if ($matches[1] != '') {
                $task['task_params'] = preg_replace('/wmipass:(.*)/', '', $task['task_params']);
                $task['task_params'] = $task['task_params'] . 'wmipass:'******'/./', '*', $matches[1]);
            }
        } elseif ($s_type == 'nmap') {
            $task['task_params'] = str_replace(' ', ', ', preg_replace("/#.*/", "", $task['task_params']));
        }
        $s_data = array("DT_RowId" => $task['task_id'], "DT_RowData" => array('s_type' => $s_type, 'sensor_id' => $task['task_sensor'], 'params' => $task['task_params'], 'frecuency' => $task['task_period'], 'enabled' => $task['task_enable']), $task['task_name'], $sensor_name, $task['task_params'], $frequencies[$task['task_period']], $task['task_enable'], '');
コード例 #2
0
ファイル: interfaces.php プロジェクト: jackpf/ossim-arc

                <!-- Inventory Tasks -->
                <tr>
                    <td class="sec_title"><?php 
    echo _("Inventory Task");
    ?>
</td>
                </tr>

                <tr>
                    <td class="noborder" valign="top">
                        <table align="center" width="100%">
                            <?php 
    $task_count = 0;
    $task_list = Inventory::get_list($conn, $sensor_id);
    if (is_array($task_list) && !empty($task_list)) {
        foreach ($task_list as $task) {
            ?>
                                    <form method="GET" action="interfaces.php">
                                        <input type="hidden" name="sensor_id" value="<?php 
            echo $sensor_id;
            ?>
"/>
                                        <input type="hidden" name="task_id" value="<?php 
            echo $task['task_id'];
            ?>
"/>

                                        <tr>
                                            <th><?php 
コード例 #3
0
ossim_valid($rp, OSS_DIGIT, OSS_NULLABLE, 'illegal:' . _('Rp'));
ossim_valid($s_type, OSS_ALPHA, 'illegal:' . _('s_type'));
if (ossim_error()) {
    echo "<rows>\n<page>1</page>\n<total>0</total>\n</rows>\n";
    exit;
}
if (!empty($order)) {
    $order .= POST('sortorder') == 'asc' ? '' : ' desc';
} else {
    $order = 'name';
}
$db = new ossim_db();
$conn = $db->connect();
$start = ($page - 1) * $rp;
$limit = "LIMIT {$start}, {$rp}";
$task_list = Inventory::get_list($conn, '', $s_type_ids[$s_type]);
$total = count($task_list);
$xml .= "<rows>\n";
$xml .= "<page>{$page}</page>\n";
$xml .= "<total>{$total}</total>\n";
foreach ($task_list as $task) {
    //Parameters
    $sensor_name = Av_sensor::get_name_by_id($conn, $task['task_sensor']);
    if ($sensor_name == '') {
        $sensor_name = _('Unknown');
    }
    $link_modify = "<a style='font-weight:bold;' href=\"./task_edit.php?id=" . $task['task_id'] . "&s_type={$s_type}\">" . utf8_encode($task['task_name']) . "</a>";
    if ($s_type == 'wmi') {
        preg_match('/wmipass:(.*)/', $task['task_params'], $found);
        if ($found[1] != '') {
            $task['task_params'] = preg_replace('/wmipass:(.*)/', '', $task['task_params']);