Fix an option in the configuration

This commit is contained in:
Jacob 2023-10-01 16:23:07 +02:00
parent d9924e6a3e
commit 33e108a491
3 changed files with 6 additions and 6 deletions

View file

@ -12,7 +12,7 @@ $Action = "";
$Authorized = 0;
$Primary = 0;
$filterID = -1;
$Error = 0;
$Error = "";
if (!isset($_COOKIE[$cookieName]) || !isset($_COOKIE[$cookieTypeName])) {
header('Location: login.php?redir=admin');
@ -35,7 +35,7 @@ if (!isset($_REQUEST['id'])) {
}
if (!isset($_REQUEST['e'])) {
$Error = 0;
$Error = "";
} else {
$Error = $_REQUEST['e'];
}

View file

@ -20,7 +20,7 @@ function main() {
$Error = $_REQUEST['e'];
}
if (isset($_COOKIE[$cookieTypeName])) {
if (isset($_COOKIE[$cookieTypeName]) || ($publicUploading || $publicUploading == "true")) {
$html .= "\t\t\t<form action=\"upload.php\" method=\"post\" enctype=\"multipart/form-data\">\n";
$html .= "\t\t\t\t<input type=\"file\" name=\"file\" id=\"file\">\n";
$html .= "\t\t\t\t<input type=\"submit\" value=\"Upload selected file\" name=\"web\">\n";

View file

@ -15,7 +15,7 @@ if (isset($_REQUEST['key'])) {
} else if (isset($_COOKIE[$cookieName])) {
$Key = $_COOKIE[$cookieName];
$WebInterface = 1;
} else {
} else if (!$publicUploading || $publicUploading == "false") {
print "No key specified.";
die();
}
@ -37,10 +37,10 @@ if (!isset($_FILES['file']['name']) || $_FILES['file']['name'] == "") {
}
}
$Database = createTables($sqlDB);
// init database
if (!$publicUploading || $publicUploading == "false") {
$Database = createTables($sqlDB);
$DatabaseQuery = $Database->query('SELECT * FROM keys');
while ($line = $DatabaseQuery->fetchArray()) {
if ($line['key'] == $Key && $Key != "" && $line['key'] != "" && ($enableKeys || $enableKeys == "true")) {