diff --git a/ChangeLog b/ChangeLog index 3261e05ee1..1fdbbe9608 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,10 @@ phpMyAdmin - ChangeLog ====================== +3.5.0.0 (not yet released) + +3.4.1.0 (not yet released) + 3.4.0.0 (not yet released) + rfe #2890226 [view] Enable VIEW rename + rfe #838637 [privileges] Export a user's privileges @@ -154,6 +158,7 @@ - bug #3134495 [synchronization] Data containing single quotes prevents sync, thanks to jviewer - Remove the custom color picker feature +- bug #3285929 [privileges] Don't fail silently on missing priviledge to execute REVOKE ALL PRIVILEGES 3.3.11.0 (not yet released) diff --git a/Documentation.html b/Documentation.html index b928cb7dd7..cee6a4211e 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-rc2-dev - Documentation + phpMyAdmin 3.5.0-dev - Documentation @@ -17,7 +17,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78 diff --git a/README b/README index 3b3f355d2d..bbc7762236 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ phpMyAdmin - Readme =================== -Version 3.4.0-rc2-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/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 558766407e..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 @@ -349,11 +349,6 @@ if ($db == 'information_schema') { } if (!$is_information_schema) { - ?> -
- -
- +
+ +
+ ' . "\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 29b32f467c..34c85eed3f 100644 --- a/db_qbe.php +++ b/db_qbe.php @@ -18,26 +18,29 @@ $cfgRelation = PMA_getRelationsParam(); /** - * A query has been submitted -> execute it, else display the headers + * A query has been submitted -> (maybe) execute it */ +$message_to_display = false; if (isset($_REQUEST['submit_sql']) && ! empty($sql_query)) { - $goto = 'db_sql.php'; - $message_to_show = htmlspecialchars(__('Your SQL query has been executed successfully')); - require './sql.php'; - exit; -} else { - $sub_part = '_qbe'; - require './libraries/db_common.inc.php'; - $url_query .= '&goto=db_qbe.php'; - $url_params['goto'] = 'db_qbe.php'; - require './libraries/db_info.inc.php'; + if (! preg_match('@^SELECT@i', $sql_query)) { + $message_to_display = true; + } else { + $goto = 'db_sql.php'; + require './sql.php'; + exit; + } } -if (isset($_REQUEST['submit_sql']) - && ! preg_match('@^SELECT@i', $sql_query)) { - PMA_Message::warning(__('You have to choose at least one column to display'))->display(); -} +$sub_part = '_qbe'; +require './libraries/db_common.inc.php'; +$url_query .= '&goto=db_qbe.php'; +$url_params['goto'] = 'db_qbe.php'; +require './libraries/db_info.inc.php'; +if ($message_to_display) { + PMA_Message::error(__('You have to choose at least one column to display'))->display(); +} +unset($message_to_display); /** * Initialize some variables @@ -336,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 { @@ -494,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])) { @@ -664,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++) { @@ -926,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/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/js/functions.js b/js/functions.js index 6894e15a48..572c857501 100644 --- a/js/functions.js +++ b/js/functions.js @@ -705,19 +705,13 @@ function setCheckboxes( container_id, state ) { * * @param string the form name * @param string the element name - * @param boolean whether to check or to uncheck the element + * @param boolean whether to check or to uncheck options * * @return boolean always true */ function setSelectOptions(the_form, the_select, do_check) { - - if( do_check ) { - $("form[name='"+ the_form +"']").find("select[name='"+the_select+"']").find("option").attr('selected', 'selected'); - } - else { - $("form[name='"+ the_form +"']").find("select[name="+the_select+"]").find("option").removeAttr('selected'); - } + $("form[name='"+ the_form +"'] select[name='"+the_select+"']").find("option").attr('selected', do_check); return true; } // end of the 'setSelectOptions()' function @@ -1124,25 +1118,32 @@ function changeMIMEType(db, table, reference, mime_type) * Jquery Coding for inline editing SQL_QUERY */ $(document).ready(function(){ - var oldText,db,table,token,sql_query; - oldText=$(".inner_sql").html(); - $("#inline_edit").live('click',function(){ - db=$("input[name='db']").val(); - table=$("input[name='table']").val(); - token=$("input[name='token']").val(); - sql_query=$("input[name='sql_query']").val(); - $(".inner_sql").replaceWith(""); + $(".inline_edit_sql").click( function(){ + var db = $(this).prev().find("input[name='db']").val(); + var table = $(this).prev().find("input[name='table']").val(); + var token = $(this).prev().find("input[name='token']").val(); + var sql_query = $(this).prev().find("input[name='sql_query']").val(); + var $inner_sql = $(this).parent().prev().find('.inner_sql'); + var old_text = $inner_sql.html(); + + var new_content = "\n"; + new_content += "\n"; + new_content += "\n"; + $inner_sql.replaceWith(new_content); + $(".btnSave").each(function(){ + $(this).click(function(){ + sql_query = $(this).prev().val(); + window.location.replace("import.php?db=" + db +"&table=" + table + "&sql_query=" + sql_query + "&show_query=1&token=" + token); + }); + }); + $(".btnDiscard").each(function(){ + $(this).click(function(){ + $(this).closest(".sql").html("" + old_text + ""); + }); + }); return false; }); - $("#btnSave").live("click",function(){ - window.location.replace("import.php?db=" + db +"&table=" + table + "&sql_query=" + $("#sql_query_edit").val()+"&show_query=1&token=" + token + ""); - }); - - $("#btnDiscard").live("click",function(){ - $(".sql").html("" + oldText + ""); - }); - $('.sqlbutton').click(function(evt){ insertQuery(evt.target.id); return false; diff --git a/js/sql.js b/js/sql.js index 77717a727d..bd068cf4b8 100644 --- a/js/sql.js +++ b/js/sql.js @@ -274,6 +274,8 @@ $(document).ready(function() { $('#sqlqueryresults').show(); // this happens if a USE command was typed if (typeof data.reload != 'undefined') { + // Unbind the submit event before reloading. See bug #3295529 + $("#sqlqueryform.ajax").die('submit'); $form.find('input[name=db]').val(data.db); // need to regenerate the whole upper part $form.find('input[name=ajax_request]').remove(); diff --git a/js/tbl_change.js b/js/tbl_change.js index 2d33884a90..8fc7eca337 100644 --- a/js/tbl_change.js +++ b/js/tbl_change.js @@ -165,7 +165,7 @@ function verificationsAfterFieldChange(urlField, multi_edit, theType){ // Unchecks the Ignore checkbox for the current row $("input[name='insert_ignore_" + multi_edit + "']").attr({'checked': false}); - $this_input = $("input[name='fields[multi_edit][" + multi_edit + "][" + urlField + "]']"); + var $this_input = $("input[name='fields[multi_edit][" + multi_edit + "][" + urlField + "]']"); // Does this field come from datepicker? if ($this_input.data('comes_from') == 'datepicker') { @@ -214,11 +214,11 @@ function verificationsAfterFieldChange(urlField, multi_edit, theType){ } } //validate for integer type - if(theType.substring(0,3)=="int"){ - - if(isNaN(dt.value)){ - dt.className="invalid_value"; - return false; + if(theType.substring(0,3) == "int"){ + $this_input.removeClass("invalid_value"); + if(isNaN($this_input.val())){ + $this_input.addClass("invalid_value"); + return false; } } } @@ -387,7 +387,7 @@ $(document).ready(function() { if ($this_element.is('.textfield')) { // do not remove the 'value' attribute for ENUM columns if ($this_element.closest('tr').find('span.column_type').html() != 'enum') { - $this_element.attr('value', ''); + $this_element.attr('value', $this_element.closest('tr').find('span.default_value').html()); } $this_element .unbind('change') diff --git a/libraries/Config.class.php b/libraries/Config.class.php index 85fa390d42..f71a4e91fa 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -96,7 +96,7 @@ class PMA_Config */ function checkSystem() { - $this->set('PMA_VERSION', '3.4.0-rc2-dev'); + $this->set('PMA_VERSION', '3.5.0-dev'); /** * @deprecated */ @@ -148,7 +148,7 @@ class PMA_Config { if (PMA_getenv('HTTP_USER_AGENT')) { $HTTP_USER_AGENT = PMA_getenv('HTTP_USER_AGENT'); - } elseif (!isset($HTTP_USER_AGENT)) { + } elseif (! isset($HTTP_USER_AGENT)) { $HTTP_USER_AGENT = ''; } @@ -441,7 +441,7 @@ class PMA_Config if ($server > 0 && !defined('PMA_MINIMUM_COMMON')) { $config_mtime = max($this->default_source_mtime, $this->source_mtime); // cache user preferences, use database only when needed - if (!isset($_SESSION['cache'][$cache_key]['userprefs']) + if (! isset($_SESSION['cache'][$cache_key]['userprefs']) || $_SESSION['cache'][$cache_key]['config_mtime'] < $config_mtime) { // load required libraries require_once './libraries/user_preferences.lib.php'; @@ -451,7 +451,7 @@ class PMA_Config $_SESSION['cache'][$cache_key]['userprefs_type'] = $prefs['type']; $_SESSION['cache'][$cache_key]['config_mtime'] = $config_mtime; } - } else if ($server == 0 || !isset($_SESSION['cache'][$cache_key]['userprefs'])) { + } else if ($server == 0 || ! isset($_SESSION['cache'][$cache_key]['userprefs'])) { $this->set('user_preferences', false); return; } @@ -476,7 +476,7 @@ class PMA_Config // save theme $tmanager = $_SESSION['PMA_Theme_Manager']; if ($tmanager->getThemeCookie() || isset($_REQUEST['set_theme'])) { - if ((!isset($config_data['ThemeDefault']) && $tmanager->theme->getId() != 'original') + if ((! isset($config_data['ThemeDefault']) && $tmanager->theme->getId() != 'original') || isset($config_data['ThemeDefault']) && $config_data['ThemeDefault'] != $tmanager->theme->getId()) { // new theme was set in common.inc.php $this->setUserValue(null, 'ThemeDefault', $tmanager->theme->getId(), 'original'); @@ -491,14 +491,14 @@ class PMA_Config } // save font size - if ((!isset($config_data['fontsize']) && $org_fontsize != '82%') + if ((! isset($config_data['fontsize']) && $org_fontsize != '82%') || isset($config_data['fontsize']) && $org_fontsize != $config_data['fontsize']) { $this->setUserValue(null, 'fontsize', $org_fontsize, '82%'); } // save language if (isset($_COOKIE['pma_lang']) || isset($_POST['lang'])) { - if ((!isset($config_data['lang']) && $GLOBALS['lang'] != 'en') + if ((! isset($config_data['lang']) && $GLOBALS['lang'] != 'en') || isset($config_data['lang']) && $GLOBALS['lang'] != $config_data['lang']) { $this->setUserValue(null, 'lang', $GLOBALS['lang'], 'en'); } @@ -511,7 +511,7 @@ class PMA_Config // save connection collation if (isset($_COOKIE['pma_collation_connection']) || isset($_POST['collation_connection'])) { - if ((!isset($config_data['collation_connection']) && $GLOBALS['collation_connection'] != 'utf8_general_ci') + if ((! isset($config_data['collation_connection']) && $GLOBALS['collation_connection'] != 'utf8_general_ci') || isset($config_data['collation_connection']) && $GLOBALS['collation_connection'] != $config_data['collation_connection']) { $this->setUserValue(null, 'collation_connection', $GLOBALS['collation_connection'], 'utf8_general_ci'); } @@ -678,7 +678,7 @@ class PMA_Config */ function set($setting, $value) { - if (!isset($this->settings[$setting]) || $this->settings[$setting] != $value) { + if (! isset($this->settings[$setting]) || $this->settings[$setting] != $value) { $this->settings[$setting] = $value; $this->set_mtime = time(); } diff --git a/libraries/Index.class.php b/libraries/Index.class.php index 6fc0bec097..ee266aa137 100644 --- a/libraries/Index.class.php +++ b/libraries/Index.class.php @@ -424,7 +424,7 @@ class PMA_Index $indexes = PMA_Index::getFromTable($table, $schema); if (count($indexes) < 1) { - return PMA_Message::warning(__('No index defined!'))->getDisplay(); + return PMA_Message::error(__('No index defined!'))->getDisplay(); } $r = ''; @@ -576,7 +576,7 @@ class PMA_Index // did not find any difference // so it makes no sense to have this two equal indexes - $message = PMA_Message::warning(__('The indexes %1$s and %2$s seem to be equal and one of them could possibly be removed.')); + $message = PMA_Message::error(__('The indexes %1$s and %2$s seem to be equal and one of them could possibly be removed.')); $message->addParam($each_index->getName()); $message->addParam($while_index->getName()); $output .= $message->getDisplay(); diff --git a/libraries/List_Database.class.php b/libraries/List_Database.class.php index 3354a1e8eb..2663673a4f 100644 --- a/libraries/List_Database.class.php +++ b/libraries/List_Database.class.php @@ -371,7 +371,7 @@ require_once './libraries/List.class.php'; $return = '