🐛 Require correct file in actions pages

Signed-off-by: Luke Tainton <luke@tainton.uk>
This commit is contained in:
2020-08-09 17:30:20 +01:00
parent 9e25c836bb
commit e5fa2c986e
6 changed files with 49 additions and 24 deletions

View File

@@ -1,6 +1,7 @@
<?php
$PAGE_NAME = "Upload file to request";
require_once __DIR__ . "/../../includes/header.php";
require_once __DIR__ . "/../../includes/prereqs.php";
use Ramsey\Uuid\Uuid;
$request = get_request($db, $_POST['rid']);
$authorised_users = get_subscribers($db, $request);
@@ -27,11 +28,13 @@
} catch (PDOException $e) {
$new_ticket_alert = array("danger", "Failed to upload file: " . $e->getMessage());
}
header('Location: /view?rid=' . $request['uuid'], true);
$newURL = "/view?rid=$request['uuid']";
echo("<script>window.location = '$newURL'</script>");
}
} else {
$new_ticket_alert = array("danger", "You are not authorised to update this request.");
header('Location: /view?rid=' . $request['uuid'], true);
$alert = array("danger", "You are not authorised to update this request.");
$newURL = "/view?rid=$request['uuid']";
echo("<script>window.location = '$newURL'</script>");
}
}