Merge branch 'QA_4_9' into QA_5_0
[phpmyadmin.git] / libraries / server_common.inc.php
blobcb0e2aece7ad543d68bf43aef3d2fa3f24562d1d
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 /**
17 * Handles some variables that may have been sent by the calling script
18 * Note: this can be called also from the db panel to get the privileges of
19 * a db, in which case we want to keep displaying the tabs of
20 * the Database panel
22 if (empty($viewing_mode)) {
23 $db = $table = '';
26 /**
27 * Set parameters for links
29 $GLOBALS['url_query'] = Url::getCommon();
31 /**
32 * Defines the urls to return to in case of error in a sql statement
34 $err_url = 'index.php' . $GLOBALS['url_query'];
36 /**
37 * @global boolean Checks for superuser privileges
39 $GLOBALS['is_grantuser'] = $GLOBALS['dbi']->isUserType('grant');
40 $GLOBALS['is_createuser'] = $GLOBALS['dbi']->isUserType('create');
42 // now, select the mysql db
43 if ($GLOBALS['dbi']->isSuperuser()) {
44 $GLOBALS['dbi']->selectDb('mysql');