Ejemplo n.º 1
0
        echo "<input type=\"hidden\" name=\"dns_ns1\" value=\"" . $dns_ns1 . "\">";
        echo "<input type=\"hidden\" name=\"dns_ns2\" value=\"" . $dns_ns2 . "\">";
        echo "<input type=\"hidden\" name=\"step\" value=\"" . $current_step . "\">";
        echo "<input type=\"hidden\" name=\"language\" value=\"" . $language . "\">";
        echo "<input type=\"submit\" name=\"submit\" value=\"" . _('Go to step') . " " . $current_step . "\">";
        echo "</form>";
        break;
    case 6:
        // Try to create configuration file
        $config_file_created = false;
        $configuration = '';
        // FIXME
        if (is_writeable(LOCAL_CONFIG_FILE)) {
            $local_config = fopen(LOCAL_CONFIG_FILE, "w");
            fwrite($local_config, $configuration);
            fclose($local_config);
            $config_file_created = true;
        }
        // No need to set database port if it's standard port for that db
        $db_port = $_POST['db_type'] == 'mysql' && $_POST['db_port'] != 3306 || $_POST['db_type'] == 'pgsql' && $_POST['db_port'] != 5432 ? $_POST['db_port'] : '';
        // For SQLite we should provide path to db file
        $db_file = $_POST['db_type'] == 'sqlite' ? $db_file = $_POST['db_name'] : '';
        echo $twig->render('step6.html', array('next_step' => ++$current_step, 'language' => $language, 'config_file_created' => $config_file_created, 'local_config_file' => LOCAL_CONFIG_FILE, 'session_key' => Poweradmin\Password::salt(SESSION_KEY_LENGTH), 'iface_lang' => $language, 'dns_hostmaster' => $_POST['dns_hostmaster'], 'dns_ns1' => $_POST['dns_ns1'], 'dns_ns2' => $_POST['dns_ns2'], 'db_host' => $_POST['db_host'], 'db_user' => $_POST['pa_db_user'], 'db_pass' => $_POST['pa_db_pass'], 'db_name' => $_POST['db_name'], 'db_type' => $_POST['db_type'], 'db_port' => $db_port, 'db_charset' => $_POST['db_charset'], 'pa_pass' => $_POST['pa_pass']));
        break;
    case 7:
        echo $twig->render('step7.html');
        break;
    default:
        break;
}
echo $twig->render('footer.html', array('version' => Poweradmin\Version::VERSION));