123456789101112131415161718192021222324 |
- <?php
- class ConfirmUploadAction2 implements IAction {
- public function execute() {
- if(!Authorize::isLoggedIn()) {
- return array("error" => "Access not authorized");
- }
- $projectId = $_POST['project_id'] ?? $_GET['project_id'];
- $uploadId = $_POST['upload_id'] ?? $_GET['upload_id'];
- $userId = $_SESSION['user_id'];
- $database = SqliteDatabase::getSingleton();
- $sql = "DELETE FROM upload_logs WHERE project_id = :project_id AND user_id = :user_id AND rowid = :upload_id LIMIT 1;";
- $preparedQuery = $database->prepare($sql);
- $preparedQuery->bindValue(':project_id', $projectId);
- $preparedQuery->bindValue(':user_id', $userId);
- $preparedQuery->bindValue(':upload_id', $uploadId);
- $result = $preparedQuery->execute();
- $result->finalize();
-
- return array("message" => "upload confirmed");
- }
- }
|