From 8425a1bd357dfcdfd97e63f9c3ef612867a4b890 Mon Sep 17 00:00:00 2001 From: Eliot Whalan Date: Thu, 24 Sep 2015 18:15:14 +1000 Subject: Remove code that requires moe panel --- static/upload.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'static') diff --git a/static/upload.php b/static/upload.php index c501acd..4549373 100644 --- a/static/upload.php +++ b/static/upload.php @@ -135,18 +135,9 @@ function upload_file($file) // Need to change permissions for the new file to make it world readable if (chmod(POMF_FILES_ROOT.$newname, 0644)) { // Add it to the database - if (empty($_SESSION['id'])) { - // Query if user is NOT logged in - $q = $db->prepare('INSERT INTO files (hash, originalname, filename, size, date, '. - 'expire, delid) VALUES (:hash, :orig, :name, :size, :date, '. - ':exp, :del)'); - } else { - // Query if user is logged in (insert user id together with other data) - $q = $db->prepare('INSERT INTO files (hash, originalname, filename, size, date, '. - 'expire, delid, user) VALUES (:hash, :orig, :name, :size, '. - ':date, :expires, :delid, :user)'); - $q->bindValue(':user', $_SESSION['id'], PDO::PARAM_INT); - } + $q = $db->prepare('INSERT INTO files (hash, originalname, filename, size, date, '. + 'expire, delid) VALUES (:hash, :orig, :name, :size, :date, '. + ':exp, :del)'); // Common parameters binding $q->bindValue(':hash', $file->get_sha1(), PDO::PARAM_STR); -- cgit v1.2.3 From 8fb40f409adc557fbab1cf24b2e32879fa3a8aaf Mon Sep 17 00:00:00 2001 From: Juuso Lapinlampi Date: Sun, 27 Sep 2015 12:50:49 +0000 Subject: Remove session_start(); from upload.php Moe panel uses PHP sessions to keep the user logged in. We don't need it anymore, it's not required for core functionality. --- static/upload.php | 2 -- 1 file changed, 2 deletions(-) (limited to 'static') diff --git a/static/upload.php b/static/upload.php index 4549373..3d90a4f 100644 --- a/static/upload.php +++ b/static/upload.php @@ -32,8 +32,6 @@ if (ini_get('zlib.output_compression') !== 'Off' ob_start('ob_gzhandler'); } -session_start(); - include_once 'classes/Response.class.php'; include_once 'classes/UploadException.class.php'; include_once 'classes/UploadedFile.class.php'; -- cgit v1.2.3