keyload/create.php

48 lines
930 B
PHP
Raw Normal View History

2023-09-29 19:08:35 +02:00
<?php
/* curload
* Simple file uploading using POST requests and temporary keys
* Licensed under the GNU Affero General Public License version 3.0
*/
2023-09-29 19:08:35 +02:00
include "config.php";
include "add-keys.php";
2023-09-29 19:08:35 +02:00
if (isset($_REQUEST['key'])) {
$Key = $_REQUEST['key'];
} else {
print "No admin key specified.";
die();
}
2023-09-29 19:08:35 +02:00
if (isset($_REQUEST['data'])) {
$Data = $_REQUEST['data'];
} else {
print "No data specified.";
die();
}
2023-09-29 19:08:35 +02:00
if (isset($_REQUEST['type'])) {
$Type = $_REQUEST['type'];
} else {
print "No type specified.";
die();
}
2023-09-29 19:08:35 +02:00
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();
}
2023-09-29 19:08:35 +02:00
?>