implemented admin control panel with the ability to delete articles/users in bulk, and open user panels with the standard options to reset passwords, change email/usernames, or delete. additionally, updated SQL schema, created dummy data, and fixed some bugs.

This commit is contained in:
Joshua Ashton
2025-03-30 17:01:29 -06:00
parent 86823cbd3e
commit e6735a9a20
18 changed files with 414 additions and 61 deletions
+24
View File
@@ -9,6 +9,30 @@ if (!empty($_FILES['upload'])) {
upload($_FILES['upload'], $_ENV['UPLOAD_TMP_FQ_PATH'], isset($_POST['filename']) ? $_POST['filename'] : null);
}
function delete_dir($dir)
{
if (!is_dir($dir)) return false;
if (substr($dir, strlen($dir) - 1, 1) != '/') {
$dir .= '/';
}
$files = glob($dir . '*', GLOB_MARK);
foreach ($files as $file) {
if (is_dir($file))
delete_dir($file);
else
delete_file($file);
}
rmdir($dir);
}
function delete_file($file)
{
if (!file_exists($file)) return false;
unlink($file);
}
function upload($input, $dest_dir, $filename = null)
{
$filetype = strtolower(pathinfo($input['name'], PATHINFO_EXTENSION));