2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Front controller for config view / download and clear
6 * @package PhpMyAdmin-Setup
8 use PMA\libraries\config\FormDisplay
;
9 use PMA\setup\lib\ConfigGenerator
;
10 use PMA\libraries\URL
;
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();
33 header('HTTP/1.1 303 See Other');
34 header('Location: index.php' . URL
::getCommonRaw());
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']);
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')));