home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / server_common.inc.php < prev    next >
Encoding:
PHP Script  |  2003-11-26  |  1010 b   |  45 lines

  1. <?php
  2. /* $Id: server_common.inc.php,v 2.2 2003/11/26 22:52:24 rabus Exp $ */
  3. // vim: expandtab sw=4 ts=4 sts=4:
  4.  
  5. /**
  6.  * Gets some core libraries
  7.  */
  8. require_once('./libraries/grab_globals.lib.php');
  9. require_once('./libraries/common.lib.php');
  10.  
  11. /**
  12.  * Handles some variables that may have been sent by the calling script
  13.  */
  14. unset($db, $table);
  15.  
  16. /**
  17.  * Set parameters for links
  18.  */
  19. $url_query = PMA_generate_common_url();
  20.  
  21. /**
  22.  * Defines the urls to return to in case of error in a sql statement
  23.  */
  24. $err_url = 'main.php' . $url_query;
  25.  
  26. /**
  27.  * Displays the headers
  28.  */
  29. require_once('./header.inc.php');
  30.  
  31. /**
  32.  * Checks for superuser privileges
  33.  */
  34. // We were checking privileges with 'USE mysql' but users with the global
  35. // priv CREATE TEMPORARY TABLES or LOCK TABLES can do a 'USE mysql'
  36. // (even if they cannot see the tables)
  37.  
  38. $is_superuser = @PMA_mysql_query('SELECT COUNT(*) FROM mysql.user', $userlink);
  39.  
  40. // now, select the mysql db
  41. if ($is_superuser) {
  42.     @PMA_mysql_query('USE mysql', $userlink);
  43. }
  44. ?>
  45.