diff options
Diffstat (limited to 'static/upload.php')
| -rw-r--r-- | static/upload.php | 15 |
1 files changed, 3 insertions, 12 deletions
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); |
