Your IP : 216.73.217.64


Current Path : /home3/gp97/docs.sapat20172020.97gp.net/php/
Upload File :
Current File : //home3/gp97/docs.sapat20172020.97gp.net/php/movefile.php

<?php
/* *************************************************
 *
 * Document Manager (C) 2002-2010
 * Version 4 - dmanager MySQL
 * Benjamin Sonntag <benjamin@sonntag.fr>
 * Chantal Bernard-Putz <chantal@bernard-putz.net>
 * Franck Denis
 * This software is protected by copyright laws,
 * please read the file COPYRIGHT
 * This software is provided as is with no warranty.
 *
 ************************************************* */

/* $Id: movefile.php 29 2009-11-26 07:02:26Z chantal $ */

require_once("common.php");

$fields = array (
	"dir"      => array ("request", "integer", 0),
	"file"     => array ("request", "integer", 0),
	"newdir"   => array ("post", "integer", 0),
	"action"   => array ("post", "string", ""),
);

getFields($fields);

$title = _l("Move a file");

if ($action == "domove" && $newdir && $file)
{
	if ($doc->hasRight($_SESSION["Sid_user"], "m", $dir) && $doc->hasRight($_SESSION["Sid_user"], "u", $newdir))
	{
		if (!$doc->moveFile($dir, $file, $newdir))
			$error = $doc->errstr();
		else
			$error = _l("File successfully moved !");
	}
	else
		$error = _l("You cannot move files !");

	include ("browser.php");
	exit();
}

$infoFile = $doc->getFileInfo($file);

require_once ("head.php");

?>
<p style="display: inline"><br /></p>
<p style="display: inline"><br /></p>
<?php if (!empty($error)) { echo "<p class=\"error\">" . $error . "</p>"; } ?>
<form method="post" action="movefile.php">
<div>
<input type="hidden" name="dir" value="<?php echo $dir; ?>" />
<input type="hidden" name="file" value="<?php echo $file; ?>" />
<input type="hidden" name="action" value="domove" />
<table cellpadding="4" cellspacing="0" class="center noborder">
	<tr>
		<th colspan="2"><?php __l("Choose the new folder of the file") ?> <?php echo $infoFile["file_name"]; ?></th>
	</tr>
	<tr>
		<th><?php __l("Old Folder") ?></th>
		<td><code><?php echo $doc->folderPath($infoFile["id_folder"]) . SEP; ?></code></td>
	</tr>
	<tr>
		<th><?php __l("New Folder") ?></th>
	<td>
		<select name="newdir" class="inl">
<?php $doc->dirList($dir, 0, 1); ?>
		</select>
		</td>
	</tr>
	<tr>
		<td colspan="2" class="center"><input class="inb" type="submit" value="<?php __l("Move") ?>" /></td>
	</tr>
</table>
</div>
</form>
<p style="display: inline"><br /></p>
<table style="width: 70%" cellpadding="1" cellspacing="0" class="center">
	<tr>
		<td style="width: 30px">&nbsp;</td>
		<td><img class="vmiddle noborder" src="<?php echo $pngPath; ?>folder.png" alt="Back to the Document Manager" />&nbsp;<a href="browser.php?dir=<?php echo $dir; ?>"><?php __l("Cancel and go back to the Document Manager") ?></a></td>
	</tr>
</table>
<?php require_once ("foot.php"); ?>