There is no en-iso-8859-1 anymore, so do not attempt to use it.
[phpmyadmin/crack.git] / main.php
blob02476d4ff6ee4c448242ff739b5aa1860c7151d4
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 /**
58 * Change password
60 * @todo ? needs another message
62 if ($cfg['ShowChgPassword']) {
63 PMA_printListItem($strChangePassword, 'li_change_password',
64 './user_password.php?' . $common_url_query);
65 } // end if
67 // Logout for advanced authentication
68 if ($cfg['Server']['auth_type'] != 'config') {
69 $http_logout = ($cfg['Server']['auth_type'] == 'http')
70 ? '<a href="./Documentation.html#login_bug" target="documentation">'
71 . ($cfg['ReplaceHelpImg'] ? '<img class="icon" src="' . $pmaThemeImage . 'b_info.png" width="11" height="11" alt="Info" />' : '(*)') . '</a>'
72 : '';
73 PMA_printListItem('<strong>' . $strLogout . '</strong> ' . $http_logout,
74 'li_log_out',
75 './index.php?' . $common_url_query . '&amp;old_usr=' . urlencode($PHP_AUTH_USER), null, '_parent');
76 } // end if
78 } // end of if ($server > 0)
80 <?php
82 /**
83 * Displays the MySQL servers choice form
85 if (! $cfg['LeftDisplayServers'] && (count($cfg['Servers']) > 1 || $server == 0 && count($cfg['Servers']) == 1)) {
86 if ($server == 0) {
87 echo '<ul>';
89 echo '<li id="li_select_server">';
90 require_once './libraries/select_server.lib.php';
91 PMA_select_server(true, true);
92 echo '</li>';
94 echo '</ul>';
95 echo '</div>';
97 echo '<div class="box">';
98 echo '<span class="boxtitle">' . $strInterface . '</span>';
99 echo ' <ul>';
101 // Displays language selection combo
102 if (empty($cfg['Lang'])) {
103 echo '<li id="li_select_lang">';
104 require_once './libraries/display_select_lang.lib.php';
105 PMA_select_language();
106 echo '</li>';
109 // added by Michael Keck <mail_at_michaelkeck_dot_de>
110 // ThemeManager if available
112 if ($GLOBALS['cfg']['ThemeManager']) {
113 echo '<li id="li_select_theme">';
114 echo $_SESSION['PMA_Theme_Manager']->getHtmlSelectBox();
115 echo '</li>';
117 echo '<li id="li_select_fontsize">';
118 echo PMA_Config::getFontsizeForm();
119 echo '</li>';
121 echo '</ul>';
122 echo '</div>';
124 echo '<br class="clearfloat" />';
125 echo '<div class="box">';
126 if ($server > 0) {
127 echo '<span class="boxtitle">' . $strMySQLServerInformation . '</span>';
128 // robbat2: Use the verbose name of the server instead of the hostname
129 // if a value is set
130 $server_info = '';
131 if (! empty($cfg['Server']['verbose'])) {
132 $server_info .= htmlspecialchars($cfg['Server']['verbose']);
133 if ($GLOBALS['cfg']['ShowServerInfo']) {
134 $server_info .= ' (';
137 if ($GLOBALS['cfg']['ShowServerInfo'] || empty($cfg['Server']['verbose'])) {
138 $server_info .= PMA_DBI_get_host_info();
141 if (! empty($cfg['Server']['verbose']) && $GLOBALS['cfg']['ShowServerInfo']) {
142 $server_info .= ')';
144 $mysql_cur_user_and_host = PMA_DBI_fetch_value('SELECT USER();');
146 // should we add the port info here?
147 $short_server_info = (!empty($GLOBALS['cfg']['Server']['verbose'])
148 ? $GLOBALS['cfg']['Server']['verbose']
149 : $GLOBALS['cfg']['Server']['host']);
150 //echo '<h3><span xml:lang="en" dir="ltr">' . $short_server_info . '</span></h3>' . "\n";
151 unset($short_server_info);
154 if ($server > 0) {
155 echo '<ul>' . "\n";
157 if ($GLOBALS['cfg']['ShowServerInfo']) {
158 PMA_printListItem($strServer . ': ' . $server_info, 'li_server_info');
159 PMA_printListItem($strServerVersion . ': ' . PMA_MYSQL_STR_VERSION, 'li_server_version');
160 PMA_printListItem($strProtocolVersion . ': ' . PMA_DBI_get_proto_info(),
161 'li_mysql_proto');
162 PMA_printListItem($strUser . ': ' . htmlspecialchars($mysql_cur_user_and_host),
163 'li_user_info');
164 } else {
165 PMA_printListItem($strServerVersion . ': ' . PMA_MYSQL_STR_VERSION, 'li_server_version');
166 PMA_printListItem($strServer . ': ' . $server_info, 'li_server_info');
169 echo ' <li id="li_select_mysql_charset">';
170 echo ' ' . $strMySQLCharset . ': '
171 . ' <strong xml:lang="en" dir="ltr">'
172 . ' ' . $mysql_charsets_descriptions[$mysql_charset_map[strtolower($charset)]] . "\n"
173 . ' (' . $mysql_charset_map[strtolower($charset)] . ')' . "\n"
174 . ' </strong>' . "\n"
175 . ' </li>' . "\n"
176 . ' <li id="li_select_mysql_collation">';
177 echo ' <form method="post" action="index.php" target="_parent">' . "\n"
178 . PMA_generate_common_hidden_inputs(null, null, 4, 'collation_connection')
179 . ' <label for="select_collation_connection">' . "\n"
180 . ' ' . $strMySQLConnectionCollation . ': ' . "\n"
181 . ' </label>' . "\n"
182 . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'collation_connection', 'select_collation_connection', $collation_connection, true, 4, true)
183 . ' <noscript><input type="submit" value="' . $strGo . '" /></noscript>' . "\n"
184 // put the doc link in the form so that it appears on the same line
185 . PMA_showMySQLDocu('MySQL_Database_Administration', 'Charset-connection') . "\n"
186 . ' </form>' . "\n"
187 . ' </li>' . "\n";
188 echo ' </ul>';
189 echo ' </div>';
192 if ($server > 0) {
193 echo '<div class="box box_smaller">';
194 echo '<span class="boxtitle">' . $strWebServerInformation . '</span>';
195 echo '<ul>';
196 PMA_printListItem($_SERVER['SERVER_SOFTWARE'], 'li_web_server_software');
197 PMA_printListItem($strMysqlClientVersion . ': ' . PMA_DBI_get_client_info(),
198 'li_mysql_client_version');
199 PMA_printListItem($strUsedPhpExtensions . ': ' . $GLOBALS['cfg']['Server']['extension'],
200 'li_used_php_extension');
203 if ($cfg['ShowPhpInfo']) {
204 PMA_printListItem($strShowPHPInfo, 'li_phpinfo', './phpinfo.php?' . $common_url_query);
206 echo ' </ul>';
207 echo ' </div>';
209 echo '<div class="box box_smaller">';
210 echo '<span class="boxtitle">' . $strAboutphpMyAdmin . '</span>';
211 echo '<ul>';
212 PMA_printListItem($strVersionInformation . ': ' . PMA_VERSION, 'li_pma_version');
213 PMA_printListItem($strPmaDocumentation, 'li_pma_docs', 'Documentation.html', null, '_blank');
214 PMA_printListItem($strPmaWiki, 'li_pma_wiki', 'http://wiki.cihar.com', null, '_blank');
216 // does not work if no target specified, don't know why
217 PMA_printListItem($strHomepageOfficial, 'li_pma_homepage', 'http://www.phpMyAdmin.net/', null, '_blank');
219 <li><bdo xml:lang="en" dir="ltr">
220 [<a href="changelog.php" target="_blank">ChangeLog</a>]
221 [<a href="http://phpmyadmin.svn.sourceforge.net/viewvc/phpmyadmin/"
222 target="_blank">Subversion</a>]
223 [<a href="http://sourceforge.net/mail/?group_id=23067"
224 target="_blank">Lists</a>]
225 </bdo>
226 </li>
227 </ul>
228 </div>
229 <?php
231 * BUG: MSIE needs two <br /> here, otherwise it will not extend the outer div to the
232 * full height of the inner divs
235 <br class="clearfloat" />
236 <br class="clearfloat" />
237 </div>
239 <?php
241 * Warning if using the default MySQL privileged account
242 * modified: 2004-05-05 mkkeck
244 if ($server != 0
245 && $cfg['Server']['user'] == 'root'
246 && $cfg['Server']['password'] == '') {
247 trigger_error($strInsecureMySQL, E_USER_WARNING);
251 * Nijel: As we try to handle charsets by ourself, mbstring overloads just
252 * break it, see bug 1063821.
254 if (@extension_loaded('mbstring') && @ini_get('mbstring.func_overload') > 1) {
255 trigger_error($strMbOverloadWarning, E_USER_WARNING);
259 * Nijel: mbstring is used for handling multibyte inside parser, so it is good
260 * to tell user something might be broken without it, see bug #1063149.
262 if (! @extension_loaded('mbstring')) {
263 trigger_error($strMbExtensionMissing, E_USER_WARNING);
267 * Warning about different MySQL library and server version
268 * (a difference on the third digit does not count).
269 * If someday there is a constant that we can check about mysqlnd, we can use it instead
270 * of strpos().
271 * If no default server is set, PMA_DBI_get_client_info() is not defined yet.
273 if (function_exists('PMA_DBI_get_client_info')) {
274 $_client_info = PMA_DBI_get_client_info();
275 if ($server > 0 && strpos($_client_info, 'mysqlnd') === false && substr(PMA_MYSQL_CLIENT_API, 0, 3) != substr(PMA_MYSQL_INT_VERSION, 0, 3)) {
276 trigger_error(PMA_sanitize(sprintf($strMysqlLibDiffersServerVersion,
277 $_client_info,
278 substr(PMA_MYSQL_STR_VERSION, 0, strpos(PMA_MYSQL_STR_VERSION . '-', '-')))),
279 E_USER_NOTICE);
281 unset($_client_info);
285 * Warning about Suhosin
287 if ($cfg['SuhosinDisableWarning'] == false && @ini_get('suhosin.request.max_value_length')) {
288 trigger_error(PMA_sanitize(sprintf($strSuhosin, '[a@./Documentation.html#faq1_38@_blank]', '[/a]')), E_USER_WARNING);
292 * prints list item for main page
294 * @param string $name displayed text
295 * @param string $id id, used for css styles
296 * @param string $url make item as link with $url as target
297 * @param string $mysql_help_page display a link to MySQL's manual
298 * @param string $target special target for $url
300 function PMA_printListItem($name, $id = null, $url = null, $mysql_help_page = null, $target = null)
302 echo '<li id="' . $id . '">';
303 if (null !== $url) {
304 echo '<a href="' . $url . '"';
305 if (null !== $target) {
306 echo ' target="' . $target . '"';
308 echo '>';
311 echo $name;
313 if (null !== $url) {
314 echo '</a>' . "\n";
316 if (null !== $mysql_help_page) {
317 echo PMA_showMySQLDocu('', $mysql_help_page);
319 echo '</li>';
323 * Displays the footer
325 require_once './libraries/footer.inc.php';