add unique numbers to $strFileCouldNotBeRead to improve support when someone gets...
[phpmyadmin/crack.git] / server_common.inc.php
blobaa5ba05840fca344fb7efb07b89d8891abdcd453
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
5 /**
6 * Gets some core libraries
7 */
8 require_once('./libraries/grab_globals.lib.php');
9 require_once('./libraries/common.lib.php');
11 /**
12 * Handles some variables that may have been sent by the calling script
14 unset($db, $table);
16 /**
17 * Set parameters for links
19 $url_query = PMA_generate_common_url();
21 /**
22 * Defines the urls to return to in case of error in a sql statement
24 $err_url = 'main.php' . $url_query;
26 /**
27 * Displays the headers
29 require_once('./header.inc.php');
31 /**
32 * Checks for superuser privileges
34 // We were checking privileges with 'USE mysql' but users with the global
35 // priv CREATE TEMPORARY TABLES or LOCK TABLES can do a 'USE mysql'
36 // (even if they cannot see the tables)
38 $is_superuser = PMA_DBI_try_query('SELECT COUNT(*) FROM mysql.user');
40 // now, select the mysql db
41 if ($is_superuser) {
42 PMA_DBI_free_result($is_superuser);
43 PMA_DBI_select_db('mysql', $userlink);
44 $is_superuser = TRUE;
45 } else {
46 $is_superuser = FALSE;
49 $has_binlogs = FALSE;
50 $binlogs = PMA_DBI_try_query('SHOW MASTER LOGS', NULL, PMA_DBI_QUERY_STORE);
51 if ($binlogs) {
52 if (PMA_DBI_num_rows($binlogs) > 0) {
53 $binary_logs = array();
54 while ($row = PMA_DBI_fetch_array($binlogs)) {
55 $binary_logs[] = $row[0];
57 $has_binlogs = TRUE;
59 PMA_DBI_free_result($binlogs);
61 unset($binlogs);