Beispiel #1
0
function directory_tree_is_writable($node)
{
    $node = realpath($node);
    if (!$node) {
        return TRUE;
    }
    if (!is_readable($node) || !is_writable($node)) {
        @chmod($node, 0777);
        if (!is_readable($node) || !is_writable($node)) {
            return FALSE;
        }
    }
    if (is_dir($node)) {
        $dir = opendir($node);
        while ($file = readdir($dir)) {
            if ($file == '.' || $file == '..') {
                continue;
            }
            if (!directory_tree_is_writable($node . '/' . $file)) {
                return FALSE;
            }
        }
        closedir($dir);
    }
    return TRUE;
}
Beispiel #2
0
        @chmod($path . $fl, 0777);
        @clearstatcache();
        if (!is_readable($path . $fl) || !is_writable($path . $fl)) {
            $error = TRUE;
            $curr_error = TRUE;
        }
    }
    if (!$curr_error) {
        unset($perms[$fl]);
        unset($files[$i]);
    }
}
$rperms = array();
foreach ($recursive as $i => $dr) {
    $curr_error = FALSE;
    $rperms[$dr] = directory_tree_is_writable($path . $dr);
    if (!$rperms[$dr]) {
        $error = TRUE;
        $curr_error = TRUE;
    }
    if (!$curr_error) {
        unset($rperms[$dr]);
        unset($recursive[$i]);
    }
}
if (!$error) {
    $_SESSION['INSTALL_STEP'] = 5;
    header('Location: ?next&r=' . rand(0, 99999));
}
$html .= '
							<div class="ttl">