Файл: hostbiter.ru/Modules/explode/view/chmod.php
Строк: 47
<?
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));
$api = file_get_contents($config['PanelUrl']."/ispmgr?authinfo=".$user['login'].":".decode($user['password'])."&func=file.unixattr&out=xml&elid=".decode($dir)."");
$parse = simplexml_load_string($api);
if(isset($_GET['change'])){
$mode = octdec(abs(intval($_POST['mode'])));
$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,$filename['dirname']);
ftp_chmod($connect_ftp,$mode,$filename['basename']);
ftp_close($connect_ftp);
$_SESSION['message'] = 'Права доступа установлены!';
header("Location: /explode/viewfile.php?dir=".$dir);
exit;
}
?>
<div id="border">Права доступа</div>
<form action="/explode/view/chmod.php?dir=<?=$dir?>&change" method="post">
Атрибуты: (<?=$filename['basename']?>)<br />
<input name="mode" value="<?=$parse->mode?>" type="text" required/> <br />
<input type="submit" value="Изменить" name="change"/><br />
</form>
<div>
<img src="/image/back.gif" alt="" /> <a href="/explode?dir=<?=encode(dirname(decode($dir)))?>">Назад</a><br />
<?
require ($_SERVER['DOCUMENT_ROOT'].'/Core/fmfoot.php');
?>