Файл: hostbiter.ru/Modules/explode/view/clear.php
Строк: 88
<?
require ($_SERVER['DOCUMENT_ROOT'].'/Core/core.php');
require ($_SERVER['DOCUMENT_ROOT'].'/Core/fmhead.php');
if(!empty($_GET['dir']) AND $_GET['dir'] != encode('www')){
$dir = htmlspecialchars(trim($_GET['dir']));
}else{
$dir = encode('www');
}
$filename = pathinfo(decode($dir));
if(isset($_GET['yes'])){
$uploadfile = $_SERVER['DOCUMENT_ROOT'].'/tmp_files_isp/'.$filename;
file_put_contents($uploadfile,"");
$connect_ftp = ftp_connect($config['FTPHost'],21,300);
$ftp = $db->prepare("SELECT * FROM `ftp_users` WHERE `user` = ? LIMIT 1");
$ftp->execute([$user['id']]);
$ftp = $ftp->fetch();
ftp_login($connect_ftp,$ftp['login'],$ftp['password']);
ftp_chdir($connect_ftp,'/'.dirname(decode($dir)));
ftp_put($connect_ftp,$filename['basename'],$uploadfile,FTP_ASCII);
ftp_close($connect_ftp);
unlink($uploadfile);
$_SESSION['message'] = 'Файл '.$name.' очищен!';
header("Location: /explode?dir=".encode(dirname(decode($dir)))."");
exit;
}
if(isset($_GET['no'])){
header("Location: /explode?dir=".encode(dirname(decode($dir))));
exit;
}
?>
<div id="border">Очистка </div><style type="text/css"> a.button { display: block; float: left; font: bold 12px arial, sans-serif; color: #555; text-decoration: none; background: url(/image/img/button_r.gif) top right no-repeat; padding-right: 25px; outline: none; position: relative; } a.button span { display: block; line-height: 13px; background: url(/image/img/button_l.gif) no-repeat; padding: 7px 0 13px 23px; } a.button:hover { background-position: 100% -33px; } a.button:hover span { background-position: 0% -33px; color: #222; } a.button:active, a.button:focus { background-position: 100% -66px; } a.button:active span, a.button:focus span { background-position: 0% -66px; color: #222; padding: 8px 0 12px 23px; } </style>
<center> <div class="mess"> <img src="/image/EB03.png" alt="" /> Вы действительно хотите очистить файл <?=$filename['basename']?>?
<p style="float:right">
<a class="button" href="/explode/view/clear.php?dir=<?=$dir?>&yes"><span>Да</span></a>
<a class="button" href="/explode/view/clear.php?dir=<?=$dir?>&no"><span>Нет</span></a>
</p><br /> </div> </center>
<img src="/image/back.gif" alt="" /> <a href="/explode.php?case=show&path=ZaCipZtnqKuoZ5eZqplimq_boKtlmqybo6thqqtmraGm&">Назад</a><br />
<?
require ($_SERVER['DOCUMENT_ROOT'].'/Core/fmfoot.php');
?>