Skip to content

Commit

Permalink
Merge branch 'master' into refactoring
Browse files Browse the repository at this point in the history
Signed-off-by: Bimal Yashodha <kb.yashodha@gmail.com>
  • Loading branch information
kb-yashodha committed Aug 4, 2014
2 parents 97d5310 + 0d099f6 commit ec54531
Show file tree
Hide file tree
Showing 156 changed files with 51,523 additions and 42,239 deletions.
9 changes: 8 additions & 1 deletion ChangeLog
Expand Up @@ -24,12 +24,19 @@ phpMyAdmin - ChangeLog
+ rfe #1488 User privilege tab not shown in all relevant cases
+ rfe #781 Privileges for non superuser
+ rfe #908 Improvements for the table editor (index creation)
+ rfe #1426 Navigation state lost on reload
- bug #4439 Table list in left panel doesn't expand

4.2.7.0 (not yet released)
4.2.8.0 (not yet released)

4.2.7.0 (2014-07-31)
- bug Broken links on home page
- bug #4494 Overlap in navigation panel
- bug #4427 Action icons not in horizontal order
- bug #4493 s_attention.png is missing
- bug #4499 Uncaught TypeError: Cannot call method 'substr' of undefined
- bug #4498 PMA 4.2.x and HHVM
- bug #4500 mysql_doc_template is not defined

4.2.6.0 (2014-07-17)
- bug #4471 Undefined index warning with referenced column.
Expand Down
6 changes: 3 additions & 3 deletions db_datadict.php
Expand Up @@ -213,11 +213,11 @@

if ($have_rel) {
echo ' <td>';
if (isset($res_rel[$column_name])) {
if ($foreigner = PMA_searchColumnInForeigners($res_rel, $column_name)) {
echo htmlspecialchars(
$res_rel[$column_name]['foreign_table']
$foreigner['foreign_table']
. ' -> '
. $res_rel[$column_name]['foreign_field']
. $foreigner['foreign_field']
);
}
echo '</td>' . "\n";
Expand Down
59 changes: 30 additions & 29 deletions db_operations.php
Expand Up @@ -32,7 +32,7 @@
/**
* Rename/move or copy database
*/
if (strlen($db)
if (strlen($GLOBALS['db'])
&& (! empty($_REQUEST['db_rename']) || ! empty($_REQUEST['db_copy']))
) {
if (! empty($_REQUEST['db_rename'])) {
Expand All @@ -59,12 +59,12 @@
// to avoid selecting alternatively the current and new db
// we would need to modify the CREATE definitions to qualify
// the db name
PMA_runProcedureAndFunctionDefinitions($db);
PMA_runProcedureAndFunctionDefinitions($GLOBALS['db']);

// go back to current db, just in case
$GLOBALS['dbi']->selectDb($db);
$GLOBALS['dbi']->selectDb($GLOBALS['db']);

$tables_full = $GLOBALS['dbi']->getTablesFull($db);
$tables_full = $GLOBALS['dbi']->getTablesFull($GLOBALS['db']);

include_once "libraries/plugin_interface.lib.php";
// remove all foreign key constraints, otherwise we can get errors
Expand All @@ -79,20 +79,20 @@
);
$GLOBALS['sql_constraints_query_full_db']
= PMA_getSqlConstraintsQueryForFullDb(
$tables_full, $export_sql_plugin, $move, $db
$tables_full, $export_sql_plugin, $move, $GLOBALS['db']
);

$views = PMA_getViewsAndCreateSqlViewStandIn(
$tables_full, $export_sql_plugin, $db
$tables_full, $export_sql_plugin, $GLOBALS['db']
);

list($sql_query, $_error) = PMA_getSqlQueryForCopyTable(
$tables_full, $sql_query, $move, $db
$tables_full, $sql_query, $move, $GLOBALS['db']
);

// handle the views
if (! $_error) {
$_error = PMA_handleTheViews($views, $move, $db);
$_error = PMA_handleTheViews($views, $move, $GLOBALS['db']);
}
unset($views);

Expand All @@ -105,50 +105,51 @@
// here DELIMITER is not used because it's not part of the
// language; each statement is sent one by one

PMA_runEventDefinitionsForDb($db);
PMA_runEventDefinitionsForDb($GLOBALS['db']);
}

// go back to current db, just in case
$GLOBALS['dbi']->selectDb($db);
$GLOBALS['dbi']->selectDb($GLOBALS['db']);

// Duplicate the bookmarks for this db (done once for each db)
PMA_duplicateBookmarks($_error, $db);
PMA_duplicateBookmarks($_error, $GLOBALS['db']);

if (! $_error && $move) {
/**
* cleanup pmadb stuff for this db
*/
include_once 'libraries/relation_cleanup.lib.php';
PMA_relationsCleanupDatabase($db);
PMA_relationsCleanupDatabase($GLOBALS['db']);

// if someday the RENAME DATABASE reappears, do not DROP
$local_query = 'DROP DATABASE ' . PMA_Util::backquote($db) . ';';
$local_query = 'DROP DATABASE ' . PMA_Util::backquote($GLOBALS['db'])
. ';';
$sql_query .= "\n" . $local_query;
$GLOBALS['dbi']->query($local_query);

$message = PMA_Message::success(
__('Database %1$s has been renamed to %2$s.')
);
$message->addParam($db);
$message->addParam($GLOBALS['db']);
$message->addParam($_REQUEST['newname']);
} elseif (! $_error) {
$message = PMA_Message::success(
__('Database %1$s has been copied to %2$s.')
);
$message->addParam($db);
$message->addParam($GLOBALS['db']);
$message->addParam($_REQUEST['newname']);
}
$reload = true;

/* Change database to be used */
if (! $_error && $move) {
$db = $_REQUEST['newname'];
$GLOBALS['db'] = $_REQUEST['newname'];
} elseif (! $_error) {
if (isset($_REQUEST['switch_to_new'])
&& $_REQUEST['switch_to_new'] == 'true'
) {
$GLOBALS['PMA_Config']->setCookie('pma_switch_to_new', 'true');
$db = $_REQUEST['newname'];
$GLOBALS['db'] = $_REQUEST['newname'];
} else {
$GLOBALS['PMA_Config']->setCookie('pma_switch_to_new', '');
}
Expand All @@ -172,7 +173,7 @@
'sql_query',
PMA_Util::getMessage(null, $sql_query)
);
$response->addJSON('db', $db);
$response->addJSON('db', $GLOBALS['db']);
exit;
}
}
Expand All @@ -188,7 +189,7 @@
* (must be done before displaying the menu tabs)
*/
if (isset($_REQUEST['comment'])) {
PMA_setDbComment($db, $_REQUEST['comment']);
PMA_setDbComment($GLOBALS['db'], $_REQUEST['comment']);
}

require 'libraries/db_common.inc.php';
Expand All @@ -204,8 +205,8 @@
unset($message);
}

$_REQUEST['db_collation'] = PMA_getDbCollation($db);
$is_information_schema = $GLOBALS['dbi']->isSystemSchema($db);
$_REQUEST['db_collation'] = PMA_getDbCollation($GLOBALS['db']);
$is_information_schema = $GLOBALS['dbi']->isSystemSchema($GLOBALS['db']);

$response->addHTML('<div id="boxContainer" data-box-width="300">');

Expand All @@ -214,7 +215,7 @@
/**
* database comment
*/
$response->addHTML(PMA_getHtmlForDatabaseComment($db));
$response->addHTML(PMA_getHtmlForDatabaseComment($GLOBALS['db']));
}

$response->addHTML('<div class="operations_half_width">');
Expand All @@ -228,8 +229,8 @@
/**
* rename database
*/
if ($db != 'mysql') {
$response->addHTML(PMA_getHtmlForRenameDatabase($db));
if ($GLOBALS['db'] != 'mysql') {
$response->addHTML(PMA_getHtmlForRenameDatabase($GLOBALS['db']));
}

// Drop link if allowed
Expand All @@ -238,19 +239,19 @@
// Don't allow to easily drop mysql database, RFE #1327514.
if (($is_superuser || $GLOBALS['cfg']['AllowUserDropDatabase'])
&& ! $db_is_system_schema
&& (PMA_DRIZZLE || $db != 'mysql')
&& (PMA_DRIZZLE || $GLOBALS['db'] != 'mysql')
) {
$response->addHTML(PMA_getHtmlForDropDatabaseLink($db));
$response->addHTML(PMA_getHtmlForDropDatabaseLink($GLOBALS['db']));
}
/**
* Copy database
*/
$response->addHTML(PMA_getHtmlForCopyDatabase($db));
$response->addHTML(PMA_getHtmlForCopyDatabase($GLOBALS['db']));

/**
* Change database charset
*/
$response->addHTML(PMA_getHtmlForChangeDatabaseCharset($db, $table));
$response->addHTML(PMA_getHtmlForChangeDatabaseCharset($GLOBALS['db'], $table));

if ($num_tables > 0
&& ! $cfgRelation['allworks']
Expand Down Expand Up @@ -284,7 +285,7 @@
SELECT *
FROM ' . PMA_Util::backquote($GLOBALS['cfgRelation']['db'])
. '.' . PMA_Util::backquote($cfgRelation['pdf_pages']) . '
WHERE db_name = \'' . PMA_Util::sqlAddSlashes($db) . '\'';
WHERE db_name = \'' . PMA_Util::sqlAddSlashes($GLOBALS['db']) . '\'';
$test_rs = PMA_queryAsControlUser(
$test_query,
false,
Expand Down
3 changes: 1 addition & 2 deletions doc/faq.rst
Expand Up @@ -879,8 +879,7 @@ TableSeparator or disabling that feature.
3.6 What is currently not supported in phpMyAdmin about InnoDB?
---------------------------------------------------------------

In Relation view, having more than one index column in the foreign key. In Query-by-
example (Query), automatic generation of the query LEFT JOIN from the
In Query-by-example (Query), automatic generation of the query LEFT JOIN from the
foreign table.

.. _faq3_7:
Expand Down
4 changes: 4 additions & 0 deletions export.php
Expand Up @@ -198,6 +198,10 @@
$onserver = false;
$save_on_server = false;
$buffer_needed = false;
$back_button = '';
$save_filename = '';
$file_handle = '';
$err_url = '';

// Is it a quick or custom export?
if ($_REQUEST['quick_or_custom'] == 'quick') {
Expand Down
33 changes: 30 additions & 3 deletions import.php
Expand Up @@ -29,11 +29,38 @@
}

// If it's a refresh console bookmarks request
if (isset($_GET['console_bookmark_refresh'])) {
if (isset($_REQUEST['console_bookmark_refresh'])) {
$response = PMA_Response::getInstance();
$response->addJSON('console_message_bookmark', PMA_Console::getBookmarkContent());
exit;
}
// If it's a console bookmark add request
if (isset($_REQUEST['console_bookmark_add'])) {
$response = PMA_Response::getInstance();
if(isset($_REQUEST['label']) && isset($_REQUEST['db'])
&& isset($_REQUEST['bookmark_query']) && isset($_REQUEST['shared']))
{
$cfgBookmark = PMA_Bookmark_getParams();
$bookmarkFields = array(
'bkm_database' => $_REQUEST['db'],
'bkm_user' => $cfgBookmark['user'],
'bkm_sql_query' => urlencode($_REQUEST['bookmark_query']),
'bkm_label' => $_REQUEST['label']
);
$isShared = ($_REQUEST['shared'] == 'true' ? true : false);
if(PMA_Bookmark_save($bookmarkFields, $isShared)) {
$response->addJSON('message', __('Succeeded'));
$response->addJSON('data', $bookmarkFields);
$response->addJSON('isShared', $isShared);
} else {
$response->addJSON('message', __('Failed'));
}
die();
} else {
$response->addJSON('message', __('Incomplete params'));
die();
}
}

/**
* Sets globals from $_POST
Expand Down Expand Up @@ -141,7 +168,7 @@

// so we can obtain the message
$_SESSION['Import_message']['message'] = $message->getDisplay();
$_SESSION['Import_message']['go_back_url'] = $goto;
$_SESSION['Import_message']['go_back_url'] = $GLOBALS['goto'];

$message->display();
exit; // the footer is displayed automatically
Expand Down Expand Up @@ -574,7 +601,7 @@
}
}

if (false !== $import_handle && null !== $import_handle) {
if (! empty($import_handle)) {
fclose($import_handle);
}

Expand Down
3 changes: 0 additions & 3 deletions js/ajax.js
Expand Up @@ -458,9 +458,6 @@ var AJAX = {
$('#'+data.fieldWithError).addClass("error");
}
}
if(PMA_console && PMA_console.isEnabled) {
PMA_console.ajaxCallback(data);
}
},
/**
* This object is in charge of downloading scripts,
Expand Down

0 comments on commit ec54531

Please sign in to comment.