Beispiel #1
0
if (is_uploaded_file($_FILES['sample_log']['tmp_name'])) {
    $conf = $GLOBALS["conf"];
    $uploads_dir = $conf->get_conf("repository_upload_dir");
    $sample_log = $uploads_dir . "/" . $_FILES['sample_log']['name'];
    move_uploaded_file($_FILES['sample_log']['tmp_name'], $sample_log);
}
if ($action == "new" && $id == "") {
    Collectors::insert($conn, $name, $description, $type, $plugin_id, $source_type, $enable, $source, $location, $create, $process, $start, $stop, $startup_command, $stop_command, $sample_log);
}
if ($action == "modify" && $id != "") {
    Collectors::update($conn, $id, $name, $description, $type, $plugin_id, $source_type, $enable, $source, $location, $create, $process, $start, $stop, $startup_command, $stop_command, $sample_log);
}
if ($action == "delete" && $id != "") {
    Collectors::delete($conn, $id);
}
$collectors = Collectors::get_list($conn);
?>

<script>
$(document).ready(function(){
}); 
</script>
<center>
<table width="90%" class="noborder" style="background:transparent;" cellspacing="0" cellpadding="0">
    <tr><td style="text-align:right;" class="nobborder">
    <form><input type="button" class="button" onclick="document.location.href='modifycollectors.php?action=new'" value="<?php 
echo _("Insert new collector");
?>
"></form>
    </td>
    </tr>
Beispiel #2
0
        }
        if ($rule->get_userdata7() != "") {
            $out[] = "userdata7=" . $rule->get_userdata7() . "\n";
        }
        if ($rule->get_userdata8() != "") {
            $out[] = "userdata8=" . $rule->get_userdata8() . "\n";
        }
        if ($rule->get_userdata9() != "") {
            $out[] = "userdata9=" . $rule->get_userdata9() . "\n";
        }
        $out[] = "\n\n";
    }
}
// SQL
if ($section == "sql") {
    $collectors = Collectors::get_list($conn, "WHERE id={$idc}");
    $coll = $collectors[0];
    $rules = CollectorRule::get_list($conn, "WHERE idc={$idc} ORDER BY name");
    // PLUGIN_ID
    $out[] = "-- " . $coll->get_name() . "\n";
    $out[] = "-- plugin_id: " . $coll->get_plugin_id() . "\n";
    $out[] = "DELETE FROM plugin WHERE id = '" . $coll->get_plugin_id() . "';\n";
    $out[] = "DELETE FROM plugin_sid where plugin_id = '" . $coll->get_plugin_id() . "';\n";
    $out[] = "\n";
    $out[] = "INSERT INTO plugin (id, type, name, description, source_type) VALUES (" . $coll->get_plugin_id() . "," . $coll->get_type() . ",'" . strtolower($coll->get_name()) . "','" . str_replace("'", "\\'", str_replace("\n", " ", $coll->get_description())) . "','" . str_replace("'", "\\'", $coll->get_source_type()) . "');\n";
    $out[] = "\n";
    // PLUGIN_SID => RULES
    foreach ($rules as $rule) {
        $cat_id = $rule->get_category_id() != "" && $rule->get_category_id() != 0 ? $rule->get_category_id() : "NULL";
        $subcat_id = $rule->get_subcategory_id() != "" && $rule->get_subcategory_id() != 0 ? $rule->get_subcategory_id() : "NULL";
        $out[] = "INSERT INTO plugin_sid (plugin_id, sid, category_id, class_id, name, priority, reliability, subcategory_id) VALUES (" . $coll->get_plugin_id() . ", " . $rule->get_plugin_sid() . ", {$cat_id}, NULL, '" . $coll->get_name() . ": " . $rule->get_name() . "' ," . $rule->get_prio() . ", " . $rule->get_rel() . ", {$subcat_id});\n";
Beispiel #3
0
    $start = $coll[0]->get_start();
    $stop = $coll[0]->get_stop();
    $startup_command = $coll[0]->get_startup_command();
    $stop_command = $coll[0]->get_stop_command();
    $sample_log = $coll[0]->get_sample_log();
}
if ($action == "new") {
    $type = 1;
    $enable = 1;
    $location = "/var/log/syslog";
    $source = "log";
    $start = 0;
    $stop = 0;
    $plugin_id = Collectors::get_max_id($conn, $type);
}
$source_types = Collectors::get_source_types($conn);
?>
    
<form method="post" action="collectors.php" enctype="multipart/form-data">
  <input type="hidden" name="action" value="<?php 
echo $action;
?>
">
  <input type="hidden" name="id" value="<?php 
echo $id;
?>
">
  <table align="center">
  <tr>
    <th> <?php 
echo gettext("Data Source Name");
Beispiel #4
0
    ?>
</td>
    </tr>
<?php 
}
?>
</table>

<!-- NEW RULES -->
<br><br>
<?php 
if ($action == "new" || $action == "") {
    $expression = "(?P<sample_data>.*)";
    $prio = 1;
    $rel = 1;
    $plugin_sid = Collectors::get_next_sid($conn, $plugin_id);
}
?>
<form method="get" action="collector_rules.php" onsubmit="return encode()" id="fo">
<table width="90%" align="center" class="noborder" cellspacing="0" cellpadding="0">
<tr><td align="left" class="noborder" style="background:white" valign="top">

  <input type="hidden" name="action" value="<?php 
echo $action == "edit" ? "modify" : "new";
?>
">
  <input type="hidden" name="idc" value="<?php 
echo $idc;
?>
">
  <input type="hidden" name="id" value="<?php 
Beispiel #5
0
$title = "Клуб Нумизмат | Портфель пользователя ";
include $in."top.php"; 
table_top ("100%", 0, "Регистрация коллекционера", 1);

include_once "config.php";
include "funct.php";

for ($i=1; $i<=sizeof($interest); $i++)
{
	if (${"interest".$i}=="on")
	{
		$interest[$i][1] = 1;
	}
}

$myclass = new Collectors ($collectors, $user, $fio, $email, $url, $city, $city1, $phone, 
	$text, $adress, $interest);

if ($action=="add" and $submit)
{
	$error_number = $myclass->Collectors_add();
	if ($error_number<0)
	{
		$submit = 0;
	} else {
		echo "<b>Данные успешно добавлены</b>
		<br>Автоматический переход на страницу Вашего профайла осуществится через 3 секунды<br><br>";
		echo "<META HTTP-EQUIV=Refresh CONTENT=3;URL=\"".$in."user/profile.php\">";
	}
}

if ($action=="edit" and $submit)