Файл: sys/inc/chmod_test.php
Строк: 26
<?
function permissions($f){
return decoct(@fileperms($f))%1000;
}
function test_chmod($df,$recurse=1)
{
global $err,$user;
$show_df=preg_replace('#^'.preg_quote(H).'#', '/', $df);
if (is_writable($df))
{
echo "$show_df [".permissions($df)."] OK<br />";
}
else{
echo "$show_df [".permissions($df)."] <b>ERR</b><br />";
$err[]="Нет прав на запись в ".(is_dir($df)?'директорию':'файл')." "$show_df"";
}
if (is_dir($df) && $recurse)
{
$dir=glob($df.'/*');
if ($dir)
{
foreach ($dir as $value) {
if ($df==$value)continue;
test_chmod($value,0);
}
}
}
}
echo "<b>Проверка CHMOD:</b><br />";
if (file_exists(H.'install'))test_chmod(H.'install');
test_chmod(H.'sys/avatar/',777);
test_chmod(H.'sys/config/',777);
test_chmod(H.'sys/classes/',777);
test_chmod(H.'sys/forum/files',777);
test_chmod(H.'sys/gallery/48/',777);
test_chmod(H.'sys/gallery/128/',777);
test_chmod(H.'sys/gallery/640/',777);
test_chmod(H.'sys/gallery/foto/',777);
test_chmod(H.'sys/lib/stats/',777);
test_chmod(H.'sys/inc/',777);
test_chmod(H.'sys/fnc/',777);
test_chmod(H.'sys/diary/',777);
test_chmod(H.'sys/loads/files/',777);
test_chmod(H.'sys/loads/mp3crop/',777);
test_chmod(H.'sys/loads/screens/14/',777);
test_chmod(H.'sys/loads/screens/48/',777);
test_chmod(H.'sys/loads/screens/128/',777);
test_chmod(H.'sys/obmen/files/',777);
test_chmod(H.'sys/obmen/screens/14/',777);
test_chmod(H.'sys/obmen/screens/48/',777);
test_chmod(H.'sys/obmen/screens/128/',777);
test_chmod(H.'sys/update/',777);
test_chmod(H.'sys/tmp/',777);
test_chmod(H.'style/themes/',777);
?>