Файл: file.php
Строк: 168
<?php
error_reporting(0);
$sid=trim($_GET['sid']);
$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);
$d=str_replace(".|htaccess",".htaccess",$d);
$n=str_replace(".|htaccess",".htaccess",$n);
// pm.cx.net
$title="View ".$n;
include('inc/head.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 bytes";}
elseif (($sz>=1024)&&($sz<1048576)) {$sz=strtr(round($sz/1024,2),".",",")." kb";}
elseif ($sz>=1048576) {$sz=strtr(round($sz/1024/1024,2),".",",")." mb";}
if ($tm<>NULL) {$tmv=gmdate("d-m-y [H:i:s]",$tm+$zn);} else {$tmv="-";}
$d=str_replace("$","$$",$d); $n=str_replace("$","$$",$n);
$rf=strtolower(preg_replace("~.*.([^.]*)~m","\1",$n));
echo("<div class="gmenu"><a href="ftp.php?k=$k&d=$rd">$d/</a><a href="file.php?k=$k&d=$rd&n=$n">$n</a></div>
<div class="bmenu"><b>$title</b></div>
<div class="menu">File: $n<br/>
Size: $sz<br/>
Last edited: ".$tmv."<hr/>");
if ((($rf=="zip")||($rf=="jar")||($rf=="tar")||($rf=="tgz")||($rf=="gz")||($rf=="gz2")||($rf=="bz")||($rf=="bz2")||($rf=="tbz")||($rf=="tbz2")||($rf=="tgz2"))&&($fsz<=11716800)&&($fsz>0)) {echo("<br/><a href="openarh.php?k=$k&d=$rd&n=$rn&tp=$rf">Open</a><br/>");
if (($rf=="zip")||($rf=="jar")) {echo("<a href="zip.php?k=$k&d=$rd&n=$rn&act=ext">Unzip</a><br/>");}
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">Extract</a><br/>");}}
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<=1122880)) {
echo('
<br/><form align="left" action="edit.php?k=$k&d=$rd&n=$rn&ed=1&msz=0&kdr=1&ikdr=2"/>
<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="hidden" name="msz" value="0"><input type="hidden" name="kdr" value="5">
Lines to page[1-50]: </small><input name="ln" type="text" value="10" maxlength="2" size="2" format="*N"/><br/>
Chars in page[32-1024]: <input name="msz" type="text" value="0" maxlength="4" size="2" format="*N"/><br/><input type="submit" value="Editor v1.0"/></form><br/><small>');
echo('
<form align="left" action="edit2.php?k=".$k."&d="$rd."&n=".$rn."&ed=1&msz=0&kdr=5"/>
<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="hidden" name="msz" value="0"><input type="hidden" name="kdr" value="5">
Lines to page[1-50]: </small><input name="ln" type="text" value="10" maxlength="2" size="2" format="*N"/><br/>
Chars in page[32-1024]: <input name="msz" type="text" value="0" maxlength="4" size="2" format="*N"/><br/><input type="submit" value="Editor v2.0"/></form><br/><small>');
}
if (($rf=="txt")&&($fsz<=204800)) {echo('<br/><a href="book.php?k='.$k.'&d='.$rd.'&n='.$rn.'">Create book</a><br/>');}
if (($rf=="sql")&&($fsz<=204800)) {echo('<br/><a href="inst.php?k='.$k.'&d='.$rd.'&n='.$rn.'">Create sql setup wizard</a><br/>');}
echo("</div>");
echo('<div class="phdr"><h3>Add to list:</h3></div><p class="menu">[<a href="actn.php?k='.$k.'&d='.$rd.'&n='.$rn.'&ac=copy&t=f&go=1">Copy</a>][<a href="actn.php?k='.$k.'&d='.$rd.'&n='.$rn.'&ac=cut&t=f&go=1">Cut</a>]');
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>][<a href="actn.php?k=$k&d=$rd&n=$rn&ac=at&t=f">TAR</a>]<br/>");}
else {echo("</p>");}
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="phdr"><h3>Add to archive:</h3></div><p class="menu">[<a href="ecopy.php?k=$k&d=$rd&n=$rn&tp=a">ZIP</a>][<a href="ecopy.php?k=$k&d=$rd&n=$rn&tp=t">TAR</a>]</p>");}
echo("<div class="phdr"><h3>Actions:</h3></div><p class="menu">");
echo(" <a href="ecopy.php?k=$k&d=$rd&n=$rn&tp=c">Copy</a>
<a href="ecopy.php?k=$k&d=$rd&n=$rn&tp=m">Move</a> ");
echo("<a href="actn.php?k=$k&d=$rd&n=$rn&ac=ren&t=f">Rename</a>
<a href="actn.php?k=$k&d=$rd&n=$rn&ac=del&t=f">Delete</a> ");
echo('<a href="download.php?k='.$k.'&d='.$rd.'&n='.$rn.'">Download</a>
</p>');
include('inc/foot.php');
} else {
echo("<p class="rmenu" align='center'><small>
Error..!!<br/>
</small></p>
");
include('inc/foot.php');
}
?>