5 * @package phpMyAdmin-setup
6 * @author Piotr Przybylski <piotrprz@gmail.com>
7 * @license http://www.gnu.org/licenses/gpl.html GNU GPL 2.0
11 if (!defined('PHPMYADMIN')) {
18 require_once './libraries/display_select_lang.lib.php';
19 require_once './setup/lib/FormDisplay.class.php';
20 require_once './setup/lib/index.lib.php';
22 // prepare unfiltered language list
23 $all_languages = PMA_langList();
24 uasort($all_languages, 'PMA_language_cmp');
26 $cf = ConfigFile
::getInstance();
27 $separator = PMA_get_arg_separator('html');
33 // Check phpMyAdmin version
35 if (isset($_GET['version_check'])) {
40 // Perform various security, compatibility and consistency checks
42 perform_config_checks();
45 // Check whether we can read/write configuration
47 $config_readable = false;
48 $config_writable = false;
49 $config_exists = false;
50 check_config_rw($config_readable, $config_writable, $config_exists);
51 if (!$config_writable ||
!$config_readable) {
52 messages_set('error', 'config_rw', 'CannotLoadConfig', PMA_lang('CannotLoadConfigMsg'));
55 // Check https connection
57 $is_https = !empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on';
59 $text = $GLOBALS['strSetupInsecureConnectionMsg1'];
60 if (!empty($_SERVER['REQUEST_URI']) && !empty($_SERVER['HTTP_HOST'])) {
61 $text .= ' ' . PMA_lang('InsecureConnectionMsg2',
62 'https://' . htmlspecialchars($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']));
64 messages_set('warning', 'no_https', 'InsecureConnection', $text);
68 <form id
="select_lang" method
="post" action
="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']) ?>">
69 <?php
echo PMA_generate_common_hidden_inputs() ?
>
70 <bdo xml
:lang
="en" dir
="ltr"><label
for="lang">
71 <?php
echo $GLOBALS['strLanguage'] . ($GLOBALS['strLanguage'] != 'Language' ?
' - Language' : '') ?
>
73 <select id
="lang" name
="lang" onchange
="this.form.submit();" xml
:lang
="en" dir
="ltr">
75 // create language list
77 foreach ($all_languages as $each_lang_key => $each_lang) {
78 if (!file_exists($GLOBALS['lang_path'] . $each_lang[1] . '.inc.php')) {
82 $lang_name = ucfirst(substr(strrchr($each_lang[0], '|'), 1));
83 // Include native name if non empty
84 if (!empty($each_lang[3])) {
85 $lang_name = $each_lang[3] . ' - ' . $lang_name;
88 //Is current one active?
89 $selected = ($GLOBALS['lang'] == $each_lang_key) ?
' selected="selected"' : '';
90 echo '<option value="' . $each_lang_key . '"' . $selected . '>' . $lang_name
97 <h2
><?php
echo $GLOBALS['strSetupOverview'] ?
></h2
>
102 messages_show_html();
105 <a href
="#" id
="show_hidden_messages" style
="display:none"><?php
echo $GLOBALS['strSetupShowHiddenMessages'] ?
></a
>
107 <h3
><?php
echo $GLOBALS['strServers'] ?
></h3
>
110 // Display server list
112 display_form_top('index.php', 'get', array(
118 <?php
if ($cf->getServerCount() > 0): ?
>
119 <table cellspacing
="0" class="datatable" style
="table-layout: fixed">
122 <th
><?php
echo $GLOBALS['strName'] ?
></th
>
123 <th
>Authentication type
</th
>
124 <th colspan
="2">DSN
</th
>
126 <?php
foreach ($_SESSION['ConfigFile']['Servers'] as $id => $server): ?
>
128 <td
><?php
echo $id ?
></td
>
129 <td
><?php
echo $cf->getServerName($id) ?
></td
>
130 <td
><?php
echo htmlspecialchars($cf->getValue("Servers/$id/auth_type")) ?
></td
>
131 <td
><?php
echo htmlspecialchars($cf->getServerDSN($id)) ?
></td
>
132 <td style
="white-space: nowrap">
134 <a href
="<?php echo "?page
=servers
{$separator}mode
=edit
{$separator}id
=$id" ?>"><?php
echo $GLOBALS['strEdit'] ?
></a
>
135 |
<a href
="<?php echo "?page
=servers
{$separator}mode
=remove
{$separator}id
=$id" ?>"><?php
echo $GLOBALS['strDelete'] ?
></a
>
145 <i
><?php
echo $GLOBALS['strSetupNoServers'] ?
></i
>
152 <td
class="lastrow" style
="text-align: left">
153 <input type
="submit" name
="submit" value
="<?php echo $GLOBALS['strSetupNewServer'] ?>" />
159 display_form_bottom();
162 <h3
><?php
echo $GLOBALS['strSetupConfigurationFile'] ?
></h3
>
165 // Display config file settings and load/save form
167 $form_display = new FormDisplay();
169 display_form_top('config.php');
170 display_fieldset_top('', '', null, array('class' => 'simple'));
172 // Display language list
174 'doc' => $form_display->getDocLink('DefaultLang'),
175 'wiki' => $form_display->getWikiLink('DefaultLang'),
177 'values_escaped' => true);
178 foreach ($all_languages as $each_lang_key => $each_lang) {
179 if (!file_exists($GLOBALS['lang_path'] . $each_lang[1] . '.inc.php')) {
182 $lang_name = ucfirst(substr(strrchr($each_lang[0], '|'), 1));
183 // Include native name if non empty
184 if (!empty($each_lang[3])) {
185 $lang_name = $each_lang[3] . ' - ' . $lang_name;
187 $opts['values'][$each_lang_key] = $lang_name;
189 display_input('DefaultLang', $GLOBALS['strSetupDefaultLanguage'], '', 'select',
190 $cf->getValue('DefaultLang'), true, $opts);
192 // Display server list
194 'doc' => $form_display->getDocLink('ServerDefault'),
195 'wiki' => $form_display->getWikiLink('ServerDefault'),
197 'values_disabled' => array());
198 if ($cf->getServerCount() > 0) {
199 $opts['values']['0'] = $GLOBALS['strSetupLetUserChoose'];
200 $opts['values']['-'] = '------------------------------';
201 if ($cf->getServerCount() == 1) {
202 $opts['values_disabled'][] = '0';
204 $opts['values_disabled'][] = '-';
206 foreach ($_SESSION['ConfigFile']['Servers'] as $id => $server) {
207 $opts['values'][(string)$id] = $cf->getServerName($id) . " [$id]";
210 $opts['values']['1'] = $GLOBALS['strSetupOptionNone'];
211 $opts['values_escaped'] = true;
213 display_input('ServerDefault', $GLOBALS['strSetupDefaultServer'], '', 'select',
214 $cf->getValue('ServerDefault'), true, $opts);
219 'unix' => 'UNIX / Linux (\n)',
220 'win' => 'Windows (\r\n)'),
221 'values_escaped' => true);
222 $eol = PMA_ifSetOr($_SESSION['eol'], (PMA_IS_WINDOWS ?
'win' : 'unix'));
223 display_input('eol', $GLOBALS['strSetupEndOfLine'], '', 'select',
227 <td colspan
="2" class="lastrow" style
="text-align: left">
228 <input type
="submit" name
="submit_display" value
="<?php echo $GLOBALS['strSetupDisplay'] ?>" />
229 <input type
="submit" name
="submit_download" value
="<?php echo $GLOBALS['strSetupDownload'] ?>" />
231 <input type
="submit" name
="submit_save" value
="<?php echo $GLOBALS['strSave'] ?>"<?php
if (!$config_writable) echo ' disabled="disabled"' ?
> />
232 <input type
="submit" name
="submit_load" value
="<?php echo $GLOBALS['strSetupLoad'] ?>"<?php
if (!$config_exists) echo ' disabled="disabled"' ?
> />
233 <input type
="submit" name
="submit_delete" value
="<?php echo $GLOBALS['strDelete'] ?>"<?php
if (!$config_exists ||
!$config_writable) echo ' disabled="disabled"' ?
> />
235 <input type
="submit" name
="submit_clear" value
="<?php echo $GLOBALS['strSetupClear'] ?>" class="red" />
239 display_fieldset_bottom_simple();
240 display_form_bottom();
243 <a href
="http://phpmyadmin.net"><?php
echo $GLOBALS['strSetupHomepageLink'] ?
></a
>
244 <a href
="http://sourceforge.net/donate/index.php?group_id=23067"><?php
echo $GLOBALS['strSetupDonateLink'] ?
></a
>
245 <a href
="?version_check=1<?php echo "{$separator}token
=" . $_SESSION[' PMA_token '] ?>"><?php
echo $GLOBALS['strSetupVersionCheckLink'] ?
></a
>