Add logging to files feature
This commit is contained in:
parent
d94ea073ed
commit
c6a4dfb0a8
|
@ -3,6 +3,8 @@
|
||||||
include "config.inc.php";
|
include "config.inc.php";
|
||||||
include "newsportal.php";
|
include "newsportal.php";
|
||||||
|
|
||||||
|
$logfile=$logdir.'/files.log';
|
||||||
|
|
||||||
if(isset($_COOKIE['tzo'])) {
|
if(isset($_COOKIE['tzo'])) {
|
||||||
$offset=$_COOKIE['tzo'];
|
$offset=$_COOKIE['tzo'];
|
||||||
} else {
|
} else {
|
||||||
|
@ -15,6 +17,8 @@ include "newsportal.php";
|
||||||
fclose($getfh);
|
fclose($getfh);
|
||||||
header('Content-type: '.$_REQUEST[contenttype]);
|
header('Content-type: '.$_REQUEST[contenttype]);
|
||||||
header('Content-disposition: filename="'.$_REQUEST[showfilename].'"');
|
header('Content-disposition: filename="'.$_REQUEST[showfilename].'"');
|
||||||
|
file_put_contents($logfile, "\n".format_log_date()." Requesting: ".$_REQUEST['showfile'], FILE_APPEND);
|
||||||
|
|
||||||
echo $getfile;
|
echo $getfile;
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
include "config.inc.php";
|
include "config.inc.php";
|
||||||
include "newsportal.php";
|
include "newsportal.php";
|
||||||
|
|
||||||
|
$logfile=$logdir.'/files.log';
|
||||||
|
|
||||||
if(isset($_POST['username'])) {
|
if(isset($_POST['username'])) {
|
||||||
$name = $_POST['username'];
|
$name = $_POST['username'];
|
||||||
// Save name in cookie
|
// Save name in cookie
|
||||||
|
@ -34,6 +36,7 @@ if(isset($_FILES)) {
|
||||||
}
|
}
|
||||||
$success = move_uploaded_file($_FILES[photo][tmp_name], $upload_to);
|
$success = move_uploaded_file($_FILES[photo][tmp_name], $upload_to);
|
||||||
if ($success) {
|
if ($success) {
|
||||||
|
file_put_contents($logfile, "\n".format_log_date()." Saved: ".strtolower($_POST['username'])."/".$_FILES[photo][name], FILE_APPEND);
|
||||||
echo 'Saved '.$_FILES[photo][name].' to your files folder';
|
echo 'Saved '.$_FILES[photo][name].' to your files folder';
|
||||||
} else {
|
} else {
|
||||||
echo 'There was an error saving '.$_FILES[photo][name];
|
echo 'There was an error saving '.$_FILES[photo][name];
|
||||||
|
|
Loading…
Reference in New Issue