// Grab phpMyAdmin version and PMA_dl function $cfg['GD2Available'] = 'auto'; require('../libraries/defines.lib.php'); unset($cfg); // Script information $script_info = 'phpMyAdmin ' . PMA_VERSION . ' setup script by Michal Čihař '; $script_version = '$Id$'; // Grab configuration defaults require('../config.default.php'); $default_cfg = $cfg; unset($cfg); function remove_slashes($val) { if (get_magic_quotes_gpc()) { return stripslashes($val); } return $val; } // Grab some variables if (isset($_POST['action'])) { $action = $_POST['action']; } else { $action = ''; } if (isset($_POST['cfg']) && $action != 'clear' ) { $cfg = unserialize(remove_slashes($_POST['cfg'])); } else { $cfg = array(); } if (!isset($cfg['Servers']) || !is_array($cfg['Servers'])) { $cfg['Servers'] = array(); } $now = gmdate('D, d M Y H:i:s') . ' GMT'; // whether to show html header? if ($action != 'download') { header('Expires: ' . $now); // rfc2616 - Section 14.21 header('Last-Modified: ' . $now); header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0'); // HTTP/1.1 header('Pragma: no-cache'); // HTTP/1.0 // Define the charset to be used header('Content-Type: text/html; charset=utf-8'); // this needs to be echoed otherwise php with short tags complains echo '' . "\n"; ?> phpMyAdmin <?php echo PMA_VERSION; ?> setup

phpMyAdmin setup

' . "\n"; if (!empty($title)) { echo '

'; echo $title; echo '

' . "\n"; } echo $text . "\n"; echo '' . "\n"; } function get_hidden_cfg() { global $cfg; return '' . "\n"; } function show_hidden_cfg() { echo get_hidden_cfg(); } function get_action($name, $title, $added = '') { $ret = ''; $ret .= '
'; $ret .= ''; $ret .= $added; $ret .= ''; $ret .= get_hidden_cfg(); $ret .= '
'; $ret .= "\n"; return $ret; } function show_action($name, $title, $added = '') { echo get_action($name, $title, $added); } function footer() { echo ''; exit; } function get_server_auth($val) { global $default_cfg; if (isset($val['auth_type'])) { $auth = $val['auth_type']; } else { $auth = $default_cfg['Servers'][1]['auth_type']; } $ret = $auth; if ($auth == 'config') { if (isset($val['user'])) { $ret .= ':' . $val['user']; } else { $ret .= ':' . $default_cfg['Servers'][1]['user']; } } return $ret; } function get_server_name($val, $id = FALSE) { if (!empty($val['verbose'])) { $ret = htmlspecialchars($val['verbose']); } else { $ret = htmlspecialchars($val['host']); } $ret .= ' (' . get_server_auth($val) . ')'; if ($id !== FALSE) { $ret .= ' [' . ($id + 1) . ']' ; } return $ret; } function get_cfg_string() { global $cfg, $script_info, $script_version, $now; $c = $cfg; $ret = " 0) { $ret .= "/* Servers configuration */\n\$i = 0;\n"; foreach($c['Servers'] as $cnt => $srv) { $ret .= "\n/* Server " . get_server_name($srv, $cnt) . " */\n\$i++;\n"; foreach($srv as $key => $val) { $ret .= "\$cfg['Servers'][\$i]['$key'] = '$val';\n"; } } $ret .= "\n/* End of servers configration */\n\n"; } unset($c['Servers']); foreach($c as $key => $val) { if (is_array($val)) { $ret .= "\n"; foreach($val as $k => $v) { if (!isset($type)) { if (is_string($k)) { $type = 'string'; } elseif (is_int($k)) { $type = 'int'; $ret .= "\$cfg['$key'] = array(\n"; } else { // Something unknown... $ret .= "\$cfg['$key'] = " . var_export($val, TRUE) . ";\n"; break; } } if ($type == 'string') { $ret .= "\$cfg['$key']['$k'] = " . var_export($v, TRUE) . ";\n"; } elseif ($type == 'int') { $ret .= " " . var_export($v, TRUE) . ";\n"; } } if ($type == 'int') { $ret .= ");\n"; } $ret .= "\n"; unset($type); } else { $ret .= "\$cfg['$key'] = " . var_export($val, TRUE) . ";\n"; } } $ret .= "?>\n"; return $ret; } function compress_servers() { global $cfg; $ns = array(); foreach ($cfg['Servers'] as $val) { if (!empty($val['host'])) { $ns[] = $val; } } $cfg['Servers'] = $ns; } function grab_values($list) { $a = split(';', $list); $res = array(); foreach($a as $val) { $v = split(':', $val); if (!isset($v[1])) $v[1] = ''; switch($v[1]) { case 'bool': $res[$v[0]] = isset($_POST[$v[0]]); break; case 'serialized': if (isset($_POST[$v[0]]) && strlen($_POST[$v[0]]) > 0) { $res[$v[0]] = unserialize(remove_slashes($_POST[$v[0]])); } break; case 'int': if (isset($_POST[$v[0]]) && strlen($_POST[$v[0]]) > 0) { $res[$v[0]] = (int)remove_slashes($_POST[$v[0]]); } break; case 'tristate': if (isset($_POST[$v[0]]) && strlen($_POST[$v[0]]) > 0) { $cur = remove_slashes($_POST[$v[0]]); if ($cur == 'TRUE') { $res[$v[0]] = TRUE; } else if ($cur == 'FALSE') { $res[$v[0]] = FALSE; } else { $res[$v[0]] = $cur; } } break; default: if (isset($_POST[$v[0]]) && strlen($_POST[$v[0]]) > 0) { $res[$v[0]] = remove_slashes($_POST[$v[0]]); } break; } } return $res; } function show_overview($legend, $list, $buttons = '') { echo '
' . "\n"; echo '' . $legend . '' . "\n"; foreach($list as $val) { echo '
'; echo '
'; echo $val[0]; echo '
'; echo '
'; echo $val[1]; echo '
'; echo '
' . "\n"; } if (!empty($buttons)) { echo '
'; echo '
Actions:
'; echo $buttons; echo '
' . "\n"; } echo '
' . "\n"; echo "\n"; } function show_config_form($list, $legend, $help, $defaults = array(), $save = '') { global $default_cfg; if (empty($save)) $save = 'Update'; echo '
' . "\n"; echo '' . $legend . '' . "\n"; echo '

' . $help . '

' . "\n"; foreach($list as $val) { echo '
'; $type = 'text'; if (isset($val[3])) { if (is_array($val[3])) $type = 'select'; elseif (is_bool($val[3])) $type = 'check'; elseif ($val[3] == 'password') $type = 'password'; } switch ($type) { case 'text': case 'password': echo ''; echo ''; break; case 'check': echo ''; echo ''; break; case 'select': echo ''; echo ''; break; } echo '
' . "\n"; } echo '
'; echo '
Actions:
'; echo ''; echo ''; echo '
' . "\n"; echo '
' . "\n"; echo "\n"; } function show_security_form($defaults = array()) { ?>
viewable type and http://dev.mysql.com/doc/refman as manual base URL.', $defaults); ?>
'; } $hi = array ('bookmarktable', 'relation', 'table_info', 'table_coords', 'pdf_pages', 'column_info', 'history', 'AllowDeny'); foreach($hi as $k) { if (isset($defaults[$k])) { echo ''; } } show_config_form(array( array('Server hostname', 'host', 'Hostname where MySQL server is running'), array('Server port', 'port', 'Port on which MySQL server is listening, leave empty if don\'t know'), array('Server socked', 'socket', 'Socket on which MySQL server is listening, leave empty if don\'t know'), array('Connection type', 'connect_type', 'How to connect to server, keep tcp if don\'t know', array('tcp', 'socket')), array('PHP extension to use', 'extension', 'What PHP extension to use, use mysqli if supported', array('mysql', 'mysqli')), array('Compress connection', 'compress', 'Whether to compress connection to MySQL server', FALSE), array('Authentication type', 'auth_type', 'Authentication method to use', array('cookie', 'http', 'config')), array('User for config auth', 'user', 'Leave empty if not using config auth'), array('Password for config auth', 'password', 'Leave empty if not using config auth', 'password'), array('Only database to show', 'only_db', 'Limit listing of databases in left frame to this one'), array('Verbose name of this server', 'verbose', 'Name to display in server selection'), array('phpMyAdmin control user', 'controluser', 'User which phpMyAdmin can use for various actions'), array('phpMyAdmin control user password', 'controlpass', 'Password for user which phpMyAdmin can use for various actions', 'password'), array('phpMyAdmin database for advanced features', 'pmadb', 'phpMyAdmin will allow much more when you enable this. Table names are filled in automatically.'), ), 'Configure server', ($number === FALSE) ? 'Enter new server connection parameters.' : 'Editing server ' . get_server_name($defaults, $number), $defaults, $number === FALSE ? 'Add' : ''); ?>
'; foreach ($cfg['Servers'] as $key => $val) { $ret .= ''; } $ret .= ''; return $ret; } if ($action != 'download') { // Check whether we can write to configuration $fail_dir = FALSE; $fail_dir = $fail_dir || !is_dir('../config/'); $fail_dir = $fail_dir || !is_writable('../config/config.inc.php'); $config = @fopen('../config/config.inc.php', 'a'); $fail_dir = $fail_dir || ($config === FALSE); @fclose($config); if ($fail_dir) { message('warning', 'Please create web server writable folder config in phpMyAdmin toplevel directory as described in documentation. Otherwise you will be only able to download or display it.', 'Can not write configuration'); } } $show_info = FALSE; switch ($action) { case 'download': header('Content-Type: text/plain'); header('Expires: ' . $now); header('Content-Disposition: attachment; filename="config.inc.php"'); header('Pragma: no-cache'); echo get_cfg_string(); exit; break; case 'display': echo '
' . "\n"; ?> ' . file_get_contents( $config_file ) ); } else { $success_apply_user_config = eval( '?>' . implode( '\n', file( $config_file ) ) ); } error_reporting( $old_error_reporting ); unset( $old_error_reporting ); if ($success_apply_user_config === FALSE) { message('error', 'Error while parsing configuraton file!'); $cfg = $bck_cfg; } elseif (count($cfg) == 0 || (isset($cfg['Servers']) && count($cfg) == 1 || count($cfg['Servers']) == 0)) { message('error', 'Config file seems to contain no configuration!'); $cfg = $bck_cfg; } else { message('notice', 'Configuration loaded'); compress_servers(); } } else { message('error', 'Configuration file not found!'); $cfg = $bck_cfg; } $show_info = TRUE; break; case 'addserver_real': if (isset($_POST['submit_save'])) { $new_server = grab_values('host;port;socket;connect_type;compress:bool;controluser;controlpass;auth_type;user;password;only_db;verbose;pmadb;bookmarktable:serialized;relation:serialized;table_info:serialized;table_coords:serialized;pdf_pages:serialized;column_info:serialized;history:serialized;AllowDeny:serialized'); $err = FALSE; if (empty($new_server['host'])) { message('error', 'Empty hostname!'); $err = TRUE; } if ($new_server['connect_type'] == 'socket' && empty($new_server['socket'])) { message('error', 'Empty socket with socket connection seleted!'); $err = TRUE; } if ($new_server['auth_type'] == 'config' && empty($new_server['user'])) { message('error', 'Empty username while using config authentication method!'); $err = TRUE; } if (!empty($new_server['pmadb'])) { // Just use defaults, should be okay for most users $pmadb = array(); $pmadb['bookmarktable'] = 'pma_bookmark'; $pmadb['relation'] = 'pma_relation'; $pmadb['table_info'] = 'pma_table_info'; $pmadb['table_coords'] = 'pma_table_coords'; $pmadb['pdf_pages'] = 'pma_pdf_pages'; $pmadb['column_info'] = 'pma_column_info'; $pmadb['history'] = 'pma_history'; $new_server = array_merge($pmadb, $new_server); unset($pmadb); if (empty($new_server['controluser'])) { message('error', 'Empty phpMyAdmin control user while using pmadb!'); $err = TRUE; } if (empty($new_server['controlpass'])) { message('error', 'Empty phpMyAdmin control user password while using pmadb!'); $err = TRUE; } } else { message('warning', 'You didn\'t set phpMyAdmin database, so you can not use all phpMyAdmin features.'); } if ($new_server['auth_type'] == 'config') { message('warning', 'Remember to protect your installation while using config authentication method!'); } else { // Not needed: unset($new_server['user']); unset($new_server['password']); } if ($err) { show_server_form($new_server, isset($_POST['server']) ? $_POST['server'] : FALSE); } else { if (isset($_POST['server'])) { $cfg['Servers'][$_POST['server']] = $new_server; message('notice', 'Changed server ' . get_server_name($new_server, $_POST['server'])); } else { $cfg['Servers'][] = $new_server; message('notice', 'New server added'); } $show_info = TRUE; if ($new_server['auth_type'] == 'cookie' && empty($cfg['blowfish_secret'])) { message('notice', 'You did not have configured blowfish secret and you want to use cookie authentication so I generated blowfish secret for you. It is used to encrypt cookies.', 'Blowfist secret generated'); // FIXME: Find better way: $cfg['blowfish_secret'] = '' . rand(); } } unset($new_server); } else { $show_info = TRUE; } break; case 'addserver': if (count($cfg['Servers']) == 0) { // First server will use defaults as in config.default.php $defaults = $default_cfg['Servers'][1]; } else { $defaults = array(); } // Guess MySQL extension to use, prefer mysqli if (!function_exists('mysql_get_client_info')) { PMA_dl('mysql'); } if (!function_exists('mysqli_get_client_info')) { PMA_dl('mysqli'); } if (function_exists('mysqli_get_client_info')) { $defaults['extension'] = 'mysqli'; } else if (function_exists('mysql_get_client_info')) { $defaults['extension'] = 'mysql'; } else { message('warning', 'Could not load neither mysql nor mysqli extension, you might not be able to use phpMyAdmin!'); } if (isset($defaults['extension'])) { message('notice', 'Autodetected MySQL extension to use: ' . $defaults['extension']); } // Display form show_server_form($defaults); break; case 'editserver': if (!isset($_POST['server'])) footer(); show_server_form($cfg['Servers'][$_POST['server']], $_POST['server']); break; case 'deleteserver': if (!isset($_POST['server'])) footer(); message('notice', 'Deleted server ' . get_server_name($cfg['Servers'][$_POST['server']], $_POST['server'])); unset($cfg['Servers'][$_POST['server']]); compress_servers(); $show_info = TRUE; break; case 'servers': if (count($cfg['Servers']) == 0) { message('notice', 'No servers defined, so none can not be shown'); } else { foreach($cfg['Servers'] as $i => $srv) { $data = array(); if (!empty($srv['verbose'])) { $data[] = array('Verbose name', $srv['verbose']); } $data[] = array('Host', $srv['host']); $data[] = array('MySQL extension', isset($srv['extension']) ? $srv['extension'] : $default_cfg['Servers'][1]['extension']); $data[] = array('Authentication type', get_server_auth($srv)); $data[] = array('phpMyAdmin advanced features', empty($srv['pmadb']) || empty($srv['controluser']) || empty($srv['controlpass']) ? 'disabled' : 'enabled, db: ' . $srv['pmadb'] . ', user: ' . $srv['controluser']); $buttons = get_action('deleteserver', 'Delete', '') . get_action('editserver', 'Edit', ''); show_overview('Server ' . get_server_name($srv, $i), $data, $buttons); } } break; case 'feat_upload_real': if (isset($_POST['submit_save'])) { $dirs = grab_values('UploadDir;SaveDir;docSQLDir'); chdir('..'); // to allow checking directories $err = FALSE; if (!empty($dirs['UploadDir']) && !is_dir($dirs['UploadDir'])) { message('error', 'Upload directory ' . htmlspecialchars($dirs['UploadDir']) . ' does not exist!'); $err = TRUE; } if (!empty($dirs['SaveDir']) && !is_dir($dirs['SaveDir'])) { message('error', 'Save directory ' . htmlspecialchars($dirs['SaveDir']) . ' does not exist!'); $err = TRUE; } if (!empty($dirs['docSQLDir']) && !is_dir($dirs['docSQLDir'])) { message('error', 'docSQL directory ' . htmlspecialchars($dirs['docSQLDir']) . ' does not exist!'); $err = TRUE; } if ($err) { show_upload_form($dirs); } else { $cfg = array_merge($cfg, $dirs); message('notice', 'Configuration changed'); $show_info = TRUE; } } else { $show_info = TRUE; } break; case 'feat_upload': show_upload_form($cfg); break; case 'feat_security_real': if (isset($_POST['submit_save'])) { $vals = grab_values('blowfish_secret;ForceSSL:bool;ShowPHPInfo:bool;ShowChgPassword:bool;AllowArbitraryServer:bool;LoginCookieRecall:book;LoginCookieValidity:int'); $err = FALSE; if (empty($vals['blowfish_secret'])) { message('warning', 'Blowfish secret is empty, you will not be able to use cookie authentication.'); } if ($vals['AllowArbitraryServer']) { message('warning', 'Arbitrary server connection might be dangerous as it might allow access to internal servers that are not reachable from outside.'); } if (isset($vals['LoginCookieValidity']) && $vals['LoginCookieValidity'] < 1) { message('error', 'Invalid cookie validity time'); $err = TRUE; } if ($err) { show_security_form($vals); } else { $cfg = array_merge($cfg, $vals); message('notice', 'Configuration changed'); $show_info = TRUE; } } else { $show_info = TRUE; } break; case 'feat_security': show_security_form($cfg); break; case 'feat_manual_real': if (isset($_POST['submit_save'])) { $vals = grab_values('MySQLManualBase;MySQLManualType'); $err = FALSE; if ($vals['MySQLManualType'] != 'none' && empty($vals['MySQLManualBase'])) { message('error', 'You need to set manual base URL or choone none type.'); $err = TRUE; } if ($err) { show_manual_form($vals); } else { $cfg = array_merge($cfg, $vals); message('notice', 'Configuration changed'); $show_info = TRUE; } } else { $show_info = TRUE; } break; case 'feat_manual': show_manual_form($cfg); break; case 'feat_charset_real': if (isset($_POST['submit_save'])) { $vals = grab_values('AllowAnywhereRecoding:bool;DefaultCharset;RecodingEngine;IconvExtraParams'); $err = FALSE; if ($err) { show_charset_form($vals); } else { $cfg = array_merge($cfg, $vals); message('notice', 'Configuration changed'); $show_info = TRUE; } } else { $show_info = TRUE; } break; case 'feat_charset': $d = $cfg; if (!isset($d['RecodingEngine'])) { if (@extension_loaded('iconv')) { $d['RecodingEngine'] = 'iconv'; } else if (@extension_loaded('recode')) { $d['RecodingEngine'] = 'recode'; } else { PMA_dl('iconv'); if (!@extension_loaded('iconv')) { PMA_dl('recode'); if (!@extension_loaded('recode')) { message('warning', 'Could not load neither recode nor iconv so charset conversion will most likely not work.'); } else { $d['RecodingEngine'] = 'recode'; } } else { $d['RecodingEngine'] = 'iconv'; } } if (isset($d['RecodingEngine'])) { message('notice', 'Autodetected recoding engine: ' . $d['RecodingEngine']); } } show_charset_form($d); unset($d); break; case 'feat_extensions_real': if (isset($_POST['submit_save'])) { $vals = grab_values('GD2Available'); $err = FALSE; if ($err) { show_extensions_form($vals); } else { $cfg = array_merge($cfg, $vals); message('notice', 'Configuration changed'); $show_info = TRUE; } } else { $show_info = TRUE; } break; case 'feat_extensions': $d = $cfg; if (!isset($d['GD2Available'])) { if (PMA_IS_GD2 == 1) { message('notice', 'GD 2 or newer found.'); $d['GD2Available'] = 'yes'; } else { message('warning', 'GD 2 or newer is not present.'); $d['GD2Available'] = 'no'; } } show_extensions_form($d); unset($d); break; case 'feat_relation_real': if (isset($_POST['submit_save'])) { $vals = grab_values('QueryHistoryDB:bool;QueryHistoryMax:int;BrowseMIME:bool;PDFDefaultPageSize'); $err = FALSE; if (isset($vals['QueryHistoryMax']) && $vals['QueryHistoryMax'] < 1) { message('error', 'Invalid value for query maximal history size!'); $err = TRUE; } if ($err) { show_relation_form($vals); } else { $cfg = array_merge($cfg, $vals); message('notice', 'Configuration changed'); $show_info = TRUE; } } else { $show_info = TRUE; } break; case 'feat_relation': show_relation_form($cfg); break; case 'lay_left_real': if (isset($_POST['submit_save'])) { $vals = grab_values('LeftFrameLight:bool;LeftFrameDBTree:bool;LeftFrameDBSeparator;LeftFrameTableSeparator;LeftFrameTableLevel:int;LeftDisplayLogo:bool;LeftDusplayServers:bool;LeftPointerEnable:bool'); $err = FALSE; if (isset($vals['LeftFrameTableLevel']) && $vals['LeftFrameTableLevel'] < 1) { message('error', 'Invalid value for maximum table nesting level!'); $err = TRUE; } if ($err) { show_left_form($vals); } else { $cfg = array_merge($cfg, $vals); message('notice', 'Configuration changed'); $show_info = TRUE; } } else { $show_info = TRUE; } break; case 'lay_left': show_left_form($cfg); break; case 'lay_tabs_real': if (isset($_POST['submit_save'])) { $vals = grab_values('DefaultTabServer;DefaultTabDatabase;DefaultTabTable;LightTabs:bool'); $err = FALSE; if ($err) { show_tabs_form($vals); } else { $cfg = array_merge($cfg, $vals); message('notice', 'Configuration changed'); $show_info = TRUE; } } else { $show_info = TRUE; } break; case 'lay_tabs': show_tabs_form($cfg); break; case 'lay_icons_real': if (isset($_POST['submit_save'])) { $vals = grab_values('ErrorIconic:bool;MainPageIconic:bool;ReplaceHelpImg:bool;NavigationBarIconic:tristate;PropertiesIconic:tristate'); $err = FALSE; if ($err) { show_icons_form($vals); } else { $cfg = array_merge($cfg, $vals); message('notice', 'Configuration changed'); $show_info = TRUE; } } else { $show_info = TRUE; } break; case 'lay_icons': show_icons_form($cfg); break; case 'lay_browse_real': if (isset($_POST['submit_save'])) { $vals = grab_values('BrowsePointerEnable:bool;BrowseMarkerEnable:bool;ModifyDeleteAtRight:bool;ModifyDeleteAtLeft:bool;RepeatCells:int;DefaultDisplay'); $err = FALSE; if (isset($vals['RepeatCells']) && $vals['RepeatCells'] < 1) { message('error', 'Invalid value for header repeating!'); $err = TRUE; } if (!$vals['ModifyDeleteAtLeft'] && !$vals['ModifyDeleteAtRight']) { message('error', 'No action buttons enabled!'); $err = TRUE; } if ($err) { show_browse_form($vals); } else { $cfg = array_merge($cfg, $vals); message('notice', 'Configuration changed'); $show_info = TRUE; } } else { $show_info = TRUE; } break; case 'lay_browse': show_browse_form($cfg); break; case 'lay_edit_real': if (isset($_POST['submit_save'])) { $vals = grab_values('TextareaCols:int;TextareaRows:int;LongtextDoubleTextarea:bool;TextareaAutoSelect:bool;CharEditing;CharTextareaCols:int;CharTextareaRows:int;CtrlArrowsMoving:bool;DefaultPropDisplay;InsertRows:int'); $err = FALSE; if (isset($vals['TextareaCols']) && $vals['TextareaCols'] < 1) { message('error', 'Invalid value for textarea columns!'); $err = TRUE; } if (isset($vals['TextareaRows']) && $vals['TextareaRows'] < 1) { message('error', 'Invalid value for textarea rows!'); $err = TRUE; } if (isset($vals['CharTextareaCols']) && $vals['CharTextareaCols'] < 1) { message('error', 'Invalid value for CHAR textarea columns!'); $err = TRUE; } if (isset($vals['CharTextareaRows']) && $vals['CharTextareaRows'] < 1) { message('error', 'Invalid value for CHAR textarea rows!'); $err = TRUE; } if (isset($vals['InsertRows']) && $vals['InsertRows'] < 1) { message('error', 'Invalid value for inserted rows count!'); $err = TRUE; } if ($err) { show_edit_form($vals); } else { $cfg = array_merge($cfg, $vals); message('notice', 'Configuration changed'); $show_info = TRUE; } } else { $show_info = TRUE; } break; case 'lay_edit': show_edit_form($cfg); break; case 'lay_window_real': if (isset($_POST['submit_save'])) { $vals = grab_values('EditInWindow:bool;QueryWindowHeight:int;QueryWindowWidth:int;QueryWindowDefTab'); $err = FALSE; if (isset($vals['QueryWindowWidth']) && $vals['QueryWindowWidth'] < 1) { message('error', 'Invalid value for query window width!'); $err = TRUE; } if (isset($vals['QueryWindowHeight']) && $vals['QueryWindowHeight'] < 1) { message('error', 'Invalid value for query window height'); $err = TRUE; } if ($err) { show_window_form($vals); } else { $cfg = array_merge($cfg, $vals); message('notice', 'Configuration changed'); $show_info = TRUE; } } else { $show_info = TRUE; } break; case 'lay_window': show_window_form($cfg); break; case 'clear': // Actual clearing is done on beginning of this script case 'main': $show_info = TRUE; break; case '': message('notice', 'You want to configure phpMyAdmin using web interface. Please note that this only allows basic setup, please read documentation to see full description of all configuration directives.', 'Welcome'); if (empty($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) == 'off') { if (empty($_SERVER['REQUEST_URI']) || empty($_SERVER['HTTP_HOST'])) { $redir = ''; } else { $redir = ' If your server is also configured to accept HTTPS request follow this link to use secure connection.'; } message('warning', 'You are not using secure connection, all data (including sensitive, like passwords) are transfered unencrypted!' . $redir, 'Not secure connection'); } break; } if ($show_info) { $servers = 'none'; $servers_text = 'Servers'; if (count($cfg['Servers']) == 0) { message('warning', 'No servers defined, you probably want to add one.'); } else { $servers = ''; $servers_text = 'Servers (' . count($cfg['Servers']) . ')'; $sep = ''; foreach ($cfg['Servers'] as $key => $val) { $servers .= $sep; $sep = ', '; $servers .= get_server_name($val, $key); } unset($sep); } show_overview('Current configuration overview', array( array($servers_text, $servers), array('SQL files upload', empty($cfg['UploadDir']) ? 'disabled' : 'enabled'), array('Exported files on server', empty($cfg['SaveDir']) ? 'disabled' : 'enabled'), array('Charset conversion', isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding'] ? 'enabled' : 'disabled'), )); unset($servers_text, $servers); } echo '

Available global actions (please note that these will delete any changes you could have done above):

'; echo '
Servers' . "\n"; show_action('addserver', 'Add'); $servers = get_server_selection(); if (!empty($servers)) { show_action('servers', 'List'); show_action('deleteserver', 'Delete', $servers); show_action('editserver', 'Edit', $servers); } echo '
' . "\n\n"; echo '
Layout' . "\n"; show_action('lay_left', 'Left frame'); show_action('lay_tabs', 'Tabs'); show_action('lay_icons', 'Icons'); show_action('lay_browse', 'Browsing'); show_action('lay_edit', 'Editing'); show_action('lay_window', 'Query window'); echo '
' . "\n\n"; echo '
Features' . "\n"; show_action('feat_upload', 'Upload/Download'); show_action('feat_security', 'Security'); show_action('feat_manual', 'MySQL manual'); show_action('feat_charset', 'Charsets'); show_action('feat_extensions', 'Extensions'); show_action('feat_relation', 'MIME/Relation/History'); echo '
' . "\n\n"; echo '
Configuration' . "\n"; show_action('main', 'Overview'); show_action('display', 'Display'); show_action('download', 'Download'); if (!$fail_dir) { show_action('save', 'Save'); show_action('load', 'Load'); } show_action('clear', 'Clear'); echo '
' . "\n\n"; footer(); ?>