diff --git a/.gitignore b/.gitignore index a773f8e3e7..b492910cc1 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,5 @@ locale sources # API documentation apidoc +# Demo server +revision-info.php diff --git a/ChangeLog b/ChangeLog index 5a15934e76..3935ec69ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,36 @@ phpMyAdmin - ChangeLog ====================== -3.4.0.0 (not yet released) +3.5.0.0 (not yet released) ++ rfe #2021981 [interface] Add support for mass prefix change. ++ "up to date" message on main page when current version is up to date ++ Update to jQuery 1.6.1 ++ Patch #3256122 [search] Show/hide db search results ++ Patch #3302354 Add gettext wrappers around a message ++ Remove deprecated function PMA_DBI_get_fields + +3.4.2.0 (not yet released) +- bug #3301249 [interface] Iconic table operations does not remove inline edit label +- bug #3303869 [interface] Unnecessary scrolling on Databases page +- patch #3303813 [setup] Define a label that was missing +- bug #3305606 [interface] Show all button wraps on privileges page +- bug #3305517 [config] Config for export compression not used +- bug #3305883 [interface] Table is dropped regardless of confirmation +- [auth] Fixed error handling for signon auth method. +- bug #3276001 [core] Avoid caching of index.php. +- bug #3306958 [interface] Unnecessary Details slider + +3.4.1.0 (2011-05-20) +- bug #3301108 [interface] Synchronize and already configured host +- bug #3302457 Inline edit and $cfg['PropertiesIconic'] +- Patch #3302313 Show a translated label +- bug #3300981 [navi] Table filter is case sensitive +- bug #3285929 [privileges] Revert temporary fix +- bug #3302872 [synchronize] Synchronize and user name +- bug #3302733 [core] Some browsers report an insecure https connection +- [security] Make redirector require valid token + +3.4.0.0 (2011-05-11) + rfe #2890226 [view] Enable VIEW rename + rfe #838637 [privileges] Export a user's privileges - [core] Updated mootools to fix some glitches with Safari. @@ -158,6 +187,9 @@ 3.3.11.0 (not yet released) +3.3.10.1 (2011-05-20) +- [security] XSS on Tracking page + 3.3.10.0 (2011-03-19) - patch #3147400 [structure] Aria table size printed as unknown, thanks to erickoh75 - erickoh75 diff --git a/Documentation.html b/Documentation.html index aa3df7f7a5..3bbb832dd4 100644 --- a/Documentation.html +++ b/Documentation.html @@ -9,7 +9,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78 - phpMyAdmin 3.4.0-rc3-dev - Documentation + phpMyAdmin 3.5.0-dev - Documentation @@ -17,7 +17,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78 @@ -1054,6 +1054,29 @@ ALTER TABLE `pma_column_comments` +
+ $cfg['Servers'][$i]['recent'] string +
+
+ Since release 3.5.0 you can show recently used tables in the left navigation frame. + It helps you to jump across table directly, without the need to select the database, + and then select the table. Using + $cfg['LeftRecentTable'] + you can configure the maximum number of recent tables shown. When you select a table + from the list, it will jump to the page specified in + $cfg['LeftDefaultTabTable'].

+ + Without configuring the storage, you can still access the recently used tables, + but it will disappear after you logout.

+ + To allow the usage of this functionality: + + +
+
$cfg['Servers'][$i]['tracking'] string
@@ -1280,6 +1303,8 @@ CREATE DATABASE,ALTER DATABASE,DROP DATABASE
$cfg['Servers'][$i]['SignonSession'] string
Name of session which will be used for signon authentication method. + You should use something different than phpMyAdmin, because + this is session which phpMyAdmin uses internally.
$cfg['Servers'][$i]['SignonURL'] string
URL where user will be redirected to log in for signon authentication method. Should be absolute including protocol. @@ -1467,6 +1492,10 @@ CREATE DATABASE,ALTER DATABASE,DROP DATABASE
Defines how many sublevels should be displayed when splitting up tables by the above separator.
+
$cfg['LeftRecentTable'] integer
+
The maximum number of recently used tables shown in the left navigation + frame. Set this to 0 (zero) to disable the listing of recent tables.
+
$cfg['ShowTooltip'] boolean
Defines whether to display table comment as tool-tip in left frame or not.
diff --git a/README b/README index 1504628d27..bbc7762236 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ phpMyAdmin - Readme =================== -Version 3.4.0-rc3-dev +Version 3.5.0-dev A set of PHP-scripts to manage MySQL over the web. diff --git a/browse_foreigners.php b/browse_foreigners.php index c8867af3f0..16fa48c822 100644 --- a/browse_foreigners.php +++ b/browse_foreigners.php @@ -27,7 +27,7 @@ $foreigners = ($cfgRelation['relwork'] ? PMA_getForeigners($db, $table) : FALSE $override_total = TRUE; -if (!isset($pos)) { +if (! isset($pos)) { $pos = 0; } diff --git a/config.sample.inc.php b/config.sample.inc.php index 2cf344dcaf..138dadad6e 100644 --- a/config.sample.inc.php +++ b/config.sample.inc.php @@ -52,6 +52,7 @@ $cfg['Servers'][$i]['AllowNoPassword'] = false; // $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages'; // $cfg['Servers'][$i]['column_info'] = 'pma_column_info'; // $cfg['Servers'][$i]['history'] = 'pma_history'; +// $cfg['Servers'][$i]['recent'] = 'pma_recent'; // $cfg['Servers'][$i]['tracking'] = 'pma_tracking'; // $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords'; // $cfg['Servers'][$i]['userconfig'] = 'pma_userconfig'; diff --git a/db_datadict.php b/db_datadict.php index e67c096c3e..e9d18fdf1e 100644 --- a/db_datadict.php +++ b/db_datadict.php @@ -10,7 +10,7 @@ */ require_once './libraries/common.inc.php'; -if (!isset($selected_tbl)) { +if (! isset($selected_tbl)) { require_once './libraries/header.inc.php'; } @@ -220,7 +220,7 @@ while ($row = PMA_DBI_fetch_assoc($rowset)) { if ($zerofill) { $attribute = 'UNSIGNED ZEROFILL'; } - if (!isset($row['Default'])) { + if (! isset($row['Default'])) { if ($row['Null'] != 'NO') { $row['Default'] = 'NULL'; } diff --git a/db_operations.php b/db_operations.php index f48ba27678..2e0244f0ef 100644 --- a/db_operations.php +++ b/db_operations.php @@ -37,7 +37,7 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) { $move = false; } - if (!isset($newname) || !strlen($newname)) { + if (! isset($newname) || ! strlen($newname)) { $message = PMA_Message::error(__('The database name is empty!')); } else { $sql_query = ''; // in case target db exists @@ -561,7 +561,7 @@ echo __('Remove database'); . '' . "\n"; if ($num_tables > 0 - && !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) { + && ! $cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) { $message = PMA_Message::notice(__('The phpMyAdmin configuration storage has been deactivated. To find out why click %shere%s.')); $message->addParam('', false); $message->addParam('', false); diff --git a/db_printview.php b/db_printview.php index 36f297c994..7e3c709935 100644 --- a/db_printview.php +++ b/db_printview.php @@ -52,7 +52,7 @@ if ($cfg['SkipLockedTables'] == true) { $result = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($db) . ';', null, PMA_DBI_QUERY_STORE); if ($result != false && PMA_DBI_num_rows($result) > 0) { while ($tmp = PMA_DBI_fetch_row($result)) { - if (!isset($sot_cache[$tmp[0]])) { + if (! isset($sot_cache[$tmp[0]])) { $sts_result = PMA_DBI_query('SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . addslashes($tmp[0]) . '\';'); $sts_tmp = PMA_DBI_fetch_assoc($sts_result); $tables[] = $sts_tmp; diff --git a/db_qbe.php b/db_qbe.php index 751317d111..a076798741 100644 --- a/db_qbe.php +++ b/db_qbe.php @@ -105,7 +105,7 @@ if (0 == $tbl_result_cnt) { // The tables list gets from MySQL while (list($tbl) = PMA_DBI_fetch_row($tbl_result)) { - $fld_results = PMA_DBI_get_fields($db, $tbl); + $fld_results = PMA_DBI_get_columns($db, $tbl, true); if (empty($tbl_names[$tbl]) && !empty($_REQUEST['TableList'])) { $tbl_names[$tbl] = ''; @@ -339,7 +339,7 @@ for ($x = 0; $x < $col; $x++) { if (isset($criteria[$x])) { $tmp_criteria = $criteria[$x]; } - if ((empty($prev_criteria) || !isset($prev_criteria[$x])) + if ((empty($prev_criteria) || ! isset($prev_criteria[$x])) || $prev_criteria[$x] != htmlspecialchars($tmp_criteria)) { $curCriteria[$z] = $tmp_criteria; } else { @@ -497,7 +497,7 @@ for ($y = 0; $y <= $row; $y++) { echo "\n"; $or = 'Or' . $y; - if (!isset(${$or})) { + if (! isset(${$or})) { ${$or} = ''; } if (!empty(${$or}) && isset(${$or}[$x])) { @@ -667,7 +667,7 @@ foreach ($tbl_names as $key => $val) { 1) { $qry_where = '(' . $qry_where . ')'; } // OR rows ${'cur' . $or}[$x] -if (!isset($curAndOrRow)) { +if (! isset($curAndOrRow)) { $curAndOrRow = array(); } for ($y = 0; $y <= $row; $y++) { @@ -929,7 +929,7 @@ if (!empty($qry_where) && $qry_where != '()') { // 4. ORDER BY $last_orderby = 0; -if (!isset($qry_orderby)) { +if (! isset($qry_orderby)) { $qry_orderby = ''; } for ($x = 0; $x < $col; $x++) { diff --git a/db_structure.php b/db_structure.php index 6f318f195e..2032ed2931 100644 --- a/db_structure.php +++ b/db_structure.php @@ -518,6 +518,12 @@ if (!$db_is_information_schema) { . __('Repair table') . '' . "\n"; echo ' ' . "\n"; + echo ' ' . "\n"; + echo ' ' . "\n"; + echo ' ' . "\n"; } ?> diff --git a/export.php b/export.php index 7da25fc051..22a6324261 100644 --- a/export.php +++ b/export.php @@ -21,7 +21,7 @@ $export_list = PMA_getPlugins('./libraries/export/', array('export_type' => $exp $type = $what; // Check export type -if (!isset($export_list[$type])) { +if (! isset($export_list[$type])) { die('Bad type!'); } @@ -451,7 +451,7 @@ if ($export_type == 'server') { // Walk over databases foreach ($GLOBALS['pma']->databases as $current_db) { if ((isset($tmp_select) && strpos(' ' . $tmp_select, '|' . $current_db . '|')) - || !isset($tmp_select)) { + || ! isset($tmp_select)) { if (!PMA_exportDBHeader($current_db)) { break 2; } diff --git a/import.php b/import.php index 78e5ffdb4a..0b029e5c2f 100644 --- a/import.php +++ b/import.php @@ -332,7 +332,7 @@ if ($import_file != 'none' && !$error) { $error = TRUE; } } elseif (!$error) { - if (!isset($import_text) || empty($import_text)) { + if (! isset($import_text) || empty($import_text)) { $message = PMA_Message::error(__('No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration. See [a@./Documentation.html#faq1_16@Documentation]FAQ 1.16[/a].')); $error = TRUE; } diff --git a/index.php b/index.php index 5d197586ca..66f6bf5545 100644 --- a/index.php +++ b/index.php @@ -89,7 +89,7 @@ $lang_iso_code = $GLOBALS['available_languages'][$GLOBALS['lang']][1]; // start output -header('Content-Type: text/html; charset=' . $GLOBALS['charset']); +include ('./libraries/header_http.inc.php'); ?> @@ -153,7 +153,7 @@ header('Content-Type: text/html; charset=' . $GLOBALS['charset']); // ]]> diff --git a/js/config.js b/js/config.js index 7f55503f5f..a753034cc0 100644 --- a/js/config.js +++ b/js/config.js @@ -1,3 +1,4 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ /** * Functions used in configuration forms and on user preferences pages */ @@ -14,9 +15,9 @@ var PMA_messages = {}; * @param {Element} field */ function getFieldType(field) { - field = $(field); - var tagName = field.attr('tagName'); - if (tagName == 'INPUT') { + field = $(field); + var tagName = field.prop('tagName'); + if (tagName == 'INPUT') { return field.attr('type'); } else if (tagName == 'SELECT') { return 'select'; @@ -40,7 +41,7 @@ function getFieldType(field) { * @param {String|Boolean} [value] */ function setFieldValue(field, field_type, value) { - field = $(field); + field = $(field); switch (field_type) { case 'text': field.attr('value', (value != undefined ? value : field.attr('defaultValue'))); @@ -50,14 +51,14 @@ function setFieldValue(field, field_type, value) { break; case 'select': var options = field.attr('options'); - var i, imax = options.length; + var i, imax = options.length; if (value == undefined) { for (i = 0; i < imax; i++) { - options[i].selected = options[i].defaultSelected; + options[i].selected = options[i].defaultSelected; } } else { for (i = 0; i < imax; i++) { - options[i].selected = (value.indexOf(options[i].value) != -1); + options[i].selected = (value.indexOf(options[i].value) != -1); } } break; @@ -78,14 +79,14 @@ function setFieldValue(field, field_type, value) { * @type Boolean|String|String[] */ function getFieldValue(field, field_type) { - field = $(field); + field = $(field); switch (field_type) { case 'text': - return field.attr('value'); + return field.prop('value'); case 'checkbox': - return field.attr('checked'); + return field.prop('checked'); case 'select': - var options = field.attr('options'); + var options = field.prop('options'); var i, imax = options.length, items = []; for (i = 0; i < imax; i++) { if (options[i].selected) { @@ -354,7 +355,7 @@ function displayErrors(error_list) { * @param {Object} errors */ function validate_fieldset(fieldset, isKeyUp, errors) { - fieldset = $(fieldset); + fieldset = $(fieldset); if (fieldset.length && typeof validators._fieldset[fieldset.attr('id')] != 'undefined') { var fieldset_errors = validators._fieldset[fieldset.attr('id')].apply(fieldset[0], [isKeyUp]); for (var field_id in fieldset_errors) { @@ -377,8 +378,8 @@ function validate_fieldset(fieldset, isKeyUp, errors) { * @param {Object} errors */ function validate_field(field, isKeyUp, errors) { - field = $(field); - var field_id = field.attr('id'); + field = $(field); + var field_id = field.attr('id'); errors[field_id] = []; var functions = getFieldValidators(field_id, isKeyUp); for (var i = 0; i < functions.length; i++) { @@ -389,7 +390,7 @@ function validate_field(field, isKeyUp, errors) { var result = functions[i][0].apply(field[0], args); if (result !== true) { if (typeof result == 'string') { - result = [result]; + result = [result]; } $.merge(errors[field_id], result); } @@ -403,7 +404,7 @@ function validate_field(field, isKeyUp, errors) { * @param {boolean} isKeyUp */ function validate_field_and_fieldset(field, isKeyUp) { - field = $(field); + field = $(field); var errors = {}; validate_field(field, isKeyUp, errors); validate_fieldset(field.closest('fieldset'), isKeyUp, errors); @@ -416,7 +417,7 @@ function validate_field_and_fieldset(field, isKeyUp) { * @param {Element} field */ function markField(field) { - field = $(field); + field = $(field); var type = getFieldType(field); var isDefault = checkFieldDefault(field, type); @@ -439,7 +440,7 @@ function setRestoreDefaultBtn(field, display) { $(function() { // register validators and mark custom values - var elements = $('input[id], select[id], textarea[id]'); + var elements = $('input[id], select[id], textarea[id]'); $('input[id], select[id], textarea[id]').each(function(){ markField(this); var el = $(this); @@ -450,35 +451,35 @@ $(function() { var tagName = el.attr('tagName'); // text fields can be validated after each change if (tagName == 'INPUT' && el.attr('type') == 'text') { - el.keyup(function() { + el.keyup(function() { validate_field_and_fieldset(el, true); markField(el); }); } // disable textarea spellcheck if (tagName == 'TEXTAREA') { - el.attr('spellcheck', false); + el.attr('spellcheck', false); } }); - // check whether we've refreshed a page and browser remembered modified - // form values - var check_page_refresh = $('#check_page_refresh'); - if (check_page_refresh.length == 0 || check_page_refresh.val() == '1') { - // run all field validators - var errors = {}; - for (var i = 0; i < elements.length; i++) { - validate_field(elements[i], false, errors); - } - // run all fieldset validators - $('fieldset').each(function(){ - validate_fieldset(this, false, errors); - }); + // check whether we've refreshed a page and browser remembered modified + // form values + var check_page_refresh = $('#check_page_refresh'); + if (check_page_refresh.length == 0 || check_page_refresh.val() == '1') { + // run all field validators + var errors = {}; + for (var i = 0; i < elements.length; i++) { + validate_field(elements[i], false, errors); + } + // run all fieldset validators + $('fieldset').each(function(){ + validate_fieldset(this, false, errors); + }); - displayErrors(errors); - } else if (check_page_refresh) { - check_page_refresh.val('1'); - } + displayErrors(errors); + } else if (check_page_refresh) { + check_page_refresh.val('1'); + } }); // diff --git a/js/db_search.js b/js/db_search.js index 79c444e856..6fff82dec8 100644 --- a/js/db_search.js +++ b/js/db_search.js @@ -20,7 +20,7 @@ function loadResult(result_path , table_name , link , ajaxEnable){ if(ajaxEnable) { /** Hides the results shown by the delete criteria */ - //PMA_ajaxShowMessage(PMA_messages['strBrowsing']); + PMA_ajaxShowMessage(PMA_messages['strBrowsing']); $('#sqlqueryform').hide(); $('#togglequerybox').hide(); /** Load the browse results to the page */ @@ -51,14 +51,14 @@ function deleteResult(result_path , msg , ajaxEnable){ /** Load the deleted option to the page*/ $('#browse-results').load(result_path + " '"+'#result_query' + "'"); $('#sqlqueryform').load(result_path + " '"+'#sqlqueryform' + "'"); - $('#togglequerybox').html(PMA_messages['strHideQueryBox']); + $('#togglequerybox').html(PMA_messages['strShowQueryBox']); /** Refresh the search results after the deletion */ document.getElementById('buttonGo'). click(); - //PMA_ajaxShowMessage(PMA_messages['strDeleting']); + PMA_ajaxShowMessage(PMA_messages['strDeleting']); /** Show the results of the deletion option */ $('#browse-results').show(); - $('#sqlqueryform').show(); + $('#sqlqueryform').hide(); $('#togglequerybox').show(); } else @@ -89,6 +89,31 @@ $(document).ready(function() { $('#sqlqueryform').hide(); $('#togglequerybox').hide(); }); + /** + *Prepare a div containing a link for toggle the search results + */ + $('
') + .insertAfter('#searchresults') + /** don't show it until we have results on-screen */ + .hide(); + + $('
').insertAfter("#togglesearchresultsdiv").show(); + /** Changing the displayed text according to the hide/show criteria in search result forms*/ + + $('#togglesearchresultlink') + .html(PMA_messages['strHideSearchResults']) + .bind('click', function() { + var $link = $(this); + $('#searchresults').slideToggle(); + if ($link.text() == PMA_messages['strHideSearchResults']) { + $link.text(PMA_messages['strShowSearchResults']); + } else { + $link.text(PMA_messages['strHideSearchResults']); + } + /** avoid default click action */ + return false; + }); + /** * Prepare a div containing a link for toggle the search form, otherwise it's incorrectly displayed * after a couple of clicks @@ -101,7 +126,7 @@ $(document).ready(function() { /** Changing the displayed text according to the hide/show criteria in search form*/ $("#togglequerybox").hide(); $("#togglequerybox").bind('click', function() { - var $link = $(this) + var $link = $(this); $('#sqlqueryform').slideToggle("medium"); if ($link.text() == PMA_messages['strHideQueryBox']) { $link.text(PMA_messages['strShowQueryBox']); @@ -110,7 +135,7 @@ $(document).ready(function() { } /** avoid default click action */ return false; - }) + }); /** don't show it until we have results on-screen */ @@ -149,6 +174,16 @@ $(document).ready(function() { // found results $("#searchresults").html(response); $("#sqlqueryresults").trigger('appendAnchor'); + + $('#togglesearchresultlink') + // always start with the Show message + .text(PMA_messages['strHideSearchResults']) + $('#togglesearchresultsdiv') + // now it's time to show the div containing the link + .show(); + $('#searchresults').show(); + + $('#db_search_form') // workaround for Chrome problem (bug #3168569) .slideToggle() diff --git a/js/functions.js b/js/functions.js index 52c3c287f4..c9f6112dff 100644 --- a/js/functions.js +++ b/js/functions.js @@ -90,19 +90,23 @@ function parseVersionString (str) { * Indicates current available version on main page. */ function PMA_current_version() { - var current = parseVersionString('3.4.0'/*pmaversion*/); + var current = parseVersionString(pmaversion); var latest = parseVersionString(PMA_latest_version); - $('#li_pma_version').append(PMA_messages['strLatestAvailable'] + ' ' + PMA_latest_version); + var version_information_message = PMA_messages['strLatestAvailable'] + ' ' + PMA_latest_version; if (latest > current) { var message = $.sprintf(PMA_messages['strNewerVersion'], PMA_latest_version, PMA_latest_date); if (Math.floor(latest / 10000) == Math.floor(current / 10000)) { /* Security update */ - klass = 'warning'; + klass = 'error'; } else { klass = 'notice'; } $('#maincontainer').after('
' + message + '
'); } + if (latest == current) { + version_information_message = ' (' + PMA_messages['strUpToDate'] + ')'; + } + $('#li_pma_version').append(version_information_message); } /** @@ -606,7 +610,7 @@ $(document).ready(function() { */ $('tr.odd:not(.noclick), tr.even:not(.noclick)').live('click',function(e) { // do not trigger when clicked on anchor - if ($(e.target).is('a, a *')) { + if ($(e.target).is('a, img, a *')) { return; } // XXX: FF fires two click events for