index - <?php < /* * Invision Power...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: <?php < /* * Invision Power File Manager * File/Directory List Script * Copyright (c) 2003 Invision Power Services * ------------------------------------- * You may not remove the copyright or * redistribute the script in any form * * Authors: Stephen Ball <stephen@invisionfilemanager.com> * * Last Modified: 15th July 2003 * */ error_reporting(0); e if (!(include("./modules/header.lib.php"))) { die("<p align=\"center\">There was an error loading the header module</p>"); } // Get the dynamic data blocks from the template $blocks = get_blocks(array("msg", "up", "columns", "folders", "files", "total_size"), $script_dir . "/settings/templates/index.tpl"); " // Get the $op variable $op = param("op", "GET"); if (empty($op)) { $op = param("op", "POST"); } // Get the $dir variable $dir = param("dir", "GET"); if (empty($dir)) { $dir = param("dir", "POST"); } if (eregi("win", PHP_OS) == TRUE) { // Check for / in the URL even though the system is Windows (i.e. the user is using Opera) $dir = str_replace("/", "\\", $dir); } $dir = cleanpath($dir); $ // If $op has a value the user is performing a task if (isset($op)) { switch ($op) { case "upload": // Set some values $new = cleanpath(param("remote", "POST")); $old = param("local", "FILES"); // Get the full path $full = $dir != "" ? $params["root"] . $dir . $slash . $new : $params["root"] . $new; $ if (ereg("[\\\/:*?\"<>|]", $new) == TRUE) { $msg = $javascript["invalid"] . " \\\/:*?\"<>|"; } else if ($params["upload"] != 1) { // The user doesn't have permission to upload a file $msg = $operate["no_per_upload"]; } else if ($old["error"] > 0) { if ($old["error"] == 1 || $old["error"] == 2) { // The file is too large $msg = $upload["too_large"]; } else if ($old["error"] == 3) { // The file wasn't completed $msg = $upload["part_upload"]; } else if ($old["error"] == 4 || $old["error"] == 5) { // No file was selected $msg = $javascript["no_upload"]; } else { // File can not be copied, show message $msg = $operate["err_upload"]; } } else if (file_exists($params["root"] . $dir . $slash . $hide) == TRUE) { // The admin has disabled access to this directory $msg = $operate["no_per_view"]; } else if ($new == "") { // The user didn't enter a new file name $msg = $javascript["no_name"]; } else if (file_exists($full) && $params["overwrite"] != 1) { // The file exists but the user doesn't have overwrite permissions $msg = $operate["no_per_over"]; } else if ($old["size"] + dirsize($params["root"]) > $params["space"]) { // The user doesn't have enough space to upload $msg = $operate["no_space"]; } else if (move_uploaded_file($old["tmp_name"], $full) == FALSE) { // File can not be copied, show message $msg = $operate["err_upload"]; } else { chmod ($full, octdec((int) $new_chmod)); // File has been uploaded $msg = $operate["uploaded"]; } break; case "multi_upload": // Get the files $files = param("userfile", "FILES"); $total = 0; if ($params["upload"] != 1) { // The user doesn't have permission to upload a file $msg = $operate["no_per_upload"];...
View Full Document

Page1 / 21

index - <?php < /* * Invision Power...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online