[ Index ]
 

Code source de phpMyAdmin 2.10.3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/libraries/ -> db_links.inc.php (source)

   1  <?php
   2  /* $Id: db_links.inc.php 9825 2007-01-04 18:22:08Z lem9 $ */
   3  // vim: expandtab sw=4 ts=4 sts=4:
   4  
   5  require_once ('./libraries/common.lib.php');
   6  
   7  require_once  './libraries/relation.lib.php';
   8  /**
   9   * Gets the relation settings
  10   */
  11  $cfgRelation = PMA_getRelationsParam();
  12  
  13  /**
  14   * If coming from a Show MySQL link on the home page,
  15   * put something in $sub_part
  16   */
  17  if (empty($sub_part)) {
  18      $sub_part = '_structure';
  19  }
  20  
  21  /**
  22   * Checks for superuser privileges
  23   */
  24  $is_superuser = PMA_isSuperuser();
  25  
  26  /**
  27   * Prepares links
  28   */
  29  // Drop link if allowed
  30  // rabus: Don't even try to drop information_schema. You won't be able to. Believe me. You won't.
  31  // nijel: Don't allow to easilly drop mysql database, RFE #1327514.
  32  if (($is_superuser || $GLOBALS['cfg']['AllowUserDropDatabase']) && ! $db_is_information_schema && ($db != 'mysql')) {
  33      $tab_drop['link'] = 'sql.php';
  34      $tab_drop['args']['sql_query']  = 'DROP DATABASE ' . PMA_backquote($db);
  35      $tab_drop['args']['zero_rows']  = sprintf($GLOBALS['strDatabaseHasBeenDropped'], htmlspecialchars(PMA_backquote($db)));
  36      $tab_drop['args']['goto']       = 'main.php';
  37      $tab_drop['args']['back']       = 'db' . $sub_part . '.php';
  38      $tab_drop['args']['reload']     = 1;
  39      $tab_drop['args']['purge']      = 1;
  40      $tab_drop['attr'] = 'onclick="return confirmLinkDropDB(this, \'DROP DATABASE ' . PMA_jsFormat($db) . '\')"';
  41  }
  42  
  43  /**
  44   * export, search and qbe links if there is at least one table
  45   */
  46  if ( $num_tables == 0 ) {
  47      $tab_qbe['warning'] = $strDbIsEmpty;
  48      $tab_search['warning'] = $strDbIsEmpty;
  49      $tab_export['warning'] = $strDbIsEmpty;
  50  }
  51  
  52  $tab_structure['link']  = 'db_structure.php';
  53  $tab_structure['text']  = $GLOBALS['strStructure'];
  54  $tab_structure['icon']  = 'b_props.png';
  55  
  56  $tab_sql['link']        = 'db_sql.php';
  57  $tab_sql['args']['db_query_force'] = 1;
  58  $tab_sql['text']        = $GLOBALS['strSQL'];
  59  $tab_sql['icon']        = 'b_sql.png';
  60  
  61  $tab_export['text']     = $GLOBALS['strExport'];
  62  $tab_export['icon']     = 'b_export.png';
  63  $tab_export['link']     = 'db_export.php';
  64  
  65  $tab_search['text']     = $GLOBALS['strSearch'];
  66  $tab_search['icon']     = 'b_search.png';
  67  $tab_search['link']     = 'db_search.php';
  68  
  69  $tab_qbe['text']        = $GLOBALS['strQBE'];
  70  $tab_qbe['icon']        = 's_db.png';
  71  $tab_qbe['link']        = 'db_qbe.php';
  72  
  73  if ($cfgRelation['designerwork']) {
  74      $tab_designer['text']   = $GLOBALS['strDesigner'];
  75      $tab_designer['icon']   = 'b_relations.png';
  76      $tab_designer['link']   = 'pmd_general.php';
  77  }
  78  
  79  if ( ! $db_is_information_schema ) {
  80      $tab_import['link']     = 'db_import.php';
  81      $tab_import['text']     = $GLOBALS['strImport'];
  82      $tab_import['icon']     = 'b_import.png';
  83      $tab_drop['text']       = $GLOBALS['strDrop'];
  84      $tab_drop['icon']       = 'b_deltbl.png';
  85      $tab_drop['class']      = 'caution';
  86      $tab_operation['link']  = 'db_operations.php';
  87      $tab_operation['text']  = $GLOBALS['strOperations'];
  88      $tab_operation['icon']  = 'b_tblops.png';
  89      if ( $is_superuser ) {
  90          $tab_privileges['link'] = 'server_privileges.php';
  91          $tab_privileges['args']['checkprivs']       = $db;
  92          // stay on database view
  93          $tab_privileges['args']['viewing_mode'] = 'db';
  94          $tab_privileges['text'] = $GLOBALS['strPrivileges'];
  95          $tab_privileges['icon'] = 's_rights.png';
  96      }
  97  }
  98  
  99  /**
 100   * Displays tab links
 101   */
 102  $tabs = array();
 103  $tabs[] =& $tab_structure;
 104  $tabs[] =& $tab_sql;
 105  $tabs[] =& $tab_search;
 106  $tabs[] =& $tab_qbe;
 107  $tabs[] =& $tab_export;
 108  if ( ! $db_is_information_schema ) {
 109      $tabs[] =& $tab_import;
 110      if ($cfgRelation['designerwork']) {
 111          $tabs[] =& $tab_designer;
 112      }
 113      $tabs[] =& $tab_operation;
 114      if ( $is_superuser ) {
 115          $tabs[] =& $tab_privileges;
 116      }
 117      if ( $is_superuser || $GLOBALS['cfg']['AllowUserDropDatabase'] ) {
 118          $tabs[] =& $tab_drop;
 119      }
 120  }
 121  
 122  echo PMA_getTabs( $tabs );
 123  unset( $tabs );
 124  
 125  /**
 126   * Displays a message
 127   */
 128  if (!empty($message)) {
 129      PMA_showMessage($message);
 130      unset($message);
 131  }
 132  ?>
 133  <br />


Généré le : Mon Nov 26 15:18:20 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics