bug #1490193 and code simplification

This commit is contained in:
Marc Delisle
2006-05-18 16:53:40 +00:00
parent fde2f613ad
commit 6215a6d94a
6 changed files with 19 additions and 25 deletions

View File

@@ -35,19 +35,12 @@ require_once('./libraries/header.inc.php');
/**
* Checks for superuser privileges
*/
// We were checking privileges with 'USE mysql' but users with the global
// priv CREATE TEMPORARY TABLES or LOCK TABLES can do a 'USE mysql'
// (even if they cannot see the tables)
$is_superuser = PMA_DBI_try_query('SELECT COUNT(*) FROM mysql.user');
$is_superuser = PMA_isSuperuser();
// now, select the mysql db
if ($is_superuser) {
PMA_DBI_free_result($is_superuser);
PMA_DBI_select_db('mysql', $userlink);
$is_superuser = TRUE;
} else {
$is_superuser = FALSE;
}
$has_binlogs = FALSE;