2 /* vim: set expandtab sw=4 ts=4 sts=4: */
6 * @package PhpMyAdmin-Setup
9 if (!defined('PHPMYADMIN')) {
16 require_once './libraries/display_select_lang.lib.php';
17 require_once './libraries/config/FormDisplay.class.php';
18 require_once './setup/lib/index.lib.php';
20 // prepare unfiltered language list
21 $all_languages = PMA_langList();
22 uasort($all_languages, 'PMA_languageCmp');
24 $cf = ConfigFile
::getInstance();
25 $separator = PMA_get_arg_separator('html');
31 // Check phpMyAdmin version
33 if (isset($_GET['version_check'])) {
38 // Perform various security, compatibility and consistency checks
40 perform_config_checks();
43 // Check whether we can read/write configuration
45 $config_readable = false;
46 $config_writable = false;
47 $config_exists = false;
48 check_config_rw($config_readable, $config_writable, $config_exists);
49 if (!$config_writable ||
!$config_readable) {
51 'error', 'config_rw', __('Cannot load or save configuration'),
52 PMA_lang(__('Please create web server writable folder [em]config[/em] in phpMyAdmin top level directory as described in [doc@setup_script]documentation[/doc]. Otherwise you will be only able to download or display it.'))
56 // Check https connection
58 $is_https = !empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on';
60 $text = __('You are not using a secure connection; all data (including potentially sensitive information, like passwords) is transferred unencrypted!');
62 if (!empty($_SERVER['REQUEST_URI']) && !empty($_SERVER['HTTP_HOST'])) {
63 $link = 'https://' . htmlspecialchars($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
64 $strInsecureConnectionMsg2 = __('If your server is also configured to accept HTTPS requests follow [a@%s]this link[/a] to use a secure connection.');
65 $strInsecureConnectionMsg2 = sprintf($strInsecureConnectionMsg2, $link);
66 $text .= ' ' . PMA_lang($strInsecureConnectionMsg2);
68 messages_set('notice', 'no_https', __('Insecure connection'), $text);
72 <form id
="select_lang" method
="post" action
="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']) ?>">
73 <?php
echo PMA_generate_common_hidden_inputs() ?
>
74 <bdo lang
="en" dir
="ltr"><label
for="lang">
75 <?php
echo __('Language') . (__('Language') != 'Language' ?
' - Language' : '') ?
>
77 <select id
="lang" name
="lang" class="autosubmit" lang
="en" dir
="ltr">
79 // create language list
81 foreach ($all_languages as $each_lang_key => $each_lang) {
82 $lang_name = PMA_langName($each_lang);
83 //Is current one active?
84 $selected = ($GLOBALS['lang'] == $each_lang_key) ?
' selected="selected"' : '';
85 echo '<option value="' . $each_lang_key . '"' . $selected . '>' . $lang_name
93 // Check for done action info and set notice message if present
94 switch ($action_done) {
96 /* Use uniqid to display this message every time configuration is saved */
98 'notice', uniqid('config_saved'), __('Configuration saved.'),
99 PMA_lang(__('Configuration saved to file config/config.inc.php in phpMyAdmin top level directory, copy it to top level one and delete directory config to use it.'))
107 <h2
><?php
echo __('Overview') ?
></h2
>
112 messages_show_html();
115 <a href
="#" id
="show_hidden_messages" style
="display:none"><?php
echo __('Show hidden messages (#MSG_COUNT)') ?
></a
>
117 <fieldset
class="simple"><legend
><?php
echo __('Servers') ?
></legend
>
120 // Display server list
131 <?php
if ($cf->getServerCount() > 0) { ?
>
132 <table cellspacing
="0" class="datatable" style
="table-layout: fixed">
135 <th
><?php
echo __('Name') ?
></th
>
136 <th
><?php
echo __('Authentication type') ?
></th
>
137 <th colspan
="2">DSN
</th
>
139 <?php
foreach ($cf->getServers() as $id => $server) { ?
>
141 <td
><?php
echo $id ?
></td
>
142 <td
><?php
echo htmlspecialchars($cf->getServerName($id)) ?
></td
>
143 <td
><?php
echo htmlspecialchars($cf->getValue("Servers/$id/auth_type")) ?
></td
>
144 <td
><?php
echo htmlspecialchars($cf->getServerDSN($id)) ?
></td
>
145 <td style
="white-space: nowrap">
147 <a href
="<?php echo "?page
=servers
{$separator}mode
=edit
{$separator}id
=$id" ?>"><?php
echo __('Edit') ?
></a
>
148 |
<a href
="<?php echo "?page
=servers
{$separator}mode
=remove
{$separator}id
=$id" ?>"><?php
echo __('Delete') ?
></a
>
158 <i
><?php
echo __('There are no configured servers') ?
></i
>
165 <td
class="lastrow" style
="text-align: left">
166 <input type
="submit" name
="submit" value
="<?php echo __('New server') ?>" />
172 PMA_displayFormBottom();
176 <fieldset
class="simple"><legend
><?php
echo __('Configuration file') ?
></legend
>
179 // Display config file settings and load/save form
181 $form_display = new FormDisplay();
183 PMA_displayFormTop('config.php');
185 <table width
="100%" cellspacing
="0">
188 // Display language list
190 'doc' => $form_display->getDocLink('DefaultLang'),
191 'wiki' => $form_display->getWikiLink('DefaultLang'),
193 'values_escaped' => true);
194 foreach ($all_languages as $each_lang_key => $each_lang) {
195 $lang_name = PMA_langName($each_lang);
196 $opts['values'][$each_lang_key] = $lang_name;
199 'DefaultLang', __('Default language'), 'select',
200 $cf->getValue('DefaultLang'), '', true, $opts
203 // Display server list
205 'doc' => $form_display->getDocLink('ServerDefault'),
206 'wiki' => $form_display->getWikiLink('ServerDefault'),
208 'values_disabled' => array());
209 if ($cf->getServerCount() > 0) {
210 $opts['values']['0'] = __('let the user choose');
211 $opts['values']['-'] = '------------------------------';
212 if ($cf->getServerCount() == 1) {
213 $opts['values_disabled'][] = '0';
215 $opts['values_disabled'][] = '-';
217 foreach ($cf->getServers() as $id => $server) {
218 $opts['values'][(string)$id] = $cf->getServerName($id) . " [$id]";
221 $opts['values']['1'] = __('- none -');
222 $opts['values_escaped'] = true;
225 'ServerDefault', __('Default server'), 'select',
226 $cf->getValue('ServerDefault'), '', true, $opts
232 'unix' => 'UNIX / Linux (\n)',
233 'win' => 'Windows (\r\n)'),
234 'values_escaped' => true);
235 $eol = PMA_ifSetOr($_SESSION['eol'], (PMA_IS_WINDOWS ?
'win' : 'unix'));
237 'eol', __('End of line'), 'select',
238 $eol, '', true, $opts
242 <td colspan
="2" class="lastrow" style
="text-align: left">
243 <input type
="submit" name
="submit_display" value
="<?php echo __('Display') ?>" />
244 <input type
="submit" name
="submit_download" value
="<?php echo __('Download') ?>" />
246 <input type
="submit" name
="submit_save" value
="<?php echo __('Save') ?>"<?php
247 if (!$config_writable) {
248 echo ' disabled="disabled"';
250 <input type
="submit" name
="submit_load" value
="<?php echo __('Load') ?>"<?php
251 if (!$config_exists) {
252 echo ' disabled="disabled"';
254 <input type
="submit" name
="submit_delete" value
="<?php echo __('Delete')
256 if (!$config_exists ||
!$config_writable) {
257 echo ' disabled="disabled"';
260 <input type
="submit" name
="submit_clear" value
="<?php echo __('Clear')
266 PMA_displayFormBottom();
270 <a href
="http://phpmyadmin.net"><?php
echo __('phpMyAdmin homepage') ?
></a
>
271 <a href
="http://sourceforge.net/donate/index.php?group_id=23067"><?php
272 echo __('Donate') ?
></a
>
273 <a href
="?version_check=1<?php
274 echo "{$separator}token
="
275 . $_SESSION[' PMA_token '] ?>"><?php
echo __('Check for latest version') ?
></a
>