Файл: ftp/chmod.php
Строк: 66
<?php
error_reporting(0);
$k=trim($_GET['k']); include("key.php");
$d=rawurldecode(trim($_GET['d'])); $n=rawurldecode(trim($_GET['n']));
if ($d==NULL) {$d="";} if ($n==NULL) {$n=preg_replace("~.*/([^/]*)~m","\1",$d);
$d=preg_replace("~(.*)/[^/]*~m","\1",$d);} $sv=trim($_GET['sv']);
$t=trim($_GET['t']); $ch=trim($_GET['ch']);
$rd=rawurlencode($d); $rn=rawurlencode($n);
$d=str_replace(".|htaccess",".htaccess",$d);
$n=str_replace(".|htaccess",".htaccess",$n);
require_once '../api_core/apicms_system.php';
require_once '../api_core/head.php';
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=">"/>
<a style="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>';
if (($sv<>1)||(strlen($ch)<>3)) {
$num=@file_get_contents("allnumbd.dat"); $nar=NULL;
$num++; $nar=$num; if ($num>99999999) {$num=0;}
$f=@fopen("allnumbd.dat","w"); @fwrite($f,$num); @fclose($f);
if ($d=="/") {$d="";} $n=str_replace("$","$$",$n); $d=str_replace("$","$$",$d);
echo '
<div class="subhead">
<form action="chmod.php" method="get">
CHMOD:<br/>
<input name="ch" type="text" value="'.$ch.'" size="3" maxlength="3" 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="sv" value="1"/>
<input type="submit" value="Применить"><br/>
</form>
</div>';
} else {
if (($ftp=@ftp_connect($sr))&&(@ftp_login($ftp,$lg,$ps))) {
@ftp_pasv($ftp,true);
$cmd="chmod 0$ch $d/$n"; @ftp_site($ftp,$cmd);
@ftp_close($ftp);
echo'
<script type="text/javascript">
document.location.href=" '.$dftp.'/ftp.php?k='.$k.'&d='.$rd.'";
</script>';
header("Location: $dftp/ftp.php?k=$k&d=$rd"); exit;
} else {
echo '<div class="subhead">
Нет соединения с сервером</div>
<div class="subhead"><a href="index.php">Главная</a></div>';
}
}
apicms_foot();
?>