edit - <?php /* * Invision Power File Manager * File...

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

View Full Document Right Arrow Icon
<?php < /* * Invision Power File Manager * File Editor 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 variables $op = param("op", "GET"); if(empty($op)) { $op = param("op", "POST"); } $dir = param("dir", "GET"); if(empty($dir)) { $dir = param("dir", "POST"); } $dir = cleanpath($dir); $file = cleanpath(param("f", "GET")); $ 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); } if ($op == "edit") { $full = $dir != "" ? $params["root"] . $dir . $slash . $file : $params["root"] . $file; // Get the full path $ext = ext($file); // Get the file extension $ if ($params["edit"] != 1) { // The user isn't allowed to edit files redirect($scripts["main"] . "?msg=no_per_edit&dir=$dir"); } else if ($file == "") { // The user didn't select a file to edit
Background image of page 1

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

View Full DocumentRight Arrow Icon
redirect($scripts["main"] . "?msg=no_file_edit&dir=$dir"); } else if (file_exists($full) == FALSE) { // The file doesn't exist redirect($scripts["main"] . "?msg=not_exist&dir=$dir"); } { // The file is a hidden file redirect($scripts["main"] . "?msg=dot_hide&dir=$dir"); } { // The file can not be edited redirect($scripts["main"] . "?msg=no_edit&dir=$dir"); } { // The file can not be edited redirect($scripts["main"] . "?msg=no_edit&dir=$dir");
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

edit - &lt;?php /* * Invision Power File Manager * File...

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

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