diff --git a/ChangeLog b/ChangeLog index e404dc60d3..06745bbc90 100644 --- a/ChangeLog +++ b/ChangeLog @@ -56,7 +56,9 @@ VerboseMultiSubmit, ReplaceHelpImg - bug #3547825 [edit] BLOB download no longer works - bug #3541966 [config] Error in generated configuration arrray - bug #3553551 [GUI] Invalid HTML code in multi submits confirmation form -[interface] Designer sometimes places tables on the top menu +- [interface] Designer sometimes places tables on the top menu +- bug #3546277 [core] Call to undefined function __() when config file has wrong permissions +- bug #3540922 [edit] Error searching table with many fields 3.5.2.1 (2012-08-03) - [security] Fixed local path disclosure vulnerability, see PMASA-2012-3 diff --git a/js/tbl_select.js b/js/tbl_select.js index b8c9f386d5..f04b4e3553 100644 --- a/js/tbl_select.js +++ b/js/tbl_select.js @@ -52,7 +52,39 @@ $(function() { PMA_prepareForAjaxRequest($search_form); - $.post($search_form.attr('action'), $search_form.serialize(), function(data) { + var values = {}; + $search_form.find(':input').each(function() { + var $input = $(this); + if ($input.attr('type') == 'checkbox' || $input.attr('type') == 'radio') { + if ($input.is(':checked')) { + values[this.name] = $input.val(); + } + } else { + values[this.name] = $input.val(); + } + }); + var columnCount = $('select[name="columnsToDisplay[]"] option').length; + // Submit values only for the columns that have a search criteria + for (var a = 0; a < columnCount; a++) { + if (values['criteriaValues[' + a + ']'] == '') { + delete values['criteriaValues[' + a + ']']; + delete values['criteriaColumnOperators[' + a + ']']; + delete values['criteriaColumnNames[' + a + ']']; + delete values['criteriaColumnTypes[' + a + ']']; + delete values['criteriaColumnCollations[' + a + ']']; + } + } + // If all columns are selected, use a single parameter to indicate that + if (values['columnsToDisplay[]'] != null) { + if (values['columnsToDisplay[]'].length == columnCount) { + delete values['columnsToDisplay[]']; + values['displayAllColumns'] = true; + } + } else { + values['displayAllColumns'] = true; + } + + $.post($search_form.attr('action'), values, function(data) { PMA_ajaxRemoveMessage($msgbox); if (data.success == true) { // found results diff --git a/libraries/Config.class.php b/libraries/Config.class.php index 01d47aa670..648f4aab5e 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -634,8 +634,6 @@ class PMA_Config $this->checkPmaAbsoluteUri(); $this->checkFontsize(); - $this->checkPermissions(); - // Handling of the collation must be done after merging of $cfg // (from config.inc.php) so that $cfg['DefaultConnectionCollation'] // can have an effect. Note that the presence of collation diff --git a/libraries/TableSearch.class.php b/libraries/TableSearch.class.php index 13351c6cb1..107efbf712 100644 --- a/libraries/TableSearch.class.php +++ b/libraries/TableSearch.class.php @@ -639,10 +639,9 @@ EOT; if (isset($_POST['zoom_submit'])) { $sql_query .= '* '; } else { - $sql_query .= (count($_POST['columnsToDisplay']) - == count($_POST['criteriaColumnNames']) + $sql_query .= ! empty($_POST['displayAllColumns']) ? '* ' - : implode(', ', $this->getCommonFunctions()->backquote($_POST['columnsToDisplay']))); + : implode(', ', $this->getCommonFunctions()->backquote($_POST['columnsToDisplay'])); } // end if $sql_query .= ' FROM ' . $this->getCommonFunctions()->backquote($_POST['table']); diff --git a/libraries/common.inc.php b/libraries/common.inc.php index 3190eb7ec6..43f29ea686 100644 --- a/libraries/common.inc.php +++ b/libraries/common.inc.php @@ -568,6 +568,8 @@ if ($GLOBALS['text_dir'] == 'ltr') { * check for errors occurred while loading configuration * this check is done here after loading language files to present errors in locale */ +$GLOBALS['PMA_Config']->checkPermissions(); + if ($GLOBALS['PMA_Config']->error_config_file) { $error = '[strong]' . __('Failed to read configuration file') . '[/strong]' . '[br][br]' diff --git a/tbl_select.php b/tbl_select.php index 1e1c615d7b..7bc67d1856 100644 --- a/tbl_select.php +++ b/tbl_select.php @@ -41,7 +41,7 @@ $table_search = new PMA_TableSearch($db, $table, "normal"); /** * Not selection yet required -> displays the selection form */ -if (! isset($_POST['columnsToDisplay']) || $_POST['columnsToDisplay'][0] == '') { +if (! isset($_POST['columnsToDisplay']) && ! isset($_POST['displayAllColumns'])) { // Gets some core libraries include_once 'libraries/tbl_common.inc.php'; //$err_url = 'tbl_select.php' . $err_url;