server_common.inc.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. if (! defined('PHPMYADMIN')) {
  9. exit;
  10. }
  11. /**
  12. * Handles some variables that may have been sent by the calling script
  13. * Note: this can be called also from the db panel to get the privileges of
  14. * a db, in which case we want to keep displaying the tabs of
  15. * the Database panel
  16. */
  17. if (empty($viewing_mode)) {
  18. $db = $table = '';
  19. }
  20. /**
  21. * Set parameters for links
  22. */
  23. $url_query = PMA_URL_getCommon($db);
  24. /**
  25. * Defines the urls to return to in case of error in a sql statement
  26. */
  27. $err_url = 'index.php' . $url_query;
  28. /**
  29. * @global boolean Checks for superuser privileges
  30. */
  31. $is_superuser = $GLOBALS['dbi']->isSuperuser();
  32. // now, select the mysql db
  33. if ($is_superuser && ! PMA_DRIZZLE) {
  34. $GLOBALS['dbi']->selectDb('mysql', $userlink);
  35. }
  36. PMA_Util::checkParameters(
  37. array('is_superuser', 'url_query'), false
  38. );
  39. /**
  40. * shared functions for server page
  41. */
  42. require_once './libraries/server_common.lib.php';
  43. ?>