2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Shared code for server pages
8 declare(strict_types
=1);
12 if (! defined('PHPMYADMIN')) {
16 global $db, $table, $url_query, $viewing_mode, $err_url, $is_grantuser, $is_createuser, $dbi;
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
24 if (empty($viewing_mode)) {
29 * Set parameters for links
31 $url_query = Url
::getCommon();
34 * Defines the urls to return to in case of error in a sql statement
36 $err_url = Url
::getFromRoute('/');
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');