Bem-vindo ao ExemploSite 🎉
Edite este arquivo em sites/ExemploSite/index.php
"); }
if(isset($_POST['newsite'])){ $name = sanitize($_POST['sitename']); $newDir = $sitesDir.'/'.$name; if(!is_dir($newDir)){ mkdir($newDir); file_put_contents($newDir.'/index.php',"$name - personalize seu site!
"); header("Location: setup.php"); exit; } }
if(isset($_GET['deletesite'])){ $del = sanitize($_GET['deletesite']); $delDir = $sitesDir.'/'.$del; if(is_dir($delDir)){ deleteDir($delDir); header("Location: setup.php"); exit; } }
if(isset($_POST['newfile'])){ $site = sanitize($_POST['site']); $fname = sanitize($_POST['filename']); $content = $_POST['content']; $path = $sitesDir.'/'.$site.'/'.$fname; if($site && $fname && is_dir($sitesDir.'/'.$site)){ file_put_contents($path,$content); header("Location: setup.php?site=$site"); exit; } }
if(isset($_GET['deletefile'])){ $site = sanitize($_GET['site']); $file = sanitize($_GET['deletefile']); $path = $sitesDir.'/'.$site.'/'.$file; if(file_exists($path)) unlink($path); header("Location: setup.php?site=$site"); exit; }
if(isset($_POST['renamefile'])){ $site = sanitize($_POST['site']); $old = sanitize($_POST['oldname']); $new = sanitize($_POST['newname']); if(file_exists($sitesDir.'/'.$site.'/'.$old)){ rename($sitesDir.'/'.$site.'/'.$old,$sitesDir.'/'.$site.'/'.$new); header("Location: setup.php?site=$site"); exit; } }
if(isset($_POST['editfile'])){ $site = sanitize($_POST['site']); $file = sanitize($_POST['editfile']); $content = $_POST['content']; file_put_contents($sitesDir.'/'.$site.'/'.$file,$content); header("Location: setup.php?site=$site"); exit; }
$currentSite = isset($_GET['site']) ? sanitize($_GET['site']) : '';
$sites = array_diff(scandir($sitesDir),['.','..']);
?>
- Painel Futurista