Merge branch 'QA_4_9' into QA_5_0

Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
William Desportes 2019-11-11 20:23:35 +01:00
commit 5a83a289d8
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889
12 changed files with 121 additions and 36 deletions

View File

@ -66,6 +66,9 @@ phpMyAdmin - ChangeLog
- issue #14951 Fix moving columns with INT AND DEFAULT CURRENT_TIMESTAMP doesn't work on MariaDB
- issue #12241 Fixed table alias is removed when exporting a query
- issue #15316 Fixed cross join clause is removed on export
- issue #14809 Fix error "is_uploaded_file() expects parameter 1 to be string" when inserting blobs from files
- issue #15127 Fix white square when refreshing designer or browsing other pages
- issue #13912 Detect when phpMyAdmin storage tables are not accessible, help users browse corrupt DBs
4.9.1 (2019-09-20)
- issue #15313 Added support for Twig 2

View File

@ -51,7 +51,7 @@ tokens.
There are several manufacturers of these tokens, for example:
* `youbico FIDO U2F Security Key <https://www.yubico.com/services-with-yubikey/fido-u2f/>`_
* `youbico FIDO U2F Security Key <https://www.yubico.com/fido-u2f/>`_
* `HyperFIDO <https://www.hypersecu.com/tmp/products/hyperfido>`_
* `Trezor Hardware Wallet <https://trezor.io/?offer_id=12&aff_id=1592&source=phpmyadmin>`_ can act as an `U2F token <https://wiki.trezor.io/User_manual:Two-factor_Authentication_with_U2F>`_
* `List of Two Factor Auth (2FA) Dongles <https://www.dongleauth.info/dongles/>`_

View File

@ -1164,8 +1164,24 @@ Navigation.ResizeHandler = function () {
var windowWidth = $(window).width();
$('#pma_navigation').width(pos);
$('body').css('margin-' + this.left, pos + 'px');
// Issue #15127
$('#floating_menubar, #pma_console')
// Issue #15127 : Adding fixed positioning to menubar
$('#floating_menubar')
.css('margin-' + this.left, $('#pma_navigation').width() + $('#pma_navigation_resizer').width())
.css(this.left, 0)
.css({
'position': 'fixed',
'top': 0,
'width': '100%',
'z-index': 99
});
// Allow the DOM to render, then adjust the padding on the body
setTimeout(function () {
$('body').css(
'padding-top',
$('#floating_menubar').outerHeight(true)
);
}, 2);
$('#pma_console')
.css('margin-' + this.left, (pos + resizerWidth) + 'px');
$resizer.css(this.left, pos + 'px');
if (pos === 0) {

View File

@ -100,7 +100,12 @@ class Designer
*/
private function getPageIdsAndNames($db)
{
$result = [];
$cfgRelation = $this->relation->getRelationsParam();
if (! $cfgRelation['pdfwork']) {
return $result;
}
$page_query = "SELECT `page_nr`, `page_descr` FROM "
. Util::backquote($cfgRelation['db']) . "."
. Util::backquote($cfgRelation['pdf_pages'])
@ -112,7 +117,6 @@ class Designer
DatabaseInterface::QUERY_STORE
);
$result = [];
while ($curr_page = $this->dbi->fetchAssoc($page_rs)) {
$result[intval($curr_page['page_nr'])] = $curr_page['page_descr'];
}
@ -162,7 +166,7 @@ class Designer
$cfgRelation = $this->relation->getRelationsParam();
if ($GLOBALS['cfgRelation']['designersettingswork']) {
if ($cfgRelation['designersettingswork']) {
$query = 'SELECT `settings_data` FROM '
. Util::backquote($cfgRelation['db']) . '.'
. Util::backquote($cfgRelation['designer_settings'])

View File

@ -470,9 +470,9 @@ class Common
}
$query = "DELETE FROM "
. Util::backquote($GLOBALS['cfgRelation']['db'])
. Util::backquote($cfgRelation['db'])
. "." . Util::backquote(
$GLOBALS['cfgRelation']['table_coords']
$cfgRelation['table_coords']
)
. " WHERE `pdf_page_number` = '" . $pageId . "'";
@ -494,8 +494,8 @@ class Common
}
$query = "INSERT INTO "
. Util::backquote($GLOBALS['cfgRelation']['db']) . "."
. Util::backquote($GLOBALS['cfgRelation']['table_coords'])
. Util::backquote($cfgRelation['db']) . "."
. Util::backquote($cfgRelation['table_coords'])
. " (`db_name`, `table_name`, `pdf_page_number`, `x`, `y`)"
. " VALUES ("
. "'" . $this->dbi->escapeString($DB) . "', "
@ -770,7 +770,7 @@ class Common
{
$cfgRelation = $this->relation->getRelationsParam();
$success = true;
if ($GLOBALS['cfgRelation']['designersettingswork']) {
if ($cfgRelation['designersettingswork']) {
$cfgDesigner = [
'user' => $GLOBALS['cfg']['Server']['user'],
'db' => $cfgRelation['db'],

View File

@ -227,7 +227,11 @@ class File
*/
public function isUploaded(): bool
{
return is_uploaded_file($this->getName());
if (! is_string($this->getName())) {
return false;
} else {
return is_uploaded_file($this->getName());
}
}
/**

View File

@ -414,7 +414,7 @@ class NodeDatabase extends Node
{
$db = $this->realName;
$cfgRelation = $this->relation->getRelationsParam();
if (empty($cfgRelation['navigationhiding'])) {
if (! $cfgRelation['navwork']) {
return [];
}
$navTable = Util::backquote($cfgRelation['db'])

View File

@ -390,6 +390,10 @@ class RecentFavoriteTable
private function _getPmaTable(): ?string
{
$cfgRelation = $this->relation->getRelationsParam();
if (! $cfgRelation['recentwork']) {
return null;
}
if (! empty($cfgRelation['db'])
&& ! empty($cfgRelation[$this->_tableType])
) {

View File

@ -606,74 +606,112 @@ class Relation
$this->dbi->freeResult($tab_rs);
if (isset($cfgRelation['relation'])) {
$cfgRelation['relwork'] = true;
if ($this->canAccessStorageTable($cfgRelation['relation'])) {
$cfgRelation['relwork'] = true;
}
}
if (isset($cfgRelation['relation']) && isset($cfgRelation['table_info'])) {
$cfgRelation['displaywork'] = true;
if ($this->canAccessStorageTable($cfgRelation['table_info'])) {
$cfgRelation['displaywork'] = true;
}
}
if (isset($cfgRelation['table_coords']) && isset($cfgRelation['pdf_pages'])) {
$cfgRelation['pdfwork'] = true;
if ($this->canAccessStorageTable($cfgRelation['table_coords'])) {
if ($this->canAccessStorageTable($cfgRelation['pdf_pages'])) {
$cfgRelation['pdfwork'] = true;
}
}
}
if (isset($cfgRelation['column_info'])) {
$cfgRelation['commwork'] = true;
// phpMyAdmin 4.3+
// Check for input transformations upgrade.
$cfgRelation['mimework'] = $this->tryUpgradeTransformations();
if ($this->canAccessStorageTable($cfgRelation['column_info'])) {
$cfgRelation['commwork'] = true;
// phpMyAdmin 4.3+
// Check for input transformations upgrade.
$cfgRelation['mimework'] = $this->tryUpgradeTransformations();
}
}
if (isset($cfgRelation['history'])) {
$cfgRelation['historywork'] = true;
if ($this->canAccessStorageTable($cfgRelation['history'])) {
$cfgRelation['historywork'] = true;
}
}
if (isset($cfgRelation['recent'])) {
$cfgRelation['recentwork'] = true;
if ($this->canAccessStorageTable($cfgRelation['recent'])) {
$cfgRelation['recentwork'] = true;
}
}
if (isset($cfgRelation['favorite'])) {
$cfgRelation['favoritework'] = true;
if ($this->canAccessStorageTable($cfgRelation['favorite'])) {
$cfgRelation['favoritework'] = true;
}
}
if (isset($cfgRelation['table_uiprefs'])) {
$cfgRelation['uiprefswork'] = true;
if ($this->canAccessStorageTable($cfgRelation['table_uiprefs'])) {
$cfgRelation['uiprefswork'] = true;
}
}
if (isset($cfgRelation['tracking'])) {
$cfgRelation['trackingwork'] = true;
if ($this->canAccessStorageTable($cfgRelation['tracking'])) {
$cfgRelation['trackingwork'] = true;
}
}
if (isset($cfgRelation['userconfig'])) {
$cfgRelation['userconfigwork'] = true;
if ($this->canAccessStorageTable($cfgRelation['userconfig'])) {
$cfgRelation['userconfigwork'] = true;
}
}
if (isset($cfgRelation['bookmark'])) {
$cfgRelation['bookmarkwork'] = true;
if ($this->canAccessStorageTable($cfgRelation['bookmark'])) {
$cfgRelation['bookmarkwork'] = true;
}
}
if (isset($cfgRelation['users']) && isset($cfgRelation['usergroups'])) {
$cfgRelation['menuswork'] = true;
if ($this->canAccessStorageTable($cfgRelation['users'])) {
if ($this->canAccessStorageTable($cfgRelation['usergroups'])) {
$cfgRelation['menuswork'] = true;
}
}
}
if (isset($cfgRelation['navigationhiding'])) {
$cfgRelation['navwork'] = true;
if ($this->canAccessStorageTable($cfgRelation['navigationhiding'])) {
$cfgRelation['navwork'] = true;
}
}
if (isset($cfgRelation['savedsearches'])) {
$cfgRelation['savedsearcheswork'] = true;
if ($this->canAccessStorageTable($cfgRelation['savedsearches'])) {
$cfgRelation['savedsearcheswork'] = true;
}
}
if (isset($cfgRelation['central_columns'])) {
$cfgRelation['centralcolumnswork'] = true;
if ($this->canAccessStorageTable($cfgRelation['central_columns'])) {
$cfgRelation['centralcolumnswork'] = true;
}
}
if (isset($cfgRelation['designer_settings'])) {
$cfgRelation['designersettingswork'] = true;
if ($this->canAccessStorageTable($cfgRelation['designer_settings'])) {
$cfgRelation['designersettingswork'] = true;
}
}
if (isset($cfgRelation['export_templates'])) {
$cfgRelation['exporttemplateswork'] = true;
if ($this->canAccessStorageTable($cfgRelation['export_templates'])) {
$cfgRelation['exporttemplateswork'] = true;
}
}
$allWorks = true;
@ -708,6 +746,22 @@ class Relation
return $cfgRelation;
}
/**
* Check if the table is accessible
*
* @param string $tableDbName The table or table.db
* @return boolean The table is accessible
*/
public function canAccessStorageTable($tableDbName)
{
$result = $this->queryAsControlUser(
'SELECT NULL FROM ' . $tableDbName . ' LIMIT 0',
false,
DatabaseInterface::QUERY_STORE
);
return $result !== false;
}
/**
* Check whether column_info table input transformation
* upgrade is required and try to upgrade silently

View File

@ -54,7 +54,7 @@ $serverPrivileges = new Privileges($template, $dbi, $relation, $relationCleanup)
if ((isset($_GET['viewing_mode'])
&& $_GET['viewing_mode'] == 'server')
&& $GLOBALS['cfgRelation']['menuswork']
&& $cfgRelation['menuswork']
) {
$response->addHTML('<div>');
$response->addHTML(Users::getHtmlForSubMenusOnUsersPage('server_privileges.php'));

View File

@ -27,8 +27,8 @@ $dbi = $containerBuilder->get(DatabaseInterface::class);
/** @var Relation $relation */
$relation = $containerBuilder->get('relation');
$relation->getRelationsParam();
if (! $GLOBALS['cfgRelation']['menuswork']) {
$cfgRelation = $relation->getRelationsParam();
if (! $cfgRelation['menuswork']) {
exit;
}

View File

@ -188,7 +188,7 @@ class TrackingTest extends TestBase
$ele = $this->waitForElement(
'cssSelector',
'table#versions tbody tr:nth-child(1) td:nth-child(7)'
'table#versions tbody tr:nth-child(1) td:nth-child(7) a'
);
$this->moveto($ele);
$this->click();