2023-09-29 19:08:35 +02:00
|
|
|
<?php
|
2023-09-30 19:49:24 +02:00
|
|
|
/* 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
|
|
|
|
2023-09-30 19:49:24 +02:00
|
|
|
include "config.php";
|
|
|
|
include "add-keys.php";
|
2023-09-29 19:08:35 +02:00
|
|
|
|
2023-09-30 19:49:24 +02:00
|
|
|
if (isset($_REQUEST['key'])) {
|
|
|
|
$Key = $_REQUEST['key'];
|
|
|
|
} else {
|
|
|
|
print "No admin key specified.";
|
|
|
|
die();
|
|
|
|
}
|
2023-09-29 19:08:35 +02:00
|
|
|
|
2023-09-30 19:49:24 +02:00
|
|
|
if (isset($_REQUEST['data'])) {
|
|
|
|
$Data = $_REQUEST['data'];
|
|
|
|
} else {
|
|
|
|
print "No data specified.";
|
|
|
|
die();
|
|
|
|
}
|
2023-09-29 19:08:35 +02:00
|
|
|
|
2023-09-30 19:49:24 +02:00
|
|
|
if (isset($_REQUEST['type'])) {
|
|
|
|
$Type = $_REQUEST['type'];
|
|
|
|
} else {
|
|
|
|
print "No type specified.";
|
|
|
|
die();
|
|
|
|
}
|
2023-09-29 19:08:35 +02:00
|
|
|
|
2023-09-30 19:49:24 +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
|
|
|
?>
|