View file aiv2 AutoIndex/panel/filemanager.rename.dir.php

File size: 1.36Kb
<?php
include ('../config.php');
$page='fm';
include ('session.php');
include ($config->real() . $config->header);
if(isset($_POST,$_POST['name'],$_POST['dir']) and is_dir('../'.$config->filedir.$_POST['dir'])){
rename('../'.$config->filedir.$_POST['dir'],str_replace(basename($_POST['dir']),$_POST['name'],'../'.$config->filedir.$_POST['dir']));
header('Location: filemanager.php?task=rendir&status=1&dir='.str_replace(basename($_POST['dir']),null,$_POST['dir']));
die();
}
?>
<?php
if($layout=='web'){?>
<div class="wrap">
<div style="float: left; width: 18%; margin-bottom: 5px;" class="container">
<?php include('sidebar.php'); ?>
</div>
<div style="float: right; width:80%;">
<?php
}?>
<div class="container"><div class="title">Rename Directory</div>
<?php if($layout=='web'){
echo '<div style="padding:5px;">';
}?>

<form action="filemanager.rename.dir.php" method="POST">
<input name="dir" type="hidden" value="<?php echo htmlspecialchars($_GET['dir']); ?>" />
Old Name: <?php echo basename(htmlspecialchars($_GET['dir'])); ?><br />
New Name: <input name="name" type="text" value="<?php echo basename(htmlspecialchars($_GET['dir'])); ?>" />
<div style="text-align: center;"><input type="submit" value="Rename" /></div>
</form>
</div>
<?php if($layout=='web'){
echo '</div></div></div>';
}
?>
<?php
include ($config->real() . $config->footer); ?>