Your files\n";
$html .= "\t\t\t\t
These are the files you have uploaded using this key.
\n";
// If logged in ...
if (isset($_SESSION['type']) && (!$publicUploading || $publicUploading == "false")) {
$Database = createTables($sqlDB);
$DatabaseQuery = $Database->query('SELECT * FROM uploads');
$html .= "\t\t\t\t\n";
$html .= "\t\t\t\t\t\n";
$html .= "\t\t\t\t\t\tID | \n";
$html .= "\t\t\t\t\t\tFilename | \n";
$html .= "\t\t\t\t\t\tUpload date | \n";
$html .= "\t\t\t\t\t
\n";
while ($line = $DatabaseQuery->fetchArray()) {
$ID = $line['id'];
$Filename = $line['file'];
$uploadDate = $line['uploaddate'];
$keyID = $line['keyid'];
$keytypeID = $line['keytype'];
$CorrectFile = 0;
if ($line['keytype'] == 1) {
$keyType = "Key";
} else if ($line['keytype'] == 2) {
$keyType = "Administrator";
} else {
$keyType = "Unknown";
}
$UserDatabaseQuery = $Database->query('SELECT * FROM keys');
while ($uline = $UserDatabaseQuery->fetchArray()) {
if ($uline['id'] == $keyID && $_SESSION['key'] == $uline['key']) {
$CorrectFile = 1;
break;
}
}
// wrong file, move on
if ($CorrectFile != 1) {
continue;
}
$html .= "\t\t\t\t\t\n";
$html .= "\t\t\t\t\t\t$ID | \n";
$html .= "\t\t\t\t\t\t$Filename | \n";
$html .= "\t\t\t\t\t\t$uploadDate | \n";
if (($enableKeyUploadRemoval || $enableKeyUploadRemoval == "true") || $keytypeID == 2) {
$html .= "\t\t\t\t\t\tRemove | \n";
}
$html .= "\t\t\t\t\t
\n";
}
$html .= "\t\t\t\t
\n";
} else {
header("Location: index.php");
die();
}
// End the content div and print footer
$html = printFooter($html);
// Finally print it all out at once
print "$html";
?>