Файл: ftp/file.php
Строк: 152
<?php
error_reporting(0);
$k=trim($_GET['k']); include("key.php");
include_once("freedata.php"); freedata($k,0);
$d=rawurldecode(trim($_GET['d'])); $n=rawurldecode(trim($_GET['n']));
if ($d==NULL) {$d="";} elseif ($d=="/") {$d="";} if ($n==NULL) {$n="";}
$rd=rawurlencode($d); $rn=rawurlencode($n);
require_once '../api_core/apicms_system.php';
require_once '../api_core/head.php';
$d=str_replace(".|htaccess",".htaccess",$d);
$n=str_replace(".|htaccess",".htaccess",$n);
require_once 'moduls/per.php';
if (($ftp=@ftp_connect($sr))&&(@ftp_login($ftp,$lg,$ps))) {
@ftp_pasv($ftp,true);
$sz=@ftp_size($ftp,"$d/$n");
$tm=@ftp_mdtm($ftp,"$d/$n");
@ftp_close($ftp);
$fsz=$sz;
if ($sz<1024) {$sz="$sz байт";}
elseif (($sz>=1024)&&($sz<1048576)) {$sz=strtr(round($sz/1024,2),".",",")." кб";}
elseif ($sz>=1048576) {$sz=strtr(round($sz/1024/1024,2),".",",")." мб";}
if ($tm<>NULL) {$tmv=date("d.m.y, H:i:s",$tm);} else {$tmv="-";}
$d=str_replace("$","$$",$d); $n=str_replace("$","$$",$n);
$rf=strtolower(preg_replace("~.*.([^.]*)~m","\1",$n));
echo'<div class="headmenu" style="padding: 8px; color:#fff;" >
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<td><img src="icons/cldir.png" width="16" height="16" alt=">"/>
<astyle="color:#fff;" href="ftp.php?k='.$k.'&d='.$rd.'">'.$d.'/</a>'.$n.'
</td>
<td align = "right">
<a class="headbut" href = "/ftp/">На главную</a>
<a class="headbut" href = "javascript:history.back(1)">Назад</a></td>
</div></div></table></div>';
echo '
<div class="subhead">Размер: '.$sz.'</div>
<div class="subhead">Изменён: '.$tmv.'</div>';
if ((($rf=="zip")||($rf=="jar")||($rf=="ZIP")||($rf=="tgz")||($rf=="gz")||($rf=="gz2")||($rf=="bz")||($rf=="bz2")||($rf=="tbz")||($rf=="tbz2")||($rf=="tgz2"))&&($fsz<=716800455645)&&($fsz>0))
{echo '<div class="subhead"><a href="openarh.php?k='.$k.'&d='.$rd.'&n='.$rn.'&tp='.$rf.'">Открыть..</a></div>';
if (($rf=="zip")||($rf=="jar")) {echo '<a href="zip.php?k='.$k.'&d='.$rd.'&n='.$rn.'&ac=ext"><div class="subhead">Разархивировать</a></div>';}
elseif (($rf=="tar")||($rf=="tgz")||($rf=="gz")||($rf=="gz2")||($rf=="bz")||($rf=="bz2")
||($rf=="tbz")||($rf=="tbz2")||($rf=="tgz2")) {echo '<a href="tgz.php?k='.$k.'&d='.$rd.'&n='.$rn.'&ac=ext"><div class="subhead">Разархивировать</a></div>';}}
if (($rf<>"jpg")&&($rf<>"jpeg")&&($rf<>"jpe")&&($rf<>"png")&&($rf<>"gif")&&($rf<>"bmp")&&($rf<>"dll")&&($rf<>"wav")&&($rf<>"mid")&&($rf<>"midi")&&($rf<>"mp3")&&($rf<>"mmf")&&($rf<>"psd")&&($rf<>"doc")&&($rf<>"pdf")&&($rf<>"zip")&&($rf<>"rar")&&($rf<>"jar")&&($rf<>"3gp")&&($rf<>"avi")&&($rf<>"mp4")&&($rf<>"class")&&($rf<>"tgz")&&($rf<>"gz")&&($rf<>"bz")&&($rf<>"gz2")&&($rf<>"bz2")&&($rf<>"tbz")&&($rf<>"tbz2")&&($rf<>"tgz2")&&($rf<>"tar")&&($fsz<=122880)) {
echo '<table width="100%" border="0" cellpadding="0" cellspacing="0"><td>
<div class="subhead">
<form action="/ftp/edit.php" method="get">
<input name="ln" type="hidden" value="10" maxlength="2" size="2" format="*N"/>
<input name="msz" type="hidden" value="0" maxlength="4" size="4" format="*N"/>
<input type="hidden" name="k" value="'.$k.'"/>
<input type="hidden" name="d" value="'.$rd.'"/>
<input type="hidden" name="n" value="'.$rn.'"/>
<input type="hidden" name="ed" value="1"/>
<input type="submit" value="Редактировать п/р">';
echo '</form></div>';
echo '</td><td>
<div class="subhead">
<form action="/ftp/edit2.php" method="get">
<input name="ln" type="hidden" value="10" maxlength="2" size="2" format="*N"/>
<input name="msz" type="hidden" value="0" maxlength="4" size="4" format="*N"/>
<input type="hidden" name="k" value="'.$k.'"/>
<input type="hidden" name="d" value="'.$rd.'"/>
<input type="hidden" name="n" value="'.$rn.'"/>
<input type="hidden" name="ed" value="1"/>
<input type="submit" value="Редактировать г/р">';
echo '</form></div></td>';
}
//if (($rf=="txt")&&($fsz<=204800)) {echo '- - -<br/><a href="book.php?k='.$k.'&d='.$rd.'&n='.$rn.'">Создать книгу</a><br/>';}
if (($rf=="sql")&&($fsz<=204800)) {echo '<td><div style="padding: 16px;" class="subhead"><a style="color:#fff;" class="knopka" href="inst.php?k='.$k.'&d='.$rd.'&n='.$rn.'">Cделать запрос</a></div></td>';}
echo'</table>';
//echo '<div class="subhead">В список:</div><div class="subhead">
//» <a href="actn.php?k='.$k.'&d='.$rd.'&n='.$rn.'&ac=copy&t=f&go=1">Копирования</a><br/>
//» <a href="actn.php?k='.$k.'&d='.$rd.'&n='.$rn.'&ac=cut&t=f&go=1">Перемещения</a><br/>';
//if (($rf<>"zip")&&($rf<>"jar")&&($rf<>"rar")&&($rf<>"tgz")&&($rf<>"gz")&&($rf<>"bz")&&($rf<>"gz2")&&($rf<>"bz2")&&($rf<>"tbz")&&($rf<>"tbz2")&&($rf<>"tgz2")&&($rf<>"tar")&&($fsz<=3145728)) {echo'
// <a href="actn.php?k='.$k.'&d='.$rd.'&n='.$rn.'&ac=arh&t=f&go=1">ZIP - архив</a><br/>
//<a href="actn.php?k='.$k.'&d='.$rd.'&n='.$rn.'&ac=at&t=f">TAR - архив</a>';}
echo '</div>';
if (($rf<>"zip")&&($rf<>"jar")&&($rf<>"rar")&&($rf<>"tgz")&&($rf<>"gz")&&($rf<>"bz")&&($rf<>"gz2")&&($rf<>"bz2")&&($rf<>"tbz")&&($rf<>"tbz2")&&($rf<>"tgz2")&&($rf<>"tar")&&($fsz<=3145728)) {echo '
<div class="content">Архивировать:</div>
<div class="subhead"><img src="icons/zip.png" width="16" height="16" alt="."/>
<a href="ecopy.php?k='.$k.'&d='.$rd.'&n='.$rn.'&tp=a">ZIP- архив</a></div>
<div class="subhead"><img src="icons/zip.png" width="16" height="16" alt="."/> <a href="ecopy.php?k='.$k.'&d='.$rd.'&n='.$rn.'&tp=t">TAR- архив</a></div>';
}
echo '<div class="content">С файлом:</div>
<div class="subhead"> <img src = "icons/chmod_file.png"> <a href="chmod.php?k='.$k.'&d='.$rd.'&n='.$rn.'&tp=c">CHMOD</a></div>
<div class="subhead"> <img src = "icons/copy.png"> <a href="ecopy.php?k='.$k.'&d='.$rd.'&n='.$rn.'&tp=c">Копировать</a></div>
<div class="subhead"><img src = "icons/repath.png"> <a href="ecopy.php?k='.$k.'&d='.$rd.'&n='.$rn.'&tp=m">Переместить</a></div>
<div class="subhead"> <img src = "icons/rename_path.png"> <a href="actn.php?k='.$k.'&d='.$rd.'&n='.$rn.'&ac=ren&t=f">Переименовать</a></div>
<div class="subhead"><img src = "icons/delete_path.png"> <a href="actn.php?k='.$k.'&d='.$rd.'&n='.$rn.'&ac=del&t=f">Удалить</a></div>
';
} else {
echo '<div class="subhead">
Нет соединения с сервером</div>
<div class="subhead"><a href="index.php">Главная</a></div>';
}
apicms_foot();
?>