aboutsummaryrefslogtreecommitdiff
path: root/srcs/phpmyadmin/libraries/server_common.inc.php
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-01-09 10:55:03 +0100
committerCharles <sircharlesaze@gmail.com>2020-01-09 13:09:38 +0100
commit04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa (patch)
tree5c691241355c943a3c68ddb06b8cf8c60aa11319 /srcs/phpmyadmin/libraries/server_common.inc.php
parent7e0d85db834d6351ed85d01e5126ac31dc510b86 (diff)
downloadft_server-04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa.tar.gz
ft_server-04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa.tar.bz2
ft_server-04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa.zip
phpmyadmin working
Diffstat (limited to 'srcs/phpmyadmin/libraries/server_common.inc.php')
-rw-r--r--srcs/phpmyadmin/libraries/server_common.inc.php45
1 files changed, 45 insertions, 0 deletions
diff --git a/srcs/phpmyadmin/libraries/server_common.inc.php b/srcs/phpmyadmin/libraries/server_common.inc.php
new file mode 100644
index 0000000..cb0e2ae
--- /dev/null
+++ b/srcs/phpmyadmin/libraries/server_common.inc.php
@@ -0,0 +1,45 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Shared code for server pages
+ *
+ * @package PhpMyAdmin
+ */
+declare(strict_types=1);
+
+use PhpMyAdmin\Url;
+
+if (! defined('PHPMYADMIN')) {
+ exit;
+}
+
+/**
+ * Handles some variables that may have been sent by the calling script
+ * Note: this can be called also from the db panel to get the privileges of
+ * a db, in which case we want to keep displaying the tabs of
+ * the Database panel
+ */
+if (empty($viewing_mode)) {
+ $db = $table = '';
+}
+
+/**
+ * Set parameters for links
+ */
+$GLOBALS['url_query'] = Url::getCommon();
+
+/**
+ * Defines the urls to return to in case of error in a sql statement
+ */
+$err_url = 'index.php' . $GLOBALS['url_query'];
+
+/**
+ * @global boolean Checks for superuser privileges
+ */
+$GLOBALS['is_grantuser'] = $GLOBALS['dbi']->isUserType('grant');
+$GLOBALS['is_createuser'] = $GLOBALS['dbi']->isUserType('create');
+
+// now, select the mysql db
+if ($GLOBALS['dbi']->isSuperuser()) {
+ $GLOBALS['dbi']->selectDb('mysql');
+}