Exemplo n.º 1
0
Arquivo: install.php Projeto: cwcw/cms
function delete_install($dir)
{
    $dir = dir_path($dir);
    if (!is_dir($dir)) {
        return FALSE;
    }
    $list = glob($dir . '*');
    foreach ($list as $v) {
        is_dir($v) ? delete_install($v) : @unlink($v);
    }
    return @rmdir($dir);
}
Exemplo n.º 2
0
    //si el config.php no está escrito
    exit(header('location: install'));
} elseif (file_exists('install')) {
    function delete_install()
    {
        if (strnatcmp(phpversion(), '5.0.4') >= 0) {
            $files = scandir('install');
            foreach ($files as $file) {
                if (!@unlink($file)) {
                    return FALSE;
                }
            }
            return rmdir('install');
        }
    }
    if (!delete_install()) {
        //y no se puede borrar
        echo "<h2><b>Por favor, elimina la carpeta install</b></h2><br>\r\n\t\tPor razones de seguridad, es obligatorio eliminarla, gracias.";
    }
    //te dice esto
} elseif (is_writable("config.php") && !@chmod("config.php", 0777)) {
    echo "<h2><b>Por favor, cambia el CHMOD del archivo config.php a CHMOD 444</b></h2><br>\r\n\tPor razones de seguridad, es obligatorio, gracias.";
    //te dice esto
} else {
    //si no hay ningún contratiempo
    define('INSIDE', TRUE);
    //definimos inside como true
    include 'config.php';
    //incluimos las extensiones
    include 'common.php';
    //incluimos los parametros comunes