Translated using Weblate (Portuguese)
[phpmyadmin.git] / libraries / server_common.inc.php
blob4737759787b2396635b961aeb50a98e5d5bba3d3
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Shared code for server pages
6 * @package PhpMyAdmin
7 */
8 declare(strict_types=1);
10 use PhpMyAdmin\Url;
12 if (! defined('PHPMYADMIN')) {
13 exit;
16 global $db, $table, $url_query, $viewing_mode, $err_url, $is_grantuser, $is_createuser, $dbi;
18 /**
19 * Handles some variables that may have been sent by the calling script
20 * Note: this can be called also from the db panel to get the privileges of
21 * a db, in which case we want to keep displaying the tabs of
22 * the Database panel
24 if (empty($viewing_mode)) {
25 $db = $table = '';
28 /**
29 * Set parameters for links
31 $url_query = Url::getCommon();
33 /**
34 * Defines the urls to return to in case of error in a sql statement
36 $err_url = Url::getFromRoute('/');
38 /**
39 * @global boolean Checks for superuser privileges
41 $is_grantuser = $dbi->isUserType('grant');
42 $is_createuser = $dbi->isUserType('create');
44 // now, select the mysql db
45 if ($dbi->isSuperuser()) {
46 $dbi->selectDb('mysql');