server_common.inc.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * @package PhpMyAdmin
  5. */
  6. if (! defined('PHPMYADMIN')) {
  7. exit;
  8. }
  9. /**
  10. * Handles some variables that may have been sent by the calling script
  11. * Note: this can be called also from the db panel to get the privileges of
  12. * a db, in which case we want to keep displaying the tabs of
  13. * the Database panel
  14. */
  15. if (empty($viewing_mode)) {
  16. $db = $table = '';
  17. }
  18. /**
  19. * Set parameters for links
  20. */
  21. $url_query = PMA_generate_common_url($db);
  22. /**
  23. * Defines the urls to return to in case of error in a sql statement
  24. */
  25. $err_url = 'index.php' . $url_query;
  26. /**
  27. * @global boolean Checks for superuser privileges
  28. */
  29. $is_superuser = PMA_isSuperuser();
  30. // now, select the mysql db
  31. if ($is_superuser && ! PMA_DRIZZLE) {
  32. PMA_DBI_select_db('mysql', $userlink);
  33. }
  34. /**
  35. * @global array binary log files
  36. */
  37. $binary_logs = PMA_DRIZZLE
  38. ? null
  39. : PMA_DBI_fetch_result(
  40. 'SHOW MASTER LOGS',
  41. 'Log_name',
  42. null,
  43. null,
  44. PMA_DBI_QUERY_STORE
  45. );
  46. PMA_Util::checkParameters(
  47. array('is_superuser', 'url_query'), false
  48. );
  49. ?>