Some small changes, backend is basically complete now

This commit is contained in:
Jacob 2023-09-30 19:49:24 +02:00
parent a086b9b9b7
commit 52abfb49bc
3 changed files with 41 additions and 41 deletions

View file

@ -1,42 +1,47 @@
<?php
include "config.php";
include "add-keys.php";
/* curload
* Simple file uploading using POST requests and temporary keys
* Licensed under the GNU Affero General Public License version 3.0
*/
if (isset($_REQUEST['key'])) {
$Key = $_REQUEST['key'];
} else {
print "No admin key specified.";
die();
}
include "config.php";
include "add-keys.php";
if (isset($_REQUEST['data'])) {
$Data = $_REQUEST['data'];
} else {
print "No data specified.";
die();
}
if (isset($_REQUEST['key'])) {
$Key = $_REQUEST['key'];
} else {
print "No admin key specified.";
die();
}
if (isset($_REQUEST['type'])) {
$Type = $_REQUEST['type'];
} else {
print "No type specified.";
die();
}
if (isset($_REQUEST['data'])) {
$Data = $_REQUEST['data'];
} else {
print "No data specified.";
die();
}
if (isset($_REQUEST['uploads']) && $Type == "Temporary") {
$Uploads = $_REQUEST['uploads'];
} else {
$Uploads = 1;
}
if (isset($_REQUEST['type'])) {
$Type = $_REQUEST['type'];
} else {
print "No type specified.";
die();
}
if ($Type == "Admin") {
addAdminKey($Key, $Data, 0);
} else if ($Type == "Temporary") {
addTempKey($Key, $Data, $Uploads);
} else if ($Type == "Key") {
addKey($Key, $Data);
} else {
print "Invalid type specified.";
die();
}
if (isset($_REQUEST['uploads']) && $Type == "Temporary") {
$Uploads = $_REQUEST['uploads'];
} else {
$Uploads = 1;
}
if ($Type == "Admin") {
addAdminKey($Key, $Data, 0);
} else if ($Type == "Temporary") {
addTempKey($Key, $Data, $Uploads);
} else if ($Type == "Key") {
addKey($Key, $Data);
} else {
print "Invalid type specified.";
die();
}
?>

View file

@ -1,6 +0,0 @@
<?php
include "config.php";
include "create-table.php";
// TODO: functions that return data from databases
?>

View file

@ -3,6 +3,7 @@
* Simple file uploading using POST requests and temporary keys
* Licensed under the GNU Affero General Public License version 3.0
*/
include "config.php";
include "create-table.php";