Esempio n. 1
0
 }
 if ($query1 != '' && $query2 != '' && $columns != '') {
     $db = new ossim_db(true);
     $conn = $db->connect();
     $curid = 0;
     $name = str_replace('"', '', $name);
     $query = "SELECT id FROM custom_report_types WHERE name=\"{$name}\" and file='SIEM/CustomList.php'";
     $rs = $conn->Execute($query);
     if (!$rs) {
         Av_exception::write_log(Av_exception::DB_ERROR, $conn->ErrorMsg());
     } else {
         if (!$rs->EOF) {
             $curid = $rs->fields['id'];
         }
     }
     $id = Av_report::get_new_report_module_id($conn);
     if ($curid > 0) {
         $sql = "UPDATE custom_report_types SET name=?,type='Custom Security Events',file='SIEM/CustomList.php',inputs='Number of Events:top:text:OSS_DIGIT:25:1000',custom_report_types.sql=? WHERE id=?";
         $params = array($name, "{$query1};{$query2};{$columns}", $curid);
     } else {
         $sql = "INSERT INTO custom_report_types (id,name,type,file,inputs,custom_report_types.sql) VALUES (?,?,'Custom Security Events','SIEM/CustomList.php','Number of Events:top:text:OSS_DIGIT:25:1000',?)";
         $params = array($id, $name, "{$query1};{$query2};{$columns}");
     }
     if ($conn->Execute($sql, $params)) {
         $msg = $curid > 0 ? _("Report Module") . " <b>'Custom Security Events - {$name}'</b> " . _("successfully updated") : _("Report Module successfully created as") . " <b>'Custom Security Events - {$name}'</b>";
         $msg_type = 'nf_success';
     } else {
         Av_exception::write_log(Av_exception::DB_ERROR, $conn->ErrorMsg());
         $msg = _("Error creating a new report type.");
         $msg_type = 'nf_error';
     }
Esempio n. 2
0
if (!Session::is_pro()) {
    die(_('Report section is only available in professional version'));
}
$me = Session::get_session_user();
$db = new ossim_db();
$dbconn = $db->connect();
$creports = array();
$result = $dbconn->Execute("SELECT login, name, value FROM user_config where category LIKE 'custom_report%' ORDER BY name ASC");
//Wizard Perms
$wizard_perms = Av_report::get_report_permissions($dbconn);
while (!$result->EOF) {
    $available = false;
    $unserializedata = unserialize($result->fields["value"]);
    $user_perm = $unserializedata["user"];
    $entity_perm = $unserializedata["entity"];
    $available = Av_report::check_report_availability($result->fields["login"], $user_perm, $entity_perm, $wizard_perms);
    if ($available == true) {
        $creports[] = $result->fields;
    }
    $result->MoveNext();
}
?>
    		
<table border="0" class="noborder" width="90%" align="center" cellspacing="0" cellpadding="0">			
	<?php 
if (count($creports) > 0) {
    ?>
		<tr>
			<td class="nobborder"><br>			
				<div style='width:90%;margin:0 auto;text-align:center;'>
				<table width="100%" align="center" class='dataTable table_data'>