File "create.php"

Full Path: /home/analogde/www/filetypes/pxlf/create.php
File size: 2.84 KB
MIME-type: text/x-php
Charset: utf-8

<?php
/***************************************************************
*  Copyright notice
*
*  (c) 2003-2004 Tobias Bender (tobias@phpXplorer.org)
*  All rights reserved
*
*  This script is part of the phpXplorer project. The phpXplorer project is
*  free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  The GNU General Public License can be found at
*  http://www.gnu.org/copyleft/gpl.html.
*  A copy is found in the textfile GPL.txt distributed with these scripts.
*
*  This script is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/

require(dirname(dirname(__FILE__)) . "/defaultActionHead.php");

$newName = $HTTP_POST_VARS['newName'];

if(!(strpos($newName, "..") === FALSE))
	die($PXP_languages[$PXP_language]['accessDenied'] . " (804)");
	

$pInfo = checkFilePermissions($newName, false);
if(!$pInfo["allowOpen"] or !$pInfo["allowEdit"])
	die($PXP_languages[$PXP_language]["accessDenied"] . " (809)");


$submit = $HTTP_POST_VARS['submit'];

if($submit != ""){

	if(strpos($newName, ".pxlf") === false)
		$newName .= ".pxlf";

  if($newName != "")
	  $result = @mkdir($currentDir . "/" . $newName, 0755);
}
?>
<html>
<head>
<title>
<?php echo $PXP_languages[$PXP_language]['createFolder'] ?>
</title>
<style type="text/css">
<!--

-->
</style>
<link rel="stylesheet" type="text/css" href="<?php echo $PXP_url ?>/styles/<?php echo $PXP_style ?>/main.css"/>
<script language="JavaScript" type="text/javascript">
<!--
function init(){
  document.frm1.newName.focus()
}

<?php
if($submit != ""){
  if($result == FALSE){
	  echo 'alert("<?php echo $PXP_languages[$PXP_language]["canNotCreateFolder"] ?>");';
	}else{
    echo "opener.refreshDir()\r\n";
    echo "window.close()\r\n";
	}
}
?>//javascript
//-->
</script>
</head>
<body onLoad="init()">
<form name="frm1" action="./create.php" method="post">
<input type="hidden" name="currentDir" value="<?php echo $currentDir ?>">
<input type="hidden" name="shareId" value="<?php echo $shareId ?>">

<?php echo $PXP_languages[$PXP_language]['createFolder'] ?>
<br><br>
<table>
<tr>
  <td><?php echo $PXP_languages[$PXP_language]['name'] ?>&nbsp;</td><td><input type="text" name="newName" size="30"></td>
</tr>
</table>
<br>
<input type="submit" name="submit" value="<?php echo $PXP_languages[$PXP_language]['create'] ?>">
<input type="button" onClick="window.close()" value="<?php echo $PXP_languages[$PXP_language]['cancel'] ?>">

</form>
</body>
</html>