Initial Commit
This commit is contained in:
appsapps.phpconfig.phpconnect_wifi.phpdelete.phpexplorer.phpfile.phpfile_associations.jsonfile_info.phpimager.phpindex.phpinstall_app.phpinternet.htmloobe.phppkg.phpplayer.phprename.phpsave_state.phpscreensaver.htmlserver_command.phpsettings.phpsysstats.phptailwind.estasks.phpthp.phpuninstaller.phpvfs.phpvideo.phpwallpapers.phpwifi_list.php
26
uninstaller.php
Normal file
26
uninstaller.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
$id = $_GET['id'] ?? '';
|
||||
if (!preg_match('/^[a-zA-Z0-9_\-]+$/', $id)) {
|
||||
http_response_code(400);
|
||||
exit("Invalid app ID");
|
||||
}
|
||||
|
||||
$dir = __DIR__ . '/apps/' . $id;
|
||||
if (!is_dir($dir)) {
|
||||
http_response_code(404);
|
||||
exit("App not found");
|
||||
}
|
||||
|
||||
// Recursively delete
|
||||
function deleteDir($path) {
|
||||
foreach (scandir($path) as $item) {
|
||||
if ($item === '.' || $item === '..') continue;
|
||||
$full = $path . '/' . $item;
|
||||
is_dir($full) ? deleteDir($full) : unlink($full);
|
||||
}
|
||||
return rmdir($path);
|
||||
}
|
||||
|
||||
deleteDir($dir);
|
||||
echo "App $id uninstalled.";
|
||||
echo "<script>window.parent.reloadApps();</script>";
|
Reference in New Issue
Block a user