Update export_log.php
This commit is contained in:
@@ -67,13 +67,12 @@ if($perms[2]!=="1"){
|
||||
die("Connection failed: " . $conn->connect_error);
|
||||
}
|
||||
$last_id=-1;
|
||||
$export_file = fopen("/var/www/html/export/cyberhex_log_export.vsc", 'w');
|
||||
$export_file = fopen("/var/www/html/export/cyberhex_log_export.csv", 'w');
|
||||
if($export_file===null){
|
||||
$close=false;
|
||||
echo '<br><div class="alert alert-danger" role="alert">
|
||||
Error creating export file.
|
||||
</div>';
|
||||
}
|
||||
}else{
|
||||
fwrite($export_file,"id;loglevel;logtext;machine_id;time\r\n");
|
||||
while($num_of_log_entrys!=0){
|
||||
$sql = "SELECT * FROM log where id > $last_id";
|
||||
@@ -118,9 +117,9 @@ if($perms[2]!=="1"){
|
||||
$num_of_log_entrys--;
|
||||
}
|
||||
$conn->close();
|
||||
if(!isset($close))
|
||||
fclose($export_file);
|
||||
}
|
||||
}
|
||||
|
||||
//get count of log entrys
|
||||
// Create a connection
|
||||
|
||||
Reference in New Issue
Block a user