2 /* vim: set expandtab sw=4 ts=4 sts=4: */
9 * Gets some core libraries and displays a top message if required
11 require_once 'libraries/common.inc.php';
14 * display Git revision if requested
16 require_once 'libraries/display_git_revision.lib.php';
19 * pass variables to child pages
24 'collation_connection',
28 foreach ($drops as $each_drop) {
29 if (array_key_exists($each_drop, $_GET)) {
30 unset($_GET[$each_drop]);
33 unset($drops, $each_drop);
35 // If we have a valid target, let's load that script instead
36 if (! empty($_REQUEST['target'])
37 && is_string($_REQUEST['target'])
38 && ! preg_match('/^index/', $_REQUEST['target'])
39 && in_array($_REQUEST['target'], $goto_whitelist)
41 include $_REQUEST['target'];
46 * Check if it is an ajax request to reload the recent tables list.
48 require_once 'libraries/RecentTable.class.php';
49 if ($GLOBALS['is_ajax_request'] && ! empty($_REQUEST['recent_table'])) {
50 $response = PMA_Response
::getInstance();
53 PMA_RecentTable
::getInstance()->getHtmlSelectOption()
58 if ($GLOBALS['PMA_Config']->isGitRevision()) {
59 if (isset($_REQUEST['git_revision']) && $GLOBALS['is_ajax_request'] == true) {
60 PMA_printGitRevision();
63 echo '<div id="is_git_revision"></div>';
66 // Handles some variables that may have been sent by the calling script
68 $GLOBALS['table'] = '';
71 // Any message to display?
72 if (! empty($message)) {
73 echo PMA_Util
::getMessage($message);
77 $common_url_query = PMA_generate_common_url('', '');
79 // when $server > 0, a server has been chosen so we can display
80 // all MySQL-related information
82 include 'libraries/server_common.inc.php';
83 include 'libraries/StorageEngine.class.php';
85 // Use the verbose name of the server instead of the hostname
88 if (! empty($cfg['Server']['verbose'])) {
89 $server_info .= htmlspecialchars($cfg['Server']['verbose']);
90 if ($GLOBALS['cfg']['ShowServerInfo']) {
94 if ($GLOBALS['cfg']['ShowServerInfo'] ||
empty($cfg['Server']['verbose'])) {
95 $server_info .= PMA_DBI_get_host_info();
97 if (! empty($cfg['Server']['verbose']) && $GLOBALS['cfg']['ShowServerInfo']) {
100 $mysql_cur_user_and_host = PMA_DBI_fetch_value('SELECT USER();');
102 // should we add the port info here?
103 $short_server_info = (!empty($GLOBALS['cfg']['Server']['verbose'])
104 ?
$GLOBALS['cfg']['Server']['verbose']
105 : $GLOBALS['cfg']['Server']['host']);
108 echo '<div id="maincontainer">' . "\n";
109 echo '<div id="main_pane_left">';
111 ||
(! $cfg['NavigationDisplayServers'] && count($cfg['Servers']) > 1)
113 echo '<div class="group">';
114 echo '<h2>' . __('General Settings') . '</h2>';
118 * Displays the MySQL servers choice form
120 if (! $cfg['NavigationDisplayServers']
121 && (count($cfg['Servers']) > 1 ||
$server == 0 && count($cfg['Servers']) == 1)
123 echo '<li id="li_select_server">';
124 include_once 'libraries/select_server.lib.php';
125 echo PMA_selectServer(true, true);
130 * Displays the mysql server related links
132 if ($server > 0 && ! PMA_DRIZZLE
) {
133 include_once 'libraries/check_user_privileges.lib.php';
135 // Logout for advanced authentication
136 if ($cfg['Server']['auth_type'] != 'config') {
137 if ($cfg['ShowChgPassword']) {
138 $conditional_class = 'ajax';
140 __('Change password'),
141 'li_change_password',
142 'user_password.php?' . $common_url_query,
145 'change_password_anchor',
151 echo ' <li id="li_select_mysql_collation">';
152 echo ' <form method="post" action="index.php">' . "\n"
153 . PMA_generate_common_hidden_inputs(null, null, 4, 'collation_connection')
154 . ' <label for="select_collation_connection">' . "\n"
155 . ' ' . __('Server connection collation') . "\n"
156 // put the doc link in the form so that it appears on the same line
157 . PMA_Util
::showMySQLDocu(
158 'MySQL_Database_Administration',
164 . PMA_generateCharsetDropdownBox(
165 PMA_CSDROPDOWN_COLLATION
,
166 'collation_connection',
167 'select_collation_connection',
168 $collation_connection,
175 } // end of if ($server > 0 && !PMA_DRIZZLE)
180 echo '<div class="group">';
181 echo '<h2>' . __('Appearance Settings') . '</h2>';
184 // Displays language selection combo
185 if (empty($cfg['Lang']) && count($GLOBALS['available_languages']) > 1) {
186 echo '<li id="li_select_lang">';
187 include_once 'libraries/display_select_lang.lib.php';
188 echo PMA_getLanguageSelectorHtml();
192 // ThemeManager if available
194 if ($GLOBALS['cfg']['ThemeManager']) {
195 echo '<li id="li_select_theme">';
196 echo $_SESSION['PMA_Theme_Manager']->getHtmlSelectBox();
199 echo '<li id="li_select_fontsize">';
200 echo PMA_Config
::getFontsizeForm();
209 echo PMA_printListItem(
211 'li_user_preferences',
212 'prefs_manage.php?' . $common_url_query
221 echo '<div id="main_pane_right">';
224 if ($server > 0 && $GLOBALS['cfg']['ShowServerInfo']) {
226 echo '<div class="group">';
227 echo '<h2>' . __('Database server') . '</h2>';
230 __('Server') . ': ' . $server_info,
234 __('Server type') . ': ' . PMA_Util
::getServerType(),
238 __('Server version') . ': ' . PMA_MYSQL_STR_VERSION
. ' - ' . PMA_MYSQL_VERSION_COMMENT
,
242 __('Protocol version') . ': ' . PMA_DBI_get_proto_info(),
246 __('User') . ': ' . htmlspecialchars($mysql_cur_user_and_host),
250 echo ' <li id="li_select_mysql_charset">';
251 echo ' ' . __('Server charset') . ': '
252 . ' <span lang="en" dir="ltr">'
253 . ' ' . $mysql_charsets_descriptions[$mysql_charset_map['utf-8']] . "\n"
254 . ' (' . $mysql_charset_map['utf-8'] . ')' . "\n"
261 if ($GLOBALS['cfg']['ShowServerInfo'] ||
$GLOBALS['cfg']['ShowPhpInfo']) {
262 echo '<div class="group">';
263 echo '<h2>' . __('Web server') . '</h2>';
265 if ($GLOBALS['cfg']['ShowServerInfo']) {
266 PMA_printListItem($_SERVER['SERVER_SOFTWARE'], 'li_web_server_software');
269 $client_version_str = PMA_DBI_get_client_info();
270 if (preg_match('#\d+\.\d+\.\d+#', $client_version_str)
271 && in_array($GLOBALS['cfg']['Server']['extension'], array('mysql', 'mysqli'))
273 $client_version_str = 'libmysql - ' . $client_version_str;
276 __('Database client version') . ': ' . $client_version_str,
277 'li_mysql_client_version'
280 $php_ext_string = __('PHP extension') . ': '
281 . $GLOBALS['cfg']['Server']['extension'] . ' '
282 . PMA_Util
::showPHPDocu(
283 'book.' . $GLOBALS['cfg']['Server']['extension'] . '.php'
287 'li_used_php_extension'
292 if ($cfg['ShowPhpInfo']) {
294 __('Show PHP information'),
296 'phpinfo.php?' . $common_url_query,
305 echo '<div class="group pmagroup">';
306 echo '<h2>phpMyAdmin</h2>';
309 // We rely on CSP to allow access to http://www.phpmyadmin.net, but IE lacks
310 // support here and does not allow request to http once using https.
311 if ($GLOBALS['cfg']['VersionCheck']
312 && (! $GLOBALS['PMA_Config']->get('is_https') || PMA_USR_BROWSER_AGENT
!= 'IE')
314 $class = 'jsversioncheck';
317 __('Version information') . ': ' . PMA_VERSION
,
328 PMA_Util
::getDocuLink('index'),
335 PMA_linkURL('http://wiki.phpmyadmin.net/'),
340 // does not work if no target specified, don't know why
342 __('Official Homepage'),
344 PMA_linkURL('http://www.phpMyAdmin.net/'),
351 PMA_linkURL('http://www.phpmyadmin.net/home_page/improve.php'),
358 PMA_linkURL('http://www.phpmyadmin.net/home_page/support.php'),
363 __('List of changes'),
365 PMA_linkURL('changelog.php'),
379 * Warning if using the default MySQL privileged account
382 && $cfg['Server']['user'] == 'root'
383 && $cfg['Server']['password'] == ''
386 __('Your configuration file contains settings (root with no password) that correspond to the default MySQL privileged account. Your MySQL server is running with this default, is open to intrusion, and you really should fix this security hole by setting a password for user \'root\'.'),
392 * Nijel: As we try to handle charsets by ourself, mbstring overloads just
393 * break it, see bug 1063821.
395 if (@extension_loaded
('mbstring') && @ini_get
('mbstring.func_overload') > 1) {
397 __('You have enabled mbstring.func_overload in your PHP configuration. This option is incompatible with phpMyAdmin and might cause some data to be corrupted!'),
403 * Nijel: mbstring is used for handling multibyte inside parser, so it is good
404 * to tell user something might be broken without it, see bug #1063149.
406 if (! @extension_loaded
('mbstring')) {
408 __('The mbstring PHP extension was not found and you seem to be using a multibyte charset. Without the mbstring extension phpMyAdmin is unable to split strings correctly and it may result in unexpected results.'),
414 * Check whether session.gc_maxlifetime limits session validity.
416 $gc_time = (int)@ini_get
('session.gc_maxlifetime');
417 if ($gc_time < $GLOBALS['cfg']['LoginCookieValidity'] ) {
419 __('Your PHP parameter [a@http://php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime@_blank]session.gc_maxlifetime[/a] is lower than cookie validity configured in phpMyAdmin, because of this, your login will expire sooner than configured in phpMyAdmin.'),
425 * Check whether LoginCookieValidity is limited by LoginCookieStore.
427 if ($GLOBALS['cfg']['LoginCookieStore'] != 0
428 && $GLOBALS['cfg']['LoginCookieStore'] < $GLOBALS['cfg']['LoginCookieValidity']
431 __('Login cookie store is lower than cookie validity configured in phpMyAdmin, because of this, your login will expire sooner than configured in phpMyAdmin.'),
437 * Check if user does not have defined blowfish secret and it is being used.
439 if (! empty($_SESSION['auto_blowfish_secret'])
440 && empty($GLOBALS['cfg']['blowfish_secret'])
443 __('The configuration file now needs a secret passphrase (blowfish_secret).'),
449 * Check for existence of config directory which should not exist in
450 * production environment.
452 if (file_exists('config')) {
454 __('Directory [code]config[/code], which is used by the setup script, still exists in your phpMyAdmin directory. You should remove it once phpMyAdmin has been configured.'),
460 $cfgRelation = PMA_getRelationsParam();
461 if (! $cfgRelation['allworks']
462 && $cfg['PmaNoRelation_DisableWarning'] == false
464 $msg = PMA_Message
::notice(__('The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. To find out why click %shere%s.'));
466 '<a href="' . $cfg['PmaAbsoluteUri'] . 'chk_rel.php?' . $common_url_query . '">',
469 $msg->addParam('</a>', false);
470 /* Show error if user has configured something, notice elsewhere */
471 if (!empty($cfg['Servers'][$server]['pmadb'])) {
479 * Warning about different MySQL library and server version
480 * (a difference on the third digit does not count).
481 * If someday there is a constant that we can check about mysqlnd,
482 * we can use it instead of strpos().
483 * If no default server is set, PMA_DBI_get_client_info() is not defined yet.
484 * Drizzle can speak MySQL protocol, so don't warn about version mismatch for
487 if (function_exists('PMA_DBI_get_client_info') && !PMA_DRIZZLE
) {
488 $_client_info = PMA_DBI_get_client_info();
490 && strpos($_client_info, 'mysqlnd') === false
491 && substr(PMA_MYSQL_CLIENT_API
, 0, 3) != substr(PMA_MYSQL_INT_VERSION
, 0, 3)
496 __('Your PHP MySQL library version %s differs from your MySQL server version %s. This may cause unpredictable behavior.'),
499 PMA_MYSQL_STR_VERSION
,
501 strpos(PMA_MYSQL_STR_VERSION
. '-', '-')
508 unset($_client_info);
512 * Warning about Suhosin
514 if ($cfg['SuhosinDisableWarning'] == false
515 && @ini_get
('suhosin.request.max_value_length')
519 __('Server running with Suhosin. Please refer to %sdocumentation%s for possible issues.'),
528 * Warning about mcrypt.
530 if (! function_exists('mcrypt_encrypt')
531 && ! $GLOBALS['cfg']['McryptDisableWarning']
533 PMA_warnMissingExtension('mcrypt');
537 * Warning about incomplete translations.
539 * The data file is created while creating release by ./scripts/remove-incomplete-mo
541 if (file_exists('libraries/language_stats.inc.php')) {
542 include 'libraries/language_stats.inc.php';
544 * This message is intentionally not translated, because we're
545 * handling incomplete translations here and focus on english
548 if (isset($GLOBALS['language_stats'][$lang])
549 && $GLOBALS['language_stats'][$lang] < $cfg['TranslationWarningThreshold']
552 'You are using an incomplete translation, please help to make it better by <a href="http://www.phpmyadmin.net/home_page/improve.php#translate" target="_blank">contributing</a>.',
559 * prints list item for main page
561 * @param string $name displayed text
562 * @param string $id id, used for css styles
563 * @param string $url make item as link with $url as target
564 * @param string $mysql_help_page display a link to MySQL's manual
565 * @param string $target special target for $url
566 * @param string $a_id id for the anchor,
567 * used for jQuery to hook in functions
568 * @param string $class class for the li element
569 * @param string $a_class class for the anchor element
573 function PMA_printListItem($name, $id = null, $url = null, $mysql_help_page = null,
574 $target = null, $a_id = null, $class = null, $a_class = null
576 echo '<li id="' . $id . '"';
577 if (null !== $class) {
578 echo ' class="' . $class . '"';
582 echo '<a href="' . $url . '"';
583 if (null !== $target) {
584 echo ' target="' . $target . '"';
587 echo ' id="' . $a_id .'"';
589 if (null != $a_class) {
590 echo ' class="' . $a_class .'"';
600 if (null !== $mysql_help_page) {
601 echo PMA_Util
::showMySQLDocu('', $mysql_help_page);