server_common.inc.php 990 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Shared code for server pages
  5. *
  6. * @package PhpMyAdmin
  7. */
  8. use PhpMyAdmin\Url;
  9. if (! defined('PHPMYADMIN')) {
  10. exit;
  11. }
  12. /**
  13. * Handles some variables that may have been sent by the calling script
  14. * Note: this can be called also from the db panel to get the privileges of
  15. * a db, in which case we want to keep displaying the tabs of
  16. * the Database panel
  17. */
  18. if (empty($viewing_mode)) {
  19. $db = $table = '';
  20. }
  21. /**
  22. * Set parameters for links
  23. */
  24. $GLOBALS['url_query'] = Url::getCommon();
  25. /**
  26. * Defines the urls to return to in case of error in a sql statement
  27. */
  28. $err_url = 'index.php' . $GLOBALS['url_query'];
  29. /**
  30. * @global boolean Checks for superuser privileges
  31. */
  32. $GLOBALS['is_grantuser'] = $GLOBALS['dbi']->isUserType('grant');
  33. $GLOBALS['is_createuser'] = $GLOBALS['dbi']->isUserType('create');
  34. // now, select the mysql db
  35. if ($GLOBALS['dbi']->isSuperuser()) {
  36. $GLOBALS['dbi']->selectDb('mysql');
  37. }