示例#1
0
文件: index.php 项目: jhbsz/ossimTest
}
$db = new ossim_db();
$conn = $db->connect();
// Close selected tickets
if (GET('close') == _("Close selected")) {
    foreach ($_GET as $k => $v) {
        if (preg_match("/^ticket\\d+/", $k) && $v != "") {
            $idprio = explode("_", $v);
            if (is_numeric($idprio[0]) && is_numeric($idprio[1])) {
                Incident_ticket::insert($conn, $idprio[0], "Closed", $idprio[1], Session::get_session_user(), " ", "", "", array(), null);
            }
        }
    }
}
$criteria = array('ref' => $ref, 'type' => $type, 'title' => $title, 'submitter' => $submitter, 'in_charge' => $in_charge, 'with_text' => $with_text, 'status' => $status, 'priority_str' => $priority, 'attach_name' => $attachment, 'related_to_user' => $related_to_user, 'tag' => $tag);
$incident_tag = new Incident_tag($conn);
?>

<!-- filter -->
<form name="filter" id="filter" method="GET" action="<?php 
echo $_SERVER["SCRIPT_NAME"];
?>
">
<input type="hidden" name="page" id="page" value=""/>
    <?php 
if ($advanced_search) {
    ?>
			<input type="hidden" name="advanced_search" value="1">
		<?php 
}
?>
示例#2
0
    $error_msg = "<div>" . _("The following errors occurred:") . "</div><div style='padding-left: 15px;'><div>{$errors}</div></div>";
    $config_nt = array('content' => $error_msg, 'options' => array('type' => 'nf_error', 'cancel_button' => FALSE), 'style' => 'width: 90%; margin: 20px auto; padding: 10px 0px; text-align: left; font-style: italic');
    $nt = new Notification('nt_1', $config_nt);
    return $nt->show(FALSE);
}
if (!Session::menu_perms("analysis-menu", "IncidentsTags") && !Session::am_i_admin()) {
    Session::unallowed_section(NULL);
}
// Avoid the browser resubmit POST data stuff
if (GET('redirect')) {
    header('Location: ' . $_SERVER['SCRIPT_NAME']);
    exit;
}
$db = new ossim_db();
$conn = $db->connect();
$tag = new Incident_tag($conn);
$parameters = NULL;
$info_error = NULL;
$error = FALSE;
$action = $parameters['action'] = GET('action') ? GET('action') : 'list';
$id = $parameters['id'] = GET('id');
if ($action == 'mod1step' && is_numeric($id)) {
    $f = $tag->get_list("WHERE td.id = {$id}");
    $name = $f[0]['name'];
    $descr = $f[0]['descr'];
} elseif ($action == 'new2step' || $action == 'mod2step') {
    $name = $parameters['name'] = POST('name');
    $descr = $parameters['descr'] = POST('descr');
    $validate = array("id" => array("validation" => "OSS_DIGIT,OSS_NULLABLE", "e_message" => 'illegal:' . _("ID")), "name" => array("validation" => "OSS_LETTER,OSS_PUNC,OSS_DIGIT", "e_message" => 'illegal:' . _("Name")), "descr" => array("validation" => "OSS_TEXT,OSS_NULLABLE", "e_message" => 'illegal:' . _("Description")), "action" => array("validation" => "OSS_TEXT", "e_message" => 'illegal:' . _("Action")));
    foreach ($parameters as $k => $v) {
        eval("ossim_valid(\$v, " . $validate[$k]['validation'] . ", '" . $validate[$k]['e_message'] . "');");
示例#3
0
*
*
* 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';
require_once 'incident_common.php';
Session::logcheck("analysis-menu", "IncidentsIncidents");
//DB connection
$db = new ossim_db();
$conn = $db->connect();
//Tags
$incident_tag = new Incident_tag($conn);
$tag_list = $incident_tag->get_list();
//Load users and entities (Autocomplete)
$autocomplete_keys = array('users', 'entities');
$users_and_entities = Autocomplete::get_autocomplete($conn, $autocomplete_keys);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title> <?php 
echo gettext("OSSIM Framework");
?>
 </title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
	<meta http-equiv="Pragma" content="no-cache"/>
    <link rel="stylesheet" type="text/css" href="../style/av_common.css?t=<?php 
示例#4
0
if (is_array($ids) && $size > 0) {
    for ($i = 0; $i < $size; $i++) {
        $incident_id = $ids[$i];
        if ($incident_id != "" && Incident::user_incident_perms($conn, $incident_id, 'show')) {
            if ($action == 'apply_tags') {
                $res = Incident::insert_incident_tag($conn, $incident_id, $tag);
            } else {
                $res = Incident::delete_incident_tags($conn, $incident_id);
            }
            if ($res === TRUE) {
                $ids_updated[$incident_id] = $incident_id;
            }
        }
    }
    if ($action == 'apply_tags') {
        $incident_tag = new Incident_tag($conn);
        if (count($ids) != count($ids_updated)) {
            echo "OK###DB Error###" . implode(",", $ids_updated) . "###";
        } else {
            echo "OK###Tag added###";
        }
        echo "<div style='color:grey; font-size: 10px; padding-bottom: 3px;'>" . $incident_tag->get_html_tag($tag) . "</div>";
    } else {
        if (count($ids) != count($ids_updated)) {
            echo "OK###DB Error###" . implode(",", $ids_updated);
        } else {
            echo "OK###Tags removed";
        }
    }
} else {
    echo "OK###No incidents";
示例#5
0
$incident = $incident_list[0];
//Incident data
$name = $incident->get_ticket();
$title = $incident->get_title();
$ref = $incident->get_ref();
$type = $incident->get_type();
$created = $incident->get_date();
$life = $incident->get_life_time();
$updated = $incident->get_last_modification($conn);
$priority = $incident->get_priority();
$incident_status = $incident->get_status();
$incident_in_charge = $incident->get_in_charge();
$users = Session::get_users_to_assign($conn);
$entities = Session::get_entities_to_assign($conn);
$incident_tags = $incident->get_tags();
$incident_tag = new Incident_tag($conn);
$taga = array();
foreach ($incident_tags as $tag_id) {
    $taga[] = $incident_tag->get_html_tag($tag_id);
}
$taghtm = count($taga) ? implode(' - ', $taga) : _("n/a");
?>
<!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"/>
	<meta http-equiv="Pragma" content="no-cache"/>