Permalink
Browse files

Dropped main.php

  • Loading branch information...
1 parent 69b81e8 commit 9e3a9ee52f888812e7a2829d132eebe95051c590 @roccivic roccivic committed Jun 23, 2012
View
4 db_create.php
@@ -34,7 +34,7 @@
/**
* Defines the url to return to in case of error in a sql statement
*/
-$err_url = 'main.php?' . PMA_generate_common_url();
+$err_url = 'index.php?' . PMA_generate_common_url();
/**
* Builds and executes the db creation sql query
@@ -68,7 +68,7 @@
$response->isSuccess(false);
$response->addJSON('message', $message);
} else {
- include_once 'main.php';
+ include_once 'index.php';
}
} else {
$message = PMA_Message::success(__('Database %1$s has been created.'));
View
2 examples/openid.php
@@ -150,7 +150,7 @@ function show_page($contents)
$_SESSION['PMA_single_signon_password'] = $AUTH_MAP[$id]['password'];
session_write_close();
/* Redirect to phpMyAdmin (should use absolute URL here!) */
- header('Location: ../main.php');
+ header('Location: ../index.php');
} else {
show_page('<p>User not allowed!</p>');
exit;
View
2 examples/signon.php
@@ -31,7 +31,7 @@
/* Close that session */
session_write_close();
/* Redirect to phpMyAdmin (should use absolute URL here!) */
- header('Location: ../main.php');
+ header('Location: ../index.php');
} else {
/* Show simple form */
header('Content-Type: text/html; charset=utf-8');
View
703 index.php
@@ -1,178 +1,601 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
- * Creates frameset
*
* @package PhpMyAdmin
*/
/**
- * Gets core libraries and defines some variables
+ * Gets some core libraries and displays a top message if required
*/
require_once 'libraries/common.inc.php';
-// free the session file, for the other frames to be loaded
-session_write_close();
-
-// Gets the host name
-if (empty($HTTP_HOST)) {
- $HTTP_HOST = '';
- if (PMA_getenv('HTTP_HOST')) {
- $HTTP_HOST = PMA_getenv('HTTP_HOST');
- }
-}
-
-
-// purge querywindow history
-$cfgRelation = PMA_getRelationsParam();
-if ($GLOBALS['cfg']['QueryHistoryDB'] && $cfgRelation['historywork']) {
- PMA_purgeHistory($GLOBALS['cfg']['Server']['user']);
-}
-unset($cfgRelation);
-
+/**
+ * display Git revision if requested
+ */
+require_once 'libraries/display_git_revision.lib.php';
/**
* pass variables to child pages
*/
-$drops = array('lang', 'server', 'collation_connection',
- 'db', 'table');
-
+$drops = array(
+ 'lang',
+ 'server',
+ 'collation_connection',
+ 'db',
+ 'table'
+);
foreach ($drops as $each_drop) {
if (array_key_exists($each_drop, $_GET)) {
unset($_GET[$each_drop]);
}
}
unset($drops, $each_drop);
-if (! strlen($GLOBALS['db'])) {
- $main_target = $GLOBALS['cfg']['DefaultTabServer'];
-} elseif (! strlen($GLOBALS['table'])) {
- $_GET['db'] = $GLOBALS['db'];
- $main_target = $GLOBALS['cfg']['DefaultTabDatabase'];
-} else {
- $_GET['db'] = $GLOBALS['db'];
- $_GET['table'] = $GLOBALS['table'];
- $main_target = ! empty($GLOBALS['goto'])
- ? $GLOBALS['goto']
- : $GLOBALS['cfg']['DefaultTabTable'];
-}
-
-$url_query = PMA_generate_common_url($_GET);
-
+// If we have a valid a valid target, lets load that script instead
if (! empty($_REQUEST['target'])
&& is_string($_REQUEST['target'])
&& in_array($_REQUEST['target'], $goto_whitelist)
) {
- $main_target = $_REQUEST['target'];
+ include $_REQUEST['target'];
}
-$main_target .= $url_query;
-$lang_iso_code = $GLOBALS['available_languages'][$GLOBALS['lang']][1];
+if ($GLOBALS['PMA_Config']->isGitRevision()) {
+ if (isset($_REQUEST['git_revision']) && $GLOBALS['is_ajax_request'] == true) {
+ PMA_printGitRevision();
+ exit;
+ }
+ echo '<div id="is_git_revision"></div>';
+}
+
+// Handles some variables that may have been sent by the calling script
+$GLOBALS['db'] = '';
+$GLOBALS['table'] = '';
+$show_query = '1';
+// Any message to display?
+if (! empty($message)) {
+ echo PMA_Util::getMessage($message);
+ unset($message);
+}
-// start output
-$response = PMA_Response::getInstance();
-$header = $response->getHeader();
-$header->sendHttpHeaders();
-$response->disable();
+$common_url_query = PMA_generate_common_url('', '');
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xml:lang="<?php echo $lang_iso_code; ?>"
- lang="<?php echo $lang_iso_code; ?>"
- dir="<?php echo $GLOBALS['text_dir']; ?>">
-<head>
-<link rel="icon" href="favicon.ico" type="image/x-icon" />
-<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
-<title>phpMyAdmin <?php echo PMA_VERSION; ?> -
- <?php echo htmlspecialchars($HTTP_HOST); ?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="robots" content="noindex,nofollow" />
-<script type="text/javascript">
-// <![CDATA[
- // definitions used in common.js
- var common_query = '<?php echo PMA_escapeJsString(PMA_generate_common_url('', '', '&'));?>';
- var opendb_url = '<?php echo PMA_escapeJsString($GLOBALS['cfg']['DefaultTabDatabase']); ?>';
- var safari_browser = <?php echo PMA_USR_BROWSER_AGENT == 'SAFARI' ? 'true' : 'false' ?>;
- var querywindow_height = <?php echo PMA_escapeJsString($GLOBALS['cfg']['QueryWindowHeight']); ?>;
- var querywindow_width = <?php echo PMA_escapeJsString($GLOBALS['cfg']['QueryWindowWidth']); ?>;
- var collation_connection = '<?php echo PMA_escapeJsString($GLOBALS['collation_connection']); ?>';
- var lang = '<?php echo PMA_escapeJsString($GLOBALS['lang']); ?>';
- var server = '<?php echo PMA_escapeJsString($GLOBALS['server']); ?>';
- var table = '<?php echo PMA_escapeJsString($GLOBALS['table']); ?>';
- var db = '<?php echo PMA_escapeJsString($GLOBALS['db']); ?>';
- var token = '<?php echo PMA_escapeJsString($_SESSION[' PMA_token ']); ?>';
- var text_dir = '<?php echo PMA_escapeJsString($GLOBALS['text_dir']); ?>';
- var pma_absolute_uri = '<?php echo PMA_escapeJsString($GLOBALS['cfg']['PmaAbsoluteUri']); ?>';
- var pma_text_default_tab = '<?php echo PMA_escapeJsString(PMA_Util::getTitleForTarget($GLOBALS['cfg']['DefaultTabTable'])); ?>';
- var pma_text_left_default_tab = '<?php echo PMA_escapeJsString(PMA_Util::getTitleForTarget($GLOBALS['cfg']['LeftDefaultTabTable'])); ?>';
-
- // for content and navigation frames
-
- var frame_content = 0;
- var frame_navigation = 0;
- function getFrames()
- {
-<?php if ($GLOBALS['text_dir'] === 'ltr') { ?>
- frame_content = window.frames[1];
- frame_navigation = window.frames[0];
-<?php } else { ?>
- frame_content = window.frames[0];
- frame_navigation = window.frames[1];
-<?php } ?>
+// when $server > 0, a server has been chosen so we can display
+// all MySQL-related information
+if ($server > 0) {
+ include 'libraries/server_common.inc.php';
+ include 'libraries/StorageEngine.class.php';
+
+ // Use the verbose name of the server instead of the hostname
+ // if a value is set
+ $server_info = '';
+ if (! empty($cfg['Server']['verbose'])) {
+ $server_info .= htmlspecialchars($cfg['Server']['verbose']);
+ if ($GLOBALS['cfg']['ShowServerInfo']) {
+ $server_info .= ' (';
+ }
+ }
+ if ($GLOBALS['cfg']['ShowServerInfo'] || empty($cfg['Server']['verbose'])) {
+ $server_info .= PMA_DBI_get_host_info();
}
- var onloadCnt = 0;
- var onLoadHandler = window.onload;
- window.onload = function() {
- if (onloadCnt == 0) {
- if (typeof(onLoadHandler) == "function") {
- onLoadHandler();
+ if (! empty($cfg['Server']['verbose']) && $GLOBALS['cfg']['ShowServerInfo']) {
+ $server_info .= ')';
+ }
+ $mysql_cur_user_and_host = PMA_DBI_fetch_value('SELECT USER();');
+
+ // should we add the port info here?
+ $short_server_info = (!empty($GLOBALS['cfg']['Server']['verbose'])
+ ? $GLOBALS['cfg']['Server']['verbose']
+ : $GLOBALS['cfg']['Server']['host']);
+}
+
+echo '<div id="maincontainer">' . "\n";
+echo '<div id="main_pane_left">';
+if ($server > 0
+ || (! $cfg['LeftDisplayServers'] && count($cfg['Servers']) > 1)
+) {
+ echo '<div class="group">';
+ echo '<h2>' . __('General Settings') . '</h2>';
+ echo '<ul>';
+
+ /**
+ * Displays the MySQL servers choice form
+ */
+ if (! $cfg['LeftDisplayServers']
+ && (count($cfg['Servers']) > 1 || $server == 0 && count($cfg['Servers']) == 1)
+ ) {
+ echo '<li id="li_select_server">';
+ include_once 'libraries/select_server.lib.php';
+ PMA_selectServer(true, true);
+ echo '</li>';
+ }
+
+ /**
+ * Displays the mysql server related links
+ */
+ if ($server > 0 && ! PMA_DRIZZLE) {
+ include_once 'libraries/check_user_privileges.lib.php';
+
+ // Logout for advanced authentication
+ if ($cfg['Server']['auth_type'] != 'config') {
+ if ($cfg['ShowChgPassword']) {
+ if ($GLOBALS['cfg']['AjaxEnable']) {
+ $conditional_class = 'ajax';
+ } else {
+ $conditional_class = null;
+ }
+ PMA_printListItem(
+ __('Change password'),
+ 'li_change_password',
+ 'user_password.php?' . $common_url_query,
+ null,
+ null,
+ 'change_password_anchor',
+ null,
+ $conditional_class
+ );
}
- if (typeof(getFrames) != 'undefined' && typeof(getFrames) == 'function') {
- getFrames();
+ } // end if
+ echo ' <li id="li_select_mysql_collation">';
+ echo ' <form method="post" action="index.php" target="_parent">' . "\n"
+ . PMA_generate_common_hidden_inputs(null, null, 4, 'collation_connection')
+ . ' <label for="select_collation_connection">' . "\n"
+ . ' ' . __('Server connection collation') . "\n"
+ // put the doc link in the form so that it appears on the same line
+ . PMA_Util::showMySQLDocu(
+ 'MySQL_Database_Administration',
+ 'Charset-connection'
+ )
+ . ': ' . "\n"
+ . ' </label>' . "\n"
+
+ . PMA_generateCharsetDropdownBox(
+ PMA_CSDROPDOWN_COLLATION,
+ 'collation_connection',
+ 'select_collation_connection',
+ $collation_connection,
+ true,
+ 4,
+ true
+ )
+ . ' </form>' . "\n"
+ . ' </li>' . "\n";
+ } // end of if ($server > 0 && !PMA_DRIZZLE)
+ echo '</ul>';
+ echo '</div>';
+}
+
+echo '<div class="group">';
+echo '<h2>' . __('Appearance Settings') . '</h2>';
+echo ' <ul>';
+
+// Displays language selection combo
+if (empty($cfg['Lang']) && count($GLOBALS['available_languages']) > 1) {
+ echo '<li id="li_select_lang">';
+ include_once 'libraries/display_select_lang.lib.php';
+ PMA_Language_select();
+ echo '</li>';
+}
+
+// ThemeManager if available
+
+if ($GLOBALS['cfg']['ThemeManager']) {
+ echo '<li id="li_select_theme">';
+ echo $_SESSION['PMA_Theme_Manager']->getHtmlSelectBox();
+ echo '</li>';
+}
+echo '<li id="li_select_fontsize">';
+echo PMA_Config::getFontsizeForm();
+echo '</li>';
+
+echo '</ul>';
+
+// User preferences
+
+if ($server > 0) {
+ echo '<ul>';
+ echo PMA_printListItem(
+ __('More settings'),
+ 'li_user_preferences',
+ 'prefs_manage.php?' . $common_url_query
+ );
+ echo '</ul>';
+}
+
+echo '</div>';
+
+
+echo '</div>';
+echo '<div id="main_pane_right">';
+
+
+if ($server > 0 && $GLOBALS['cfg']['ShowServerInfo']) {
+
+ echo '<div class="group">';
+ echo '<h2>' . __('Database server') . '</h2>';
+ echo '<ul>' . "\n";
+ PMA_printListItem(
+ __('Server') . ': ' . $server_info,
+ 'li_server_info'
+ );
+ PMA_printListItem(
+ __('Software') . ': ' . PMA_Util::getServerType(),
+ 'li_server_type'
+ );
+ PMA_printListItem(
+ __('Software version') . ': ' . PMA_MYSQL_STR_VERSION . ' - ' . PMA_MYSQL_VERSION_COMMENT,
+ 'li_server_version'
+ );
+ PMA_printListItem(
+ __('Protocol version') . ': ' . PMA_DBI_get_proto_info(),
+ 'li_mysql_proto'
+ );
+ PMA_printListItem(
+ __('User') . ': ' . htmlspecialchars($mysql_cur_user_and_host),
+ 'li_user_info'
+ );
+
+ echo ' <li id="li_select_mysql_charset">';
+ echo ' ' . __('Server charset') . ': '
+ . ' <span lang="en" dir="ltr">'
+ . ' ' . $mysql_charsets_descriptions[$mysql_charset_map['utf-8']] . "\n"
+ . ' (' . $mysql_charset_map['utf-8'] . ')' . "\n"
+ . ' </span>' . "\n"
+ . ' </li>' . "\n";
+ echo ' </ul>';
+ echo ' </div>';
+}
+
+if ($GLOBALS['cfg']['ShowServerInfo'] || $GLOBALS['cfg']['ShowPhpInfo']) {
+ echo '<div class="group">';
+ echo '<h2>' . __('Web server') . '</h2>';
+ echo '<ul>';
+ if ($GLOBALS['cfg']['ShowServerInfo']) {
+ PMA_printListItem($_SERVER['SERVER_SOFTWARE'], 'li_web_server_software');
+
+ if ($server > 0) {
+ $client_version_str = PMA_DBI_get_client_info();
+ if (preg_match('#\d+\.\d+\.\d+#', $client_version_str)
+ && in_array($GLOBALS['cfg']['Server']['extension'], array('mysql', 'mysqli'))
+ ) {
+ $client_version_str = 'libmysql - ' . $client_version_str;
}
- onloadCnt++;
+ PMA_printListItem(
+ __('Database client version') . ': ' . $client_version_str,
+ 'li_mysql_client_version'
+ );
+
+ $php_ext_string = __('PHP extension') . ': '
+ . $GLOBALS['cfg']['Server']['extension'] . ' '
+ . PMA_Util::showPHPDocu(
+ 'book.' . $GLOBALS['cfg']['Server']['extension'] . '.php'
+ );
+ PMA_printListItem(
+ $php_ext_string,
+ 'li_used_php_extension'
+ );
}
- };
-// ]]>
-</script>
+ }
+
+ if ($cfg['ShowPhpInfo']) {
+ PMA_printListItem(
+ __('Show PHP information'),
+ 'li_phpinfo',
+ 'phpinfo.php?' . $common_url_query
+ );
+ }
+ echo ' </ul>';
+ echo ' </div>';
+}
+
+echo '<div class="group pmagroup">';
+echo '<h2>phpMyAdmin</h2>';
+echo '<ul>';
+$class = null;
+// We rely on CSP to allow access to http://www.phpmyadmin.net, but IE lacks
+// support here and does not allow request to http once using https.
+if ($GLOBALS['cfg']['VersionCheck']
+ && (! $GLOBALS['PMA_Config']->get('is_https') || PMA_USR_BROWSER_AGENT != 'IE')
+) {
+ $class = 'jsversioncheck';
+}
+PMA_printListItem(
+ __('Version information') . ': ' . PMA_VERSION,
+ 'li_pma_version',
+ null,
+ null,
+ null,
+ null,
+ $class
+);
+PMA_printListItem(
+ __('Documentation'),
+ 'li_pma_docs',
+ 'Documentation.html',
+ null,
+ '_blank'
+);
+PMA_printListItem(
+ __('Wiki'),
+ 'li_pma_wiki',
+ PMA_linkURL('http://wiki.phpmyadmin.net/'),
+ null,
+ '_blank'
+);
+
+// does not work if no target specified, don't know why
+PMA_printListItem(
+ __('Official Homepage'),
+ 'li_pma_homepage',
+ PMA_linkURL('http://www.phpMyAdmin.net/'),
+ null,
+ '_blank'
+);
+PMA_printListItem(
+ __('Contribute'),
+ 'li_pma_contribute',
+ PMA_linkURL('http://www.phpmyadmin.net/home_page/improve.php'),
+ null,
+ '_blank'
+);
+PMA_printListItem(
+ __('Get support'),
+ 'li_pma_support',
+ PMA_linkURL('http://www.phpmyadmin.net/home_page/support.php'),
+ null,
+ '_blank'
+);
+PMA_printListItem(
+ __('List of changes'),
+ 'li_pma_changes',
+ PMA_linkURL('changelog.php'),
+ null,
+ '_blank'
+);
+?>
+ </ul>
+ </div>
+
+</div>
+
+<?php
+/**
+ * BUG: MSIE needs two <br /> here, otherwise it will not extend the outer div to the
+ * full height of the inner divs
+ */
+?>
+<br class="clearfloat" />
+<br class="clearfloat" />
+</div>
+
<?php
-$scripts = new PMA_Scripts();
-$scripts->addFile('jquery/jquery-1.6.2.js');
-$scripts->addFile('update-location.js');
-$scripts->addFile('common.js');
-echo $scripts->getDisplay();
+/**
+ * Warning if using the default MySQL privileged account
+ */
+if ($server != 0
+ && $cfg['Server']['user'] == 'root'
+ && $cfg['Server']['password'] == ''
+) {
+ trigger_error(
+ __('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\'.'),
+ E_USER_WARNING
+ );
+}
+
+/**
+ * Nijel: As we try to handle charsets by ourself, mbstring overloads just
+ * break it, see bug 1063821.
+ */
+if (@extension_loaded('mbstring') && @ini_get('mbstring.func_overload') > 1) {
+ trigger_error(
+ __('You have enabled mbstring.func_overload in your PHP configuration. This option is incompatible with phpMyAdmin and might cause some data to be corrupted!'),
+ E_USER_WARNING
+ );
+}
+
+/**
+ * Nijel: mbstring is used for handling multibyte inside parser, so it is good
+ * to tell user something might be broken without it, see bug #1063149.
+ */
+if (! @extension_loaded('mbstring')) {
+ trigger_error(
+ __('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.'),
+ E_USER_WARNING
+ );
+}
+
+/**
+ * Check whether session.gc_maxlifetime limits session validity.
+ */
+$gc_time = (int)@ini_get('session.gc_maxlifetime');
+if ($gc_time < $GLOBALS['cfg']['LoginCookieValidity'] ) {
+ trigger_error(
+ __('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.'),
+ E_USER_WARNING
+ );
+}
+
+/**
+ * Check whether LoginCookieValidity is limited by LoginCookieStore.
+ */
+if ($GLOBALS['cfg']['LoginCookieStore'] != 0
+ && $GLOBALS['cfg']['LoginCookieStore'] < $GLOBALS['cfg']['LoginCookieValidity']
+) {
+ trigger_error(
+ __('Login cookie store is lower than cookie validity configured in phpMyAdmin, because of this, your login will expire sooner than configured in phpMyAdmin.'),
+ E_USER_WARNING
+ );
+}
+
+/**
+ * Check if user does not have defined blowfish secret and it is being used.
+ */
+if (! empty($_SESSION['auto_blowfish_secret'])
+ && empty($GLOBALS['cfg']['blowfish_secret'])
+) {
+ trigger_error(
+ __('The configuration file now needs a secret passphrase (blowfish_secret).'),
+ E_USER_WARNING
+ );
+}
+
+/**
+ * Check for existence of config directory which should not exist in
+ * production environment.
+ */
+if (file_exists('config')) {
+ trigger_error(
+ __('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.'),
+ E_USER_WARNING
+ );
+}
+
+if ($server > 0) {
+ $cfgRelation = PMA_getRelationsParam();
+ if (! $cfgRelation['allworks']
+ && $cfg['PmaNoRelation_DisableWarning'] == false
+ ) {
+ $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.'));
+ $msg->addParam(
+ '<a href="' . $cfg['PmaAbsoluteUri'] . 'chk_rel.php?' . $common_url_query . '">',
+ false
+ );
+ $msg->addParam('</a>', false);
+ /* Show error if user has configured something, notice elsewhere */
+ if (!empty($cfg['Servers'][$server]['pmadb'])) {
+ $msg->isError(true);
+ }
+ $msg->display();
+ } // end if
+}
+
+/**
+ * Warning about different MySQL library and server version
+ * (a difference on the third digit does not count).
+ * If someday there is a constant that we can check about mysqlnd,
+ * we can use it instead of strpos().
+ * If no default server is set, PMA_DBI_get_client_info() is not defined yet.
+ * Drizzle can speak MySQL protocol, so don't warn about version mismatch for
+ * Drizzle servers.
+ */
+if (function_exists('PMA_DBI_get_client_info') && !PMA_DRIZZLE) {
+ $_client_info = PMA_DBI_get_client_info();
+ if ($server > 0
+ && strpos($_client_info, 'mysqlnd') === false
+ && substr(PMA_MYSQL_CLIENT_API, 0, 3) != substr(PMA_MYSQL_INT_VERSION, 0, 3)
+ ) {
+ trigger_error(
+ PMA_sanitize(
+ sprintf(
+ __('Your PHP MySQL library version %s differs from your MySQL server version %s. This may cause unpredictable behavior.'),
+ $_client_info,
+ substr(
+ PMA_MYSQL_STR_VERSION,
+ 0,
+ strpos(PMA_MYSQL_STR_VERSION . '-', '-')
+ )
+ )
+ ),
+ E_USER_NOTICE
+ );
+ }
+ unset($_client_info);
+}
+
+/**
+ * Warning about Suhosin
+ */
+if ($cfg['SuhosinDisableWarning'] == false
+ && @ini_get('suhosin.request.max_value_length')
+) {
+ trigger_error(
+ sprintf(
+ __('Server running with Suhosin. Please refer to %sdocumentation%s for possible issues.'),
+ '[doc@faq1_38]',
+ '[/doc]'
+ ),
+ E_USER_WARNING
+ );
+}
+
+/**
+ * Warning about mcrypt.
+ */
+if (! function_exists('mcrypt_encrypt')
+ && ! $GLOBALS['cfg']['McryptDisableWarning']
+) {
+ PMA_warnMissingExtension('mcrypt');
+}
+
+/**
+ * Warning about incomplete translations.
+ *
+ * The data file is created while creating release by ./scripts/remove-incomplete-mo
+ */
+if (file_exists('libraries/language_stats.inc.php')) {
+ include 'libraries/language_stats.inc.php';
+ /*
+ * This message is intentionally not translated, because we're
+ * handling incomplete translations here and focus on english
+ * speaking users.
+ */
+ if (isset($GLOBALS['language_stats'][$lang])
+ && $GLOBALS['language_stats'][$lang] < $cfg['TranslationWarningThreshold']
+ ) {
+ trigger_error(
+ '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>.',
+ E_USER_NOTICE
+ );
+ }
+}
+
+/**
+ * prints list item for main page
+ *
+ * @param string $name displayed text
+ * @param string $id id, used for css styles
+ * @param string $url make item as link with $url as target
+ * @param string $mysql_help_page display a link to MySQL's manual
+ * @param string $target special target for $url
+ * @param string $a_id id for the anchor,
+ * used for jQuery to hook in functions
+ * @param string $class class for the li element
+ * @param string $a_class class for the anchor element
+ *
+ * @return void
+ */
+function PMA_printListItem($name, $id = null, $url = null, $mysql_help_page = null,
+ $target = null, $a_id = null, $class = null, $a_class = null
+) {
+ echo '<li id="' . $id . '"';
+ if (null !== $class) {
+ echo ' class="' . $class . '"';
+ }
+ echo '>';
+ if (null !== $url) {
+ echo '<a href="' . $url . '"';
+ if (null !== $target) {
+ echo ' target="' . $target . '"';
+ }
+ if (null != $a_id) {
+ echo ' id="' . $a_id .'"';
+ }
+ if (null != $a_class) {
+ echo ' class="' . $a_class .'"';
+ }
+ echo '>';
+ }
+
+ echo $name;
+
+ if (null !== $url) {
+ echo '</a>' . "\n";
+ }
+ if (null !== $mysql_help_page) {
+ echo PMA_Util::showMySQLDocu('', $mysql_help_page);
+ }
+ echo '</li>';
+}
?>
-</head>
-<frameset cols="<?php
-if ($GLOBALS['text_dir'] === 'rtl') {
- echo '*,';
-}
-echo $GLOBALS['cfg']['NaviWidth'];
-if ($GLOBALS['text_dir'] === 'ltr') {
- echo ',*';
-}
-?>" rows="*" id="mainFrameset">
- <?php if ($GLOBALS['text_dir'] === 'ltr') { ?>
- <frame frameborder="0" id="frame_navigation"
- src="navigation.php<?php echo $url_query; ?>"
- name="frame_navigation" />
- <?php } ?>
- <frame frameborder="0" id="frame_content"
- src="<?php echo $main_target; ?>"
- name="frame_content" />
- <?php if ($GLOBALS['text_dir'] === 'rtl') { ?>
- <frame frameborder="0" id="frame_navigation"
- src="navigation.php<?php echo $url_query; ?>"
- name="frame_navigation" />
- <?php } ?>
- <noframes>
- <body>
- <p><?php echo __('phpMyAdmin is more friendly with a <b>frames-capable</b> browser.'); ?></p>
- </body>
- </noframes>
-</frameset>
-</html>
View
31 js/common.js
@@ -81,21 +81,7 @@ function setTable(new_table)
*/
function refreshMain(url)
{
- if (! url) {
- if (db) {
- url = opendb_url;
- } else {
- url = 'main.php';
- }
- }
- //alert(db);
- goTo(url + '?server=' + encodeURIComponent(server) +
- '&token=' + encodeURIComponent(token) +
- '&db=' + encodeURIComponent(db) +
- '&table=' + encodeURIComponent(table) +
- '&lang=' + encodeURIComponent(lang) +
- '&collation_connection=' + encodeURIComponent(collation_connection),
- 'main');
+ console.log('Call to deprecate function refreshMain() ignored');
}
/**
@@ -105,20 +91,7 @@ function refreshMain(url)
*/
function refreshNavigation(force)
{
- // The goTo() function won't refresh in case the target
- // url is the same as the url given as parameter, but sometimes
- // we want to refresh anyway.
- if (typeof force != undefined && force && window.parent && window.parent.frame_navigation) {
- window.parent.frame_navigation.location.reload();
- } else {
- goTo('navigation.php?server=' + encodeURIComponent(server) +
- '&token=' + encodeURIComponent(token) +
- '&db=' + encodeURIComponent(db) +
- '&table=' + encodeURIComponent(table) +
- '&lang=' + encodeURIComponent(lang) +
- '&collation_connection=' + encodeURIComponent(collation_connection)
- );
- }
+ console.log('Call to deprecate function refreshNavigation() ignored');
}
function unmarkDbTable(db, table)
View
2 js/config.js
@@ -764,7 +764,7 @@ function offerPrefsAutoimport()
var a = $(this);
if (a.attr('href') == '#no') {
cnt.remove();
- $.post('main.php', {
+ $.post('index.php', {
token: cnt.find('input[name=token]').val(),
prefs_autoload: 'hide'});
return;
View
6 js/functions.js
@@ -150,11 +150,11 @@ function PMA_current_version(data)
}
/**
- * Loads Git revision data from ajax for main.php
+ * Loads Git revision data from ajax for index.php
*/
function PMA_display_git_revision()
{
- $.get("main.php?token="
+ $.get("index.php?token="
+ $("input[type=hidden][name=token]").val()
+ "&git_revision=1&ajax_request=true", function (data) {
if (data.success == true) {
@@ -2396,7 +2396,7 @@ AJAX.registerTeardown('functions.js', function() {
$('#change_password_anchor.ajax').die('click');
});
/**
- * Attach Ajax event handlers for 'Change Password' on main.php
+ * Attach Ajax event handlers for 'Change Password' on index.php
*/
AJAX.registerOnload('functions.js', function() {
View
4 libraries/Config.class.php
@@ -659,7 +659,7 @@ function load($source = null)
);
}
// Now, a collation information could come from REQUEST
- // (an example of this: the collation selector in main.php)
+ // (an example of this: the collation selector in index.php)
// so the following handles the setting of collation_connection
// and later, in common.inc.php, the cookie will be set
// according to this.
@@ -1545,7 +1545,7 @@ static protected function getFontsizeSelection()
static public function getFontsizeForm()
{
return '<form name="form_fontsize_selection" id="form_fontsize_selection"'
- . ' method="post" action="main.php" target="_parent">' . "\n"
+ . ' method="post" action="index.php" target="_parent">' . "\n"
. PMA_generate_common_hidden_inputs() . "\n"
. PMA_Config::getFontsizeSelection() . "\n"
. '</form>';
View
2 libraries/DisplayResults.class.php
@@ -3395,7 +3395,7 @@ private function _getDeleteAndKillLinks(
'db' => $this->__get('_db'),
'table' => $this->__get('_table'),
'sql_query' => $url_sql_query,
- 'goto' => 'main.php',
+ 'goto' => 'index.php',
);
$lnk_goto = 'sql.php'
View
2 libraries/Footer.class.php
@@ -193,7 +193,7 @@ private function _getSelfLink($url_params)
{
$retval = '';
$retval .= '<div id="selflink" class="print_ignore">';
- $retval .= '<a href="main.php' . PMA_generate_common_url($url_params) . '"'
+ $retval .= '<a href="index.php' . PMA_generate_common_url($url_params) . '"'
. ' title="' . __('Open new phpMyAdmin window') . '" target="_blank">';
if ($GLOBALS['cfg']['NavigationBarIconic']) {
$retval .= PMA_Util::getImage(
View
6 libraries/NavigationHeader.class.php
@@ -83,7 +83,7 @@ private function links()
{
$retval = '<!-- LINKS START -->';
$retval .= '<div id="leftframelinks">';
- $retval .= ' <a href="main.php?' . $GLOBALS['url_query'] . '" title="' . __('Home') . '">';
+ $retval .= ' <a href="index.php?' . $GLOBALS['url_query'] . '" title="' . __('Home') . '">';
if ($GLOBALS['cfg']['NavigationBarIconic']) {
$retval .= '<img class="icon ic_b_home" src="themes/dot.gif" alt="' . __('Home') . '" /></a>';
} else {
@@ -94,7 +94,7 @@ private function links()
if ($GLOBALS['server'] != 0) {
// Logout for advanced authentication
if ($GLOBALS['cfg']['Server']['auth_type'] != 'config') {
- $retval .= ' <a href="main.php?' . $GLOBALS['url_query'] . '&amp;old_usr=';
+ $retval .= ' <a href="index.php?' . $GLOBALS['url_query'] . '&amp;old_usr=';
$retval .= urlencode($GLOBALS['PHP_AUTH_USER']) . '" target="_parent"';
$retval .= ' title="' . __('Log out') . '" >';
if ($GLOBALS['cfg']['NavigationBarIconic']) {
@@ -185,7 +185,7 @@ private function recent()
if ($GLOBALS['cfg']['LeftRecentTable'] > 0) {
$retval .= '<!-- RECENT START -->';
$retval .= '<div id="recentTableList">';
- $retval .= ' <form method="post" action="main.php" target="_parent">';
+ $retval .= ' <form method="post" action="index.php" target="_parent">';
$retval .= ' ' . PMA_generate_common_hidden_inputs();
$retval .= PMA_RecentTable::getInstance()->getHtmlSelect();
$retval .= ' </form>';
View
2 libraries/Theme.class.php
@@ -437,7 +437,7 @@ public function loadCss()
public function getPrintPreview()
{
$url_params = array('set_theme' => $this->getId());
- $url = 'main.php'. PMA_generate_common_url($url_params);
+ $url = 'index.php'. PMA_generate_common_url($url_params);
$retval = '<div class="theme_preview">';
$retval .= '<h2>';
View
2 libraries/Theme_Manager.class.php
@@ -353,7 +353,7 @@ public function getHtmlSelectBox($form = true)
$select_box = '';
if ($form) {
- $select_box .= '<form name="setTheme" method="post" action="main.php"'
+ $select_box .= '<form name="setTheme" method="post" action="index.php"'
.' target="_parent">';
$select_box .= PMA_generate_common_hidden_inputs();
}
View
2 libraries/common.inc.php
@@ -378,7 +378,7 @@
//'index.php',
//'navigation.php',
//'license.php',
- 'main.php',
+ 'index.php',
'pdf_pages.php',
'pdf_schema.php',
//'phpinfo.php',
View
6 libraries/config.default.php
@@ -863,7 +863,7 @@
*
* @global string $cfg['LeftLogoLink']
*/
-$cfg['LeftLogoLink'] = 'main.php';
+$cfg['LeftLogoLink'] = 'index.php';
/**
* whether to open the linked page in the main window ('main') or
@@ -1202,7 +1202,7 @@
/**
* Possible values:
- * 'main.php' = the welcome page
+ * 'index.php' = the welcome page
* (recommended for multiuser setups)
* 'server_databases.php' = list of databases
* 'server_status.php' = runtime information
@@ -1212,7 +1212,7 @@
*
* @global string $cfg['DefaultTabServer']
*/
-$cfg['DefaultTabServer'] = 'main.php';
+$cfg['DefaultTabServer'] = 'index.php';
/**
* Possible values:
View
2 libraries/config.values.php
@@ -73,7 +73,7 @@
'disabled' => __('Disabled'),
);
$cfg_db['DefaultTabServer'] = array(
- 'main.php', // the welcome page (recommended for multiuser setups)
+ 'index.php', // the welcome page (recommended for multiuser setups)
'server_databases.php', // list of databases
'server_status.php', // runtime information
'server_variables.php', // MySQL server variables
View
4 libraries/db_common.inc.php
@@ -26,7 +26,7 @@
/**
* Defines the urls to return to in case of error in a sql statement
*/
-$err_url_0 = 'main.php?' . PMA_generate_common_url();
+$err_url_0 = 'index.php?' . PMA_generate_common_url();
$err_url = $cfg['DefaultTabDatabase'] . '?' . PMA_generate_common_url($db);
@@ -46,7 +46,7 @@
}
}
// Not a valid db name -> back to the welcome page
- $uri = $cfg['PmaAbsoluteUri'] . 'main.php?'
+ $uri = $cfg['PmaAbsoluteUri'] . 'index.php?'
. PMA_generate_common_url('', '', '&')
. (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1';
if (! strlen($db) || ! $is_db) {
View
2 libraries/db_table_exists.lib.php
@@ -31,7 +31,7 @@
$url_params['show_as_php'] = $show_as_php;
}
PMA_sendHeaderLocation(
- $cfg['PmaAbsoluteUri'] . 'main.php'
+ $cfg['PmaAbsoluteUri'] . 'index.php'
. PMA_generate_common_url($url_params, '&')
);
}
View
2 libraries/display_select_lang.lib.php
@@ -42,7 +42,7 @@ function PMA_Language_select($use_fieldset = false, $show_doc = true)
global $cfg, $lang;
- echo '<form method="post" action="main.php" target="_parent">';
+ echo '<form method="post" action="index.php" target="_parent">';
$_form_params = array(
'db' => $GLOBALS['db'],
View
2 libraries/operations.lib.php
@@ -100,7 +100,7 @@ function PMA_getHtmlForDropDatabaseLink($db)
$this_url_params = array(
'sql_query' => $this_sql_query,
'back' => 'db_operations.php',
- 'goto' => 'main.php',
+ 'goto' => 'index.php',
'reload' => '1',
'purge' => '1',
'message_to_show' => sprintf(
View
6 libraries/plugins/auth/AuthenticationCookie.class.php
@@ -168,7 +168,7 @@ public function auth()
echo '</div>
<br />
<!-- Login form -->
- <form method="post" action="main.php" name="login_form"' . $autocomplete .
+ <form method="post" action="index.php" name="login_form"' . $autocomplete .
' target="_top" class="login hide js-show">
<fieldset>
<legend>';
@@ -516,7 +516,7 @@ public function authSetUser()
}
// URL where to go:
- $redirect_url = $cfg['PmaAbsoluteUri'] . 'main.php';
+ $redirect_url = $cfg['PmaAbsoluteUri'] . 'index.php';
// any parameters to pass?
$url_params = array();
@@ -528,7 +528,7 @@ public function authSetUser()
}
// any target to pass?
if (! empty($GLOBALS['target'])
- && $GLOBALS['target'] != 'main.php'
+ && $GLOBALS['target'] != 'index.php'
) {
$url_params['target'] = $GLOBALS['target'];
}
View
2 libraries/server_common.inc.php
@@ -25,7 +25,7 @@
/**
* Defines the urls to return to in case of error in a sql statement
*/
-$err_url = 'main.php' . $url_query;
+$err_url = 'index.php' . $url_query;
/**
* @global boolean Checks for superuser privileges
View
578 main.php
@@ -1,578 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- *
- * @package PhpMyAdmin
- */
-
-/**
- * Gets some core libraries and displays a top message if required
- */
-require_once 'libraries/common.inc.php';
-
-/**
- * display Git revision if requested
- */
-require_once 'libraries/display_git_revision.lib.php';
-
-if ($GLOBALS['PMA_Config']->isGitRevision()) {
- if (isset($_REQUEST['git_revision']) && $GLOBALS['is_ajax_request'] == true) {
- PMA_printGitRevision();
- exit;
- }
- echo '<div id="is_git_revision"></div>';
-}
-
-// Handles some variables that may have been sent by the calling script
-$GLOBALS['db'] = '';
-$GLOBALS['table'] = '';
-$show_query = '1';
-
-// Any message to display?
-if (! empty($message)) {
- echo PMA_Util::getMessage($message);
- unset($message);
-}
-
-$common_url_query = PMA_generate_common_url('', '');
-
-// when $server > 0, a server has been chosen so we can display
-// all MySQL-related information
-if ($server > 0) {
- include 'libraries/server_common.inc.php';
- include 'libraries/StorageEngine.class.php';
-
- // Use the verbose name of the server instead of the hostname
- // if a value is set
- $server_info = '';
- if (! empty($cfg['Server']['verbose'])) {
- $server_info .= htmlspecialchars($cfg['Server']['verbose']);
- if ($GLOBALS['cfg']['ShowServerInfo']) {
- $server_info .= ' (';
- }
- }
- if ($GLOBALS['cfg']['ShowServerInfo'] || empty($cfg['Server']['verbose'])) {
- $server_info .= PMA_DBI_get_host_info();
- }
- if (! empty($cfg['Server']['verbose']) && $GLOBALS['cfg']['ShowServerInfo']) {
- $server_info .= ')';
- }
- $mysql_cur_user_and_host = PMA_DBI_fetch_value('SELECT USER();');
-
- // should we add the port info here?
- $short_server_info = (!empty($GLOBALS['cfg']['Server']['verbose'])
- ? $GLOBALS['cfg']['Server']['verbose']
- : $GLOBALS['cfg']['Server']['host']);
-}
-
-echo '<div id="maincontainer">' . "\n";
-echo '<div id="main_pane_left">';
-if ($server > 0
- || (! $cfg['LeftDisplayServers'] && count($cfg['Servers']) > 1)
-) {
- echo '<div class="group">';
- echo '<h2>' . __('General Settings') . '</h2>';
- echo '<ul>';
-
- /**
- * Displays the MySQL servers choice form
- */
- if (! $cfg['LeftDisplayServers']
- && (count($cfg['Servers']) > 1 || $server == 0 && count($cfg['Servers']) == 1)
- ) {
- echo '<li id="li_select_server">';
- include_once 'libraries/select_server.lib.php';
- PMA_selectServer(true, true);
- echo '</li>';
- }
-
- /**
- * Displays the mysql server related links
- */
- if ($server > 0 && ! PMA_DRIZZLE) {
- include_once 'libraries/check_user_privileges.lib.php';
-
- // Logout for advanced authentication
- if ($cfg['Server']['auth_type'] != 'config') {
- if ($cfg['ShowChgPassword']) {
- if ($GLOBALS['cfg']['AjaxEnable']) {
- $conditional_class = 'ajax';
- } else {
- $conditional_class = null;
- }
- PMA_printListItem(
- __('Change password'),
- 'li_change_password',
- 'user_password.php?' . $common_url_query,
- null,
- null,
- 'change_password_anchor',
- null,
- $conditional_class
- );
- }
- } // end if
- echo ' <li id="li_select_mysql_collation">';
- echo ' <form method="post" action="main.php" target="_parent">' . "\n"
- . PMA_generate_common_hidden_inputs(null, null, 4, 'collation_connection')
- . ' <label for="select_collation_connection">' . "\n"
- . ' ' . __('Server connection collation') . "\n"
- // put the doc link in the form so that it appears on the same line
- . PMA_Util::showMySQLDocu(
- 'MySQL_Database_Administration',
- 'Charset-connection'
- )
- . ': ' . "\n"
- . ' </label>' . "\n"
-
- . PMA_generateCharsetDropdownBox(
- PMA_CSDROPDOWN_COLLATION,
- 'collation_connection',
- 'select_collation_connection',
- $collation_connection,
- true,
- 4,
- true
- )
- . ' </form>' . "\n"
- . ' </li>' . "\n";
- } // end of if ($server > 0 && !PMA_DRIZZLE)
- echo '</ul>';
- echo '</div>';
-}
-
-echo '<div class="group">';
-echo '<h2>' . __('Appearance Settings') . '</h2>';
-echo ' <ul>';
-
-// Displays language selection combo
-if (empty($cfg['Lang']) && count($GLOBALS['available_languages']) > 1) {
- echo '<li id="li_select_lang">';
- include_once 'libraries/display_select_lang.lib.php';
- PMA_Language_select();
- echo '</li>';
-}
-
-// ThemeManager if available
-
-if ($GLOBALS['cfg']['ThemeManager']) {
- echo '<li id="li_select_theme">';
- echo $_SESSION['PMA_Theme_Manager']->getHtmlSelectBox();
- echo '</li>';
-}
-echo '<li id="li_select_fontsize">';
-echo PMA_Config::getFontsizeForm();
-echo '</li>';
-
-echo '</ul>';
-
-// User preferences
-
-if ($server > 0) {
- echo '<ul>';
- echo PMA_printListItem(
- __('More settings'),
- 'li_user_preferences',
- 'prefs_manage.php?' . $common_url_query
- );
- echo '</ul>';
-}
-
-echo '</div>';
-
-
-echo '</div>';
-echo '<div id="main_pane_right">';
-
-
-if ($server > 0 && $GLOBALS['cfg']['ShowServerInfo']) {
-
- echo '<div class="group">';
- echo '<h2>' . __('Database server') . '</h2>';
- echo '<ul>' . "\n";
- PMA_printListItem(
- __('Server') . ': ' . $server_info,
- 'li_server_info'
- );
- PMA_printListItem(
- __('Software') . ': ' . PMA_Util::getServerType(),
- 'li_server_type'
- );
- PMA_printListItem(
- __('Software version') . ': ' . PMA_MYSQL_STR_VERSION . ' - ' . PMA_MYSQL_VERSION_COMMENT,
- 'li_server_version'
- );
- PMA_printListItem(
- __('Protocol version') . ': ' . PMA_DBI_get_proto_info(),
- 'li_mysql_proto'
- );
- PMA_printListItem(
- __('User') . ': ' . htmlspecialchars($mysql_cur_user_and_host),
- 'li_user_info'
- );
-
- echo ' <li id="li_select_mysql_charset">';
- echo ' ' . __('Server charset') . ': '
- . ' <span lang="en" dir="ltr">'
- . ' ' . $mysql_charsets_descriptions[$mysql_charset_map['utf-8']] . "\n"
- . ' (' . $mysql_charset_map['utf-8'] . ')' . "\n"
- . ' </span>' . "\n"
- . ' </li>' . "\n";
- echo ' </ul>';
- echo ' </div>';
-}
-
-if ($GLOBALS['cfg']['ShowServerInfo'] || $GLOBALS['cfg']['ShowPhpInfo']) {
- echo '<div class="group">';
- echo '<h2>' . __('Web server') . '</h2>';
- echo '<ul>';
- if ($GLOBALS['cfg']['ShowServerInfo']) {
- PMA_printListItem($_SERVER['SERVER_SOFTWARE'], 'li_web_server_software');
-
- if ($server > 0) {
- $client_version_str = PMA_DBI_get_client_info();
- if (preg_match('#\d+\.\d+\.\d+#', $client_version_str)
- && in_array($GLOBALS['cfg']['Server']['extension'], array('mysql', 'mysqli'))
- ) {
- $client_version_str = 'libmysql - ' . $client_version_str;
- }
- PMA_printListItem(
- __('Database client version') . ': ' . $client_version_str,
- 'li_mysql_client_version'
- );
-
- $php_ext_string = __('PHP extension') . ': '
- . $GLOBALS['cfg']['Server']['extension'] . ' '
- . PMA_Util::showPHPDocu(
- 'book.' . $GLOBALS['cfg']['Server']['extension'] . '.php'
- );
- PMA_printListItem(
- $php_ext_string,
- 'li_used_php_extension'
- );
- }
- }
-
- if ($cfg['ShowPhpInfo']) {
- PMA_printListItem(
- __('Show PHP information'),
- 'li_phpinfo',
- 'phpinfo.php?' . $common_url_query
- );
- }
- echo ' </ul>';
- echo ' </div>';
-}
-
-echo '<div class="group pmagroup">';
-echo '<h2>phpMyAdmin</h2>';
-echo '<ul>';
-$class = null;
-// We rely on CSP to allow access to http://www.phpmyadmin.net, but IE lacks
-// support here and does not allow request to http once using https.
-if ($GLOBALS['cfg']['VersionCheck']
- && (! $GLOBALS['PMA_Config']->get('is_https') || PMA_USR_BROWSER_AGENT != 'IE')
-) {
- $class = 'jsversioncheck';
-}
-PMA_printListItem(
- __('Version information') . ': ' . PMA_VERSION,
- 'li_pma_version',
- null,
- null,
- null,
- null,
- $class
-);
-PMA_printListItem(
- __('Documentation'),
- 'li_pma_docs',
- 'Documentation.html',
- null,
- '_blank'
-);
-PMA_printListItem(
- __('Wiki'),
- 'li_pma_wiki',
- PMA_linkURL('http://wiki.phpmyadmin.net/'),
- null,
- '_blank'
-);
-
-// does not work if no target specified, don't know why
-PMA_printListItem(
- __('Official Homepage'),
- 'li_pma_homepage',
- PMA_linkURL('http://www.phpMyAdmin.net/'),
- null,
- '_blank'
-);
-PMA_printListItem(
- __('Contribute'),
- 'li_pma_contribute',
- PMA_linkURL('http://www.phpmyadmin.net/home_page/improve.php'),
- null,
- '_blank'
-);
-PMA_printListItem(
- __('Get support'),
- 'li_pma_support',
- PMA_linkURL('http://www.phpmyadmin.net/home_page/support.php'),
- null,
- '_blank'
-);
-PMA_printListItem(
- __('List of changes'),
- 'li_pma_changes',
- PMA_linkURL('changelog.php'),
- null,
- '_blank'
-);
-?>
- </ul>
- </div>
-
-</div>
-
-<?php
-/**
- * BUG: MSIE needs two <br /> here, otherwise it will not extend the outer div to the
- * full height of the inner divs
- */
-?>
-<br class="clearfloat" />
-<br class="clearfloat" />
-</div>
-
-<?php
-/**
- * Warning if using the default MySQL privileged account
- */
-if ($server != 0
- && $cfg['Server']['user'] == 'root'
- && $cfg['Server']['password'] == ''
-) {
- trigger_error(
- __('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\'.'),
- E_USER_WARNING
- );
-}
-
-/**
- * Nijel: As we try to handle charsets by ourself, mbstring overloads just
- * break it, see bug 1063821.
- */
-if (@extension_loaded('mbstring') && @ini_get('mbstring.func_overload') > 1) {
- trigger_error(
- __('You have enabled mbstring.func_overload in your PHP configuration. This option is incompatible with phpMyAdmin and might cause some data to be corrupted!'),
- E_USER_WARNING
- );
-}
-
-/**
- * Nijel: mbstring is used for handling multibyte inside parser, so it is good
- * to tell user something might be broken without it, see bug #1063149.
- */
-if (! @extension_loaded('mbstring')) {
- trigger_error(
- __('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.'),
- E_USER_WARNING
- );
-}
-
-/**
- * Check whether session.gc_maxlifetime limits session validity.
- */
-$gc_time = (int)@ini_get('session.gc_maxlifetime');
-if ($gc_time < $GLOBALS['cfg']['LoginCookieValidity'] ) {
- trigger_error(
- __('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.'),
- E_USER_WARNING
- );
-}
-
-/**
- * Check whether LoginCookieValidity is limited by LoginCookieStore.
- */
-if ($GLOBALS['cfg']['LoginCookieStore'] != 0
- && $GLOBALS['cfg']['LoginCookieStore'] < $GLOBALS['cfg']['LoginCookieValidity']
-) {
- trigger_error(
- __('Login cookie store is lower than cookie validity configured in phpMyAdmin, because of this, your login will expire sooner than configured in phpMyAdmin.'),
- E_USER_WARNING
- );
-}
-
-/**
- * Check if user does not have defined blowfish secret and it is being used.
- */
-if (! empty($_SESSION['auto_blowfish_secret'])
- && empty($GLOBALS['cfg']['blowfish_secret'])
-) {
- trigger_error(
- __('The configuration file now needs a secret passphrase (blowfish_secret).'),
- E_USER_WARNING
- );
-}
-
-/**
- * Check for existence of config directory which should not exist in
- * production environment.
- */
-if (file_exists('config')) {
- trigger_error(
- __('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.'),
- E_USER_WARNING
- );
-}
-
-if ($server > 0) {
- $cfgRelation = PMA_getRelationsParam();
- if (! $cfgRelation['allworks']
- && $cfg['PmaNoRelation_DisableWarning'] == false
- ) {
- $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.'));
- $msg->addParam(
- '<a href="' . $cfg['PmaAbsoluteUri'] . 'chk_rel.php?' . $common_url_query . '">',
- false
- );
- $msg->addParam('</a>', false);
- /* Show error if user has configured something, notice elsewhere */
- if (!empty($cfg['Servers'][$server]['pmadb'])) {
- $msg->isError(true);
- }
- $msg->display();
- } // end if
-}
-
-/**
- * Warning about different MySQL library and server version
- * (a difference on the third digit does not count).
- * If someday there is a constant that we can check about mysqlnd,
- * we can use it instead of strpos().
- * If no default server is set, PMA_DBI_get_client_info() is not defined yet.
- * Drizzle can speak MySQL protocol, so don't warn about version mismatch for
- * Drizzle servers.
- */
-if (function_exists('PMA_DBI_get_client_info')
- && !PMA_DRIZZLE
- && $cfg['ServerLibraryDifference_DisableWarning'] == false
-) {
- $_client_info = PMA_DBI_get_client_info();
- if ($server > 0
- && strpos($_client_info, 'mysqlnd') === false
- && substr(PMA_MYSQL_CLIENT_API, 0, 3) != substr(PMA_MYSQL_INT_VERSION, 0, 3)
- ) {
- trigger_error(
- PMA_sanitize(
- sprintf(
- __('Your PHP MySQL library version %s differs from your MySQL server version %s. This may cause unpredictable behavior.'),
- $_client_info,
- substr(
- PMA_MYSQL_STR_VERSION,
- 0,
- strpos(PMA_MYSQL_STR_VERSION . '-', '-')
- )
- )
- ),
- E_USER_NOTICE
- );
- }
- unset($_client_info);
-}
-
-/**
- * Warning about Suhosin
- */
-if ($cfg['SuhosinDisableWarning'] == false
- && @ini_get('suhosin.request.max_value_length')
-) {
- trigger_error(
- sprintf(
- __('Server running with Suhosin. Please refer to %sdocumentation%s for possible issues.'),
- '[doc@faq1_38]',
- '[/doc]'
- ),
- E_USER_WARNING
- );
-}
-
-/**
- * Warning about mcrypt.
- */
-if (! function_exists('mcrypt_encrypt')
- && ! $GLOBALS['cfg']['McryptDisableWarning']
-) {
- PMA_warnMissingExtension('mcrypt');
-}
-
-/**
- * Warning about incomplete translations.
- *
- * The data file is created while creating release by ./scripts/remove-incomplete-mo
- */
-if (file_exists('libraries/language_stats.inc.php')) {
- include 'libraries/language_stats.inc.php';
- /*
- * This message is intentionally not translated, because we're
- * handling incomplete translations here and focus on english
- * speaking users.
- */
- if (isset($GLOBALS['language_stats'][$lang])
- && $GLOBALS['language_stats'][$lang] < $cfg['TranslationWarningThreshold']
- ) {
- trigger_error(
- '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>.',
- E_USER_NOTICE
- );
- }
-}
-
-/**
- * prints list item for main page
- *
- * @param string $name displayed text
- * @param string $id id, used for css styles
- * @param string $url make item as link with $url as target
- * @param string $mysql_help_page display a link to MySQL's manual
- * @param string $target special target for $url
- * @param string $a_id id for the anchor,
- * used for jQuery to hook in functions
- * @param string $class class for the li element
- * @param string $a_class class for the anchor element
- *
- * @return void
- */
-function PMA_printListItem($name, $id = null, $url = null, $mysql_help_page = null,
- $target = null, $a_id = null, $class = null, $a_class = null
-) {
- echo '<li id="' . $id . '"';
- if (null !== $class) {
- echo ' class="' . $class . '"';
- }
- echo '>';
- if (null !== $url) {
- echo '<a href="' . $url . '"';
- if (null !== $target) {
- echo ' target="' . $target . '"';
- }
- if (null != $a_id) {
- echo ' id="' . $a_id .'"';
- }
- if (null != $a_class) {
- echo ' class="' . $a_class .'"';
- }
- echo '>';
- }
-
- echo $name;
-
- if (null !== $url) {
- echo '</a>' . "\n";
- }
- if (null !== $mysql_help_page) {
- echo PMA_Util::showMySQLDocu('', $mysql_help_page);
- }
- echo '</li>';
-}
-?>
View
2 sql.php
@@ -950,7 +950,7 @@
if (strlen($db)) {
$db = '';
}
- $goto = 'main.php';
+ $goto = 'index.php';
}
// Loads to target script
$active_page = $goto;
View
4 tbl_create.php
@@ -19,7 +19,7 @@
/* Check if database name is empty */
if (strlen($db) == 0) {
PMA_Util::mysqlDie(
- __('The database name is empty!'), '', '', 'main.php'
+ __('The database name is empty!'), '', '', 'index.php'
);
}
@@ -56,7 +56,7 @@
sprintf(__('\'%s\' database does not exist.'), htmlspecialchars($db)),
'',
'',
- 'main.php'
+ 'index.php'
);
}
View
6 test/libraries/core/PMA_checkPageValidity_test.php
@@ -21,7 +21,7 @@ class PMA_checkPageValidity_test extends PHPUnit_Framework_TestCase
'db_search.php',
'export.php',
'import.php',
- 'main.php',
+ 'index.php',
'pdf_pages.php',
'pdf_schema.php',
'querywindow.php',
@@ -57,14 +57,14 @@ function testGotoNotInWhitelist()
function testGotoWhitelistPage()
{
- $page = 'main.php?sql.php&test=true';
+ $page = 'index.php?sql.php&test=true';
$this->assertTrue(PMA_checkPageValidity($page, $this->goto_whitelist));
}
function testGotoWhitelistEncodedPage()
{
- $page = 'main.php%3Fsql.php%26test%3Dtrue';
+ $page = 'index.php%3Fsql.php%26test%3Dtrue';
$this->assertTrue(PMA_checkPageValidity($page, $this->goto_whitelist));
}
View
4 user_password.php
@@ -2,7 +2,7 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* displays and handles the form where the user can change his password
- * linked from main.php
+ * linked from index.php
*
* @package PhpMyAdmin
*/
@@ -234,7 +234,7 @@ function PMA_changePassDisplayPage($message, $sql_query, $_url_params)
echo PMA_Util::getMessage(
$message, $sql_query, 'success'
);
- echo '<a href="main.php'.PMA_generate_common_url($_url_params)
+ echo '<a href="index.php'.PMA_generate_common_url($_url_params)
.' target="_parent">'. "\n"
.'<strong>'.__('Back').'</strong></a>';
exit;

0 comments on commit 9e3a9ee

Please sign in to comment.