Translated using Weblate (Indonesian)
[phpmyadmin.git] / setup / config.php
blobb7fd61119d4e2e89fe935a339453289133df9fb0
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Front controller for config view / download and clear
6 * @package PhpMyAdmin-Setup
7 */
8 use PMA\libraries\config\FormDisplay;
9 use PMA\setup\lib\ConfigGenerator;
10 use PMA\libraries\URL;
12 /**
13 * Core libraries.
15 require './lib/common.inc.php';
17 require './libraries/config/setup.forms.php';
19 $form_display = new FormDisplay($GLOBALS['ConfigFile']);
20 $form_display->registerForm('_config.php', $forms['_config.php']);
21 $form_display->save('_config.php');
23 if (isset($_POST['eol'])) {
24 $_SESSION['eol'] = ($_POST['eol'] == 'unix') ? 'unix' : 'win';
27 if (PMA_ifSetOr($_POST['submit_clear'], '')) {
29 // Clear current config and return to main page
31 $GLOBALS['ConfigFile']->resetConfigData();
32 // drop post data
33 header('HTTP/1.1 303 See Other');
34 header('Location: index.php' . URL::getCommonRaw());
35 exit;
36 } elseif (PMA_ifSetOr($_POST['submit_download'], '')) {
38 // Output generated config file
40 PMA_downloadHeader('config.inc.php', 'text/plain');
41 echo ConfigGenerator::getConfigFile($GLOBALS['ConfigFile']);
42 exit;
43 } else {
45 // Show generated config file in a <textarea>
47 header('HTTP/1.1 303 See Other');
48 header('Location: index.php' . URL::getCommonRaw(array('page' => 'config')));
49 exit;