Translated using Weblate (Hindi)
[phpmyadmin.git] / libraries / check_user_privileges.inc.php
blob168a992062d7f52e1f75145500e695722d999e30
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Get user's global privileges and some db-specific privileges
6 * @package PhpMyAdmin
7 */
8 if (! defined('PHPMYADMIN')) {
9 exit;
12 use PhpMyAdmin\CheckUserPrivileges;
14 $checkUserPrivileges = new CheckUserPrivileges($GLOBALS['dbi']);
16 list($username, $hostname) = $GLOBALS['dbi']->getCurrentUserAndHost();
17 if ($username === '') { // MySQL is started with --skip-grant-tables
18 $GLOBALS['is_create_db_priv'] = true;
19 $GLOBALS['is_reload_priv'] = true;
20 $GLOBALS['db_to_create'] = '';
21 $GLOBALS['dbs_where_create_table_allowed'] = array('*');
22 $GLOBALS['dbs_to_test'] = false;
23 $GLOBALS['db_priv'] = true;
24 $GLOBALS['col_priv'] = true;
25 $GLOBALS['table_priv'] = true;
26 $GLOBALS['proc_priv'] = true;
27 } else {
28 $checkUserPrivileges->analyseShowGrant();