bug #1910621 [display] part 1: do not display a TEXT utf8_bin as BLOB (fixed for...
[phpmyadmin/crack.git] / main.php
blobf92f95693d8a195ff8adb796d902fb26989a0833
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @version $Id$
6 */
8 /**
9 * Gets some core libraries and displays a top message if required
11 require_once './libraries/common.inc.php';
13 // Handles some variables that may have been sent by the calling script
14 $GLOBALS['db'] = '';
15 $GLOBALS['table'] = '';
16 $show_query = '1';
17 require_once './libraries/header.inc.php';
19 // Any message to display?
20 if (! empty($message)) {
21 PMA_showMessage($message);
22 unset($message);
25 $common_url_query = PMA_generate_common_url('', '');
27 if ($server > 0) {
28 require './libraries/server_common.inc.php';
29 require './libraries/StorageEngine.class.php';
30 require './libraries/server_links.inc.php';
33 echo '<div id="maincontainer">' . "\n";
34 echo '<div class="box">';
35 echo '<span class="boxtitle">' . $strActions . '</span>';
37 /**
38 * Displays the mysql server related links
40 if ($server > 0) {
41 require_once './libraries/check_user_privileges.lib.php';
42 $is_superuser = PMA_isSuperuser();
44 if ($cfg['Server']['auth_type'] == 'config') {
45 $cfg['ShowChgPassword'] = false;
49 if ($server > 0) {
50 echo '<ul>';
51 if ($cfg['ShowCreateDb']) {
52 echo '<li id="li_create_database">';
53 require './libraries/display_create_database.lib.php';
54 echo '</li>' . "\n";
57 if ($is_reload_priv) {
58 PMA_printListItem($strReloadPrivileges, 'li_flush_privileges',
59 './server_privileges.php?flush_privileges=1&amp;' . $common_url_query, 'flush');
62 /**
63 * Change password
65 * @todo ? needs another message
67 if ($cfg['ShowChgPassword']) {
68 PMA_printListItem($strChangePassword, 'li_change_password',
69 './user_password.php?' . $common_url_query);
70 } // end if
72 // Logout for advanced authentication
73 if ($cfg['Server']['auth_type'] != 'config') {
74 $http_logout = ($cfg['Server']['auth_type'] == 'http')
75 ? '<a href="./Documentation.html#login_bug" target="documentation">'
76 . ($cfg['ReplaceHelpImg'] ? '<img class="icon" src="' . $pmaThemeImage . 'b_info.png" width="11" height="11" alt="Info" />' : '(*)') . '</a>'
77 : '';
78 PMA_printListItem('<strong>' . $strLogout . '</strong> ' . $http_logout,
79 'li_log_out',
80 './index.php?' . $common_url_query . '&amp;old_usr=' . urlencode($PHP_AUTH_USER), null, '_parent');
81 } // end if
83 } // end of if ($server > 0)
85 <?php
87 /**
88 * Displays the MySQL servers choice form
90 if (! $cfg['LeftDisplayServers'] && (count($cfg['Servers']) > 1 || $server == 0 && count($cfg['Servers']) == 1)) {
91 if ($server == 0) {
92 echo '<ul>';
94 echo '<li id="li_select_server">';
95 require_once './libraries/select_server.lib.php';
96 PMA_select_server(true, true);
97 echo '</li>';
99 echo '</ul>';
100 echo '</div>';
102 echo '<div class="box">';
103 echo '<span class="boxtitle">' . $strInterface . '</span>';
104 echo ' <ul>';
106 // Displays language selection combo
107 if (empty($cfg['Lang'])) {
108 echo '<li id="li_select_lang">';
109 require_once './libraries/display_select_lang.lib.php';
110 PMA_select_language();
111 echo '</li>';
114 // added by Michael Keck <mail_at_michaelkeck_dot_de>
115 // ThemeManager if available
117 if ($GLOBALS['cfg']['ThemeManager']) {
118 echo '<li id="li_select_theme">';
119 echo $_SESSION['PMA_Theme_Manager']->getHtmlSelectBox();
120 echo '</li>';
122 echo '<li id="li_select_fontsize">';
123 echo PMA_Config::getFontsizeForm();
124 echo '</li>';
126 echo '</ul>';
127 echo '</div>';
129 echo '<br class="clearfloat" />';
130 echo '<div class="box">';
131 if ($server > 0) {
132 echo '<span class="boxtitle">' . $strMySQLServerInformation . '</span>';
133 // robbat2: Use the verbose name of the server instead of the hostname
134 // if a value is set
135 $server_info = '';
136 if (! empty($cfg['Server']['verbose'])) {
137 $server_info .= htmlspecialchars($cfg['Server']['verbose']);
138 if ($GLOBALS['cfg']['ShowServerInfo']) {
139 $server_info .= ' (';
142 if ($GLOBALS['cfg']['ShowServerInfo'] || empty($cfg['Server']['verbose'])) {
143 $server_info .= PMA_DBI_get_host_info();
146 if (! empty($cfg['Server']['verbose']) && $GLOBALS['cfg']['ShowServerInfo']) {
147 $server_info .= ')';
149 $mysql_cur_user_and_host = PMA_DBI_fetch_value('SELECT USER();');
151 // should we add the port info here?
152 $short_server_info = (!empty($GLOBALS['cfg']['Server']['verbose'])
153 ? $GLOBALS['cfg']['Server']['verbose']
154 : $GLOBALS['cfg']['Server']['host']);
155 //echo '<h3><span xml:lang="en" dir="ltr">' . $short_server_info . '</span></h3>' . "\n";
156 unset($short_server_info);
159 if ($server > 0) {
160 echo '<ul>' . "\n";
162 if ($GLOBALS['cfg']['ShowServerInfo']) {
163 PMA_printListItem($strServer . ': ' . $server_info, 'li_server_info');
164 PMA_printListItem($strServerVersion . ': ' . PMA_MYSQL_STR_VERSION, 'li_server_version');
165 PMA_printListItem($strProtocolVersion . ': ' . PMA_DBI_get_proto_info(),
166 'li_mysql_proto');
167 PMA_printListItem($strUser . ': ' . htmlspecialchars($mysql_cur_user_and_host),
168 'li_user_info');
169 } else {
170 PMA_printListItem($strServerVersion . ': ' . PMA_MYSQL_STR_VERSION, 'li_server_version');
171 PMA_printListItem($strServer . ': ' . $server_info, 'li_server_info');
174 echo ' <li id="li_select_mysql_charset">';
175 echo ' ' . $strMySQLCharset . ': '
176 . ' <strong xml:lang="en" dir="ltr">'
177 . ' ' . $mysql_charsets_descriptions[$mysql_charset_map[strtolower($charset)]] . "\n"
178 . ' (' . $mysql_charset_map[strtolower($charset)] . ')' . "\n"
179 . ' </strong>' . "\n"
180 . ' </li>' . "\n"
181 . ' <li id="li_select_mysql_collation">';
182 echo ' <form method="post" action="index.php" target="_parent">' . "\n"
183 . PMA_generate_common_hidden_inputs(null, null, 4, 'collation_connection')
184 . ' <label for="select_collation_connection">' . "\n"
185 . ' ' . $strMySQLConnectionCollation . ': ' . "\n"
186 . ' </label>' . "\n"
187 . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'collation_connection', 'select_collation_connection', $collation_connection, true, 4, true)
188 . ' <noscript><input type="submit" value="' . $strGo . '" /></noscript>' . "\n"
189 // put the doc link in the form so that it appears on the same line
190 . PMA_showMySQLDocu('MySQL_Database_Administration', 'Charset-connection') . "\n"
191 . ' </form>' . "\n"
192 . ' </li>' . "\n";
193 echo ' </ul>';
194 echo ' </div>';
197 if ($server > 0) {
198 echo '<div class="box box_smaller">';
199 echo '<span class="boxtitle">' . $strWebServerInformation . '</span>';
200 echo '<ul>';
201 PMA_printListItem($_SERVER['SERVER_SOFTWARE'], 'li_web_server_software');
202 PMA_printListItem($strMysqlClientVersion . ': ' . PMA_DBI_get_client_info(),
203 'li_mysql_client_version');
204 PMA_printListItem($strUsedPhpExtensions . ': ' . $GLOBALS['cfg']['Server']['extension'],
205 'li_used_php_extension');
208 if ($cfg['ShowPhpInfo']) {
209 PMA_printListItem($strShowPHPInfo, 'li_phpinfo', './phpinfo.php?' . $common_url_query);
211 echo ' </ul>';
212 echo ' </div>';
214 echo '<div class="box box_smaller">';
215 echo '<span class="boxtitle">' . $strAboutphpMyAdmin . '</span>';
216 echo '<ul>';
217 PMA_printListItem($strVersionInformation . ': ' . PMA_VERSION, 'li_pma_version');
218 PMA_printListItem($strPmaDocumentation, 'li_pma_docs', 'Documentation.html', null, '_blank');
219 PMA_printListItem($strPmaWiki, 'li_pma_wiki', 'http://wiki.cihar.com', null, '_blank');
221 // does not work if no target specified, don't know why
222 PMA_printListItem($strHomepageOfficial, 'li_pma_homepage', 'http://www.phpMyAdmin.net/', null, '_blank');
224 <li><bdo xml:lang="en" dir="ltr">
225 [<a href="changelog.php" target="_blank">ChangeLog</a>]
226 [<a href="http://phpmyadmin.svn.sourceforge.net/viewvc/phpmyadmin/"
227 target="_blank">Subversion</a>]
228 [<a href="http://sourceforge.net/mail/?group_id=23067"
229 target="_blank">Lists</a>]
230 </bdo>
231 </li>
232 </ul>
233 </div>
234 <?php
236 * BUG: MSIE needs two <br /> here, otherwise it will not extend the outer div to the
237 * full height of the inner divs
240 <br class="clearfloat" />
241 <br class="clearfloat" />
242 </div>
244 <?php
246 * Warning if using the default MySQL privileged account
247 * modified: 2004-05-05 mkkeck
249 if ($server != 0
250 && $cfg['Server']['user'] == 'root'
251 && $cfg['Server']['password'] == '') {
252 trigger_error($strInsecureMySQL, E_USER_WARNING);
256 * Nijel: As we try to handle charsets by ourself, mbstring overloads just
257 * break it, see bug 1063821.
259 if (@extension_loaded('mbstring') && @ini_get('mbstring.func_overload') > 1) {
260 trigger_error($strMbOverloadWarning, E_USER_WARNING);
264 * Nijel: mbstring is used for handling multibyte inside parser, so it is good
265 * to tell user something might be broken without it, see bug #1063149.
267 if ($GLOBALS['using_mb_charset'] && !@extension_loaded('mbstring')) {
268 trigger_error($strMbExtensionMissing, E_USER_WARNING);
272 * Warning about different MySQL library and server version
273 * (a difference on the third digit does not count).
274 * If someday there is a constant that we can check about mysqlnd, we can use it instead
275 * of strpos().
276 * If no default server is set, PMA_DBI_get_client_info() is not defined yet.
278 if (function_exists('PMA_DBI_get_client_info')) {
279 $_client_info = PMA_DBI_get_client_info();
280 if ($server > 0 && strpos($_client_info, 'mysqlnd') === false && substr(PMA_MYSQL_CLIENT_API, 0, 3) != substr(PMA_MYSQL_INT_VERSION, 0, 3)) {
281 trigger_error(PMA_sanitize(sprintf($strMysqlLibDiffersServerVersion,
282 $_client_info,
283 substr(PMA_MYSQL_STR_VERSION, 0, strpos(PMA_MYSQL_STR_VERSION . '-', '-')))),
284 E_USER_NOTICE);
286 unset($_client_info);
290 * Warning about Suhosin
292 if ($cfg['SuhosinDisableWarning'] == false && @ini_get('suhosin.request.max_value_length')) {
293 trigger_error(PMA_sanitize(sprintf($strSuhosin, '[a@./Documentation.html#faq1_38@_blank]', '[/a]')), E_USER_WARNING);
297 * prints list item for main page
299 * @param string $name displayed text
300 * @param string $id id, used for css styles
301 * @param string $url make item as link with $url as target
302 * @param string $mysql_help_page display a link to MySQL's manual
303 * @param string $target special target for $url
305 function PMA_printListItem($name, $id = null, $url = null, $mysql_help_page = null, $target = null)
307 echo '<li id="' . $id . '">';
308 if (null !== $url) {
309 echo '<a href="' . $url . '"';
310 if (null !== $target) {
311 echo ' target="' . $target . '"';
313 echo '>';
316 echo $name;
318 if (null !== $url) {
319 echo '</a>' . "\n";
321 if (null !== $mysql_help_page) {
322 echo PMA_showMySQLDocu('', $mysql_help_page);
324 echo '</li>';
328 * Displays the footer
330 require_once './libraries/footer.inc.php';