From 4ca8f9cdc241c732c3fdbb2dcfa562f1d8cc695d Mon Sep 17 00:00:00 2001 From: Chanaka Indrajith Date: Thu, 26 Dec 2013 00:32:43 +0530 Subject: [PATCH 01/13] Added table comment tool tip for tables, listed in database structure page Signed-off-by: Chanaka Indrajith --- libraries/structure.lib.php | 3 ++- test/libraries/PMA_structure_test.php | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php index c27e1c5cb5..791e4d3062 100644 --- a/libraries/structure.lib.php +++ b/libraries/structure.lib.php @@ -52,7 +52,8 @@ function PMA_getHtmlForActionLinks($current_table, $table_is_view, $tbl_url_quer } $search_table .= ''; - $browse_table_label = '' + $browse_table_label = '' . $truename . ''; if (!$db_is_information_schema) { diff --git a/test/libraries/PMA_structure_test.php b/test/libraries/PMA_structure_test.php index 538346be4a..d8adf3d27c 100644 --- a/test/libraries/PMA_structure_test.php +++ b/test/libraries/PMA_structure_test.php @@ -70,6 +70,7 @@ class PMA_Structure_Test extends PHPUnit_Framework_TestCase $current_table = array( 'TABLE_ROWS' => 3, 'TABLE_NAME' => 'name1', + 'TABLE_COMMENT' => 'This is a test comment' ); $table_is_view = false; $tbl_url_query = 'tbl_url_query'; @@ -136,6 +137,7 @@ class PMA_Structure_Test extends PHPUnit_Framework_TestCase $current_table = array( 'TABLE_ROWS' => 0, 'TABLE_NAME' => 'name1', + 'TABLE_COMMENT' => 'This is a test comment' ); $table_is_view = false; list( From 685c1d3495347e37615b892ace83fd2339408696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Thomsen?= Date: Wed, 1 Jan 2014 06:18:19 -0500 Subject: [PATCH 02/13] bug #4209 Missing compression in one case Signed-off-by: Marc Delisle --- export.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/export.php b/export.php index bd6f9d687f..c65dc91fef 100644 --- a/export.php +++ b/export.php @@ -301,8 +301,9 @@ function PMA_isGzHandlerEnabled() function PMA_gzencodeNeeded() { if (@function_exists('gzencode') - && ! @ini_get('zlib.output_compression') - && ! PMA_isGzHandlerEnabled() + && ((! @ini_get('zlib.output_compression') + && ! PMA_isGzHandlerEnabled()) + || $GLOBALS['save_on_server']) ) { return true; } else { From 69c24b78bb2d7d50a1d205f7ad13468e95d067d8 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Wed, 1 Jan 2014 06:19:39 -0500 Subject: [PATCH 03/13] ChangeLog entry and fix explanation for bug #4209 Signed-off-by: Marc Delisle --- ChangeLog | 1 + export.php | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index f32c68caac..3d7365cbc6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ phpMyAdmin - ChangeLog 4.1.4.0 (not yet released) - bug #3840 (additional fix) When exporting to gzip format, the data is compressed 2 times +- bug #4209 Missing compression in one case 4.1.3.0 (2013-12-31) - bug #3938 PDFDefaultPageSize doc and easy configurability diff --git a/export.php b/export.php index c65dc91fef..18aae1c92f 100644 --- a/export.php +++ b/export.php @@ -300,6 +300,13 @@ function PMA_isGzHandlerEnabled() */ function PMA_gzencodeNeeded() { + /* + * We should gzencode only if the function exists + * but we don't want to compress twice, therefore + * gzencode only if transparent compression is not enabled + * and gz compression was not asked via $cfg['OBGzip'] + * but transparent compression does not apply when saving to server + */ if (@function_exists('gzencode') && ((! @ini_get('zlib.output_compression') && ! PMA_isGzHandlerEnabled()) From 4d13f69f6a5123a68ad10853fe336220133b1a65 Mon Sep 17 00:00:00 2001 From: zz zz Date: Wed, 1 Jan 2014 09:31:20 +0100 Subject: [PATCH 04/13] Translated using Weblate (Simplified Chinese) Currently translated at 93.5% (2573 of 2749) --- po/zh_CN.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/po/zh_CN.po b/po/zh_CN.po index 4bdd7b4b9c..1ff5f21246 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -4,16 +4,16 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.1.3-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2013-12-27 10:57-0500\n" -"PO-Revision-Date: 2013-09-26 20:35+0200\n" -"Last-Translator: Hao Luo \n" -"Language-Team: Simplified Chinese \n" +"PO-Revision-Date: 2014-01-01 09:31+0200\n" +"Last-Translator: zz zz \n" +"Language-Team: Simplified Chinese " +"\n" "Language: zh_CN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 1.7-dev\n" +"X-Generator: Weblate 1.9-dev\n" #: changelog.php:36 license.php:28 #, php-format @@ -411,7 +411,7 @@ msgstr "" #: error_report.php:37 error_report.php:54 error_report.php:65 #: error_report.php:81 msgid "You may want to refresh the page." -msgstr "" +msgstr "您需要刷新当前页面。" #: error_report.php:45 msgid "" From 08fb2d34790792244d1bc20b0e4d6304740c33d3 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Wed, 1 Jan 2014 06:29:52 -0500 Subject: [PATCH 05/13] Fix merge conflicts Signed-off-by: Marc Delisle --- ChangeLog | 1 + libraries/export.lib.php | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index be0bb618b5..73cdf63c04 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,7 @@ phpMyAdmin - ChangeLog 4.1.4.0 (not yet released) - bug #3840 (additional fix) When exporting to gzip format, the data is compressed 2 times +- bug #4209 Missing compression in one case 4.1.3.0 (2013-12-31) - bug #3938 PDFDefaultPageSize doc and easy configurability diff --git a/libraries/export.lib.php b/libraries/export.lib.php index 9c6cf0502a..ad2765a0c6 100644 --- a/libraries/export.lib.php +++ b/libraries/export.lib.php @@ -45,9 +45,17 @@ function PMA_isGzHandlerEnabled() */ function PMA_gzencodeNeeded() { + /* + * We should gzencode only if the function exists + * but we don't want to compress twice, therefore + * gzencode only if transparent compression is not enabled + * and gz compression was not asked via $cfg['OBGzip'] + * but transparent compression does not apply when saving to server + */ if (@function_exists('gzencode') - && ! @ini_get('zlib.output_compression') - && ! PMA_isGzHandlerEnabled() + && ((! @ini_get('zlib.output_compression') + && ! PMA_isGzHandlerEnabled()) + || $GLOBALS['save_on_server']) ) { return true; } else { From 55e3fed500a67fb637542affbdda3a4c836e7aa0 Mon Sep 17 00:00:00 2001 From: zz zz Date: Wed, 1 Jan 2014 09:31:19 +0100 Subject: [PATCH 06/13] Translated using Weblate (Simplified Chinese) Currently translated at 93.3% (2569 of 2751) --- po/zh_CN.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/po/zh_CN.po b/po/zh_CN.po index b51ec3c872..8c2c5c10a7 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -4,16 +4,16 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.2.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2013-12-27 18:16-0500\n" -"PO-Revision-Date: 2013-09-26 20:35+0200\n" -"Last-Translator: Hao Luo \n" -"Language-Team: Simplified Chinese \n" +"PO-Revision-Date: 2014-01-01 09:31+0200\n" +"Last-Translator: zz zz \n" +"Language-Team: Simplified Chinese " +"\n" "Language: zh_CN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 1.7-dev\n" +"X-Generator: Weblate 1.9-dev\n" #: changelog.php:36 license.php:28 #, php-format @@ -411,7 +411,7 @@ msgstr "" #: error_report.php:37 error_report.php:54 error_report.php:65 #: error_report.php:81 msgid "You may want to refresh the page." -msgstr "" +msgstr "您需要刷新当前页面。" #: error_report.php:45 msgid "" From 213d673bb053b50c29ab7e05783ed8f0a9701a3f Mon Sep 17 00:00:00 2001 From: Domen Date: Wed, 1 Jan 2014 12:48:49 +0100 Subject: [PATCH 07/13] Translated using Weblate (Slovenian) Currently translated at 100.0% (2751 of 2751) --- po/sl.po | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/po/sl.po b/po/sl.po index ad4249adab..1d1d6c2310 100644 --- a/po/sl.po +++ b/po/sl.po @@ -4,10 +4,10 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.2.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2013-12-27 18:16-0500\n" -"PO-Revision-Date: 2013-12-20 22:54+0200\n" +"PO-Revision-Date: 2014-01-01 12:48+0200\n" "Last-Translator: Domen \n" -"Language-Team: Slovenian \n" +"Language-Team: Slovenian " +"\n" "Language: sl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -7142,6 +7142,8 @@ msgid "" "Skip this number of queries (for SQL) or lines (for other formats), starting " "from the first one:" msgstr "" +"Preskoči to število poizvedb (za SQL) ali vrstic (za druge oblike), začenši " +"s prvo:" #: libraries/display_import.lib.php:341 msgid "Format-Specific Options:" @@ -9114,7 +9116,7 @@ msgstr "Hitri koraki za namestitev naprednih funkcij:" #: libraries/relation.lib.php:289 msgid "" "Create the needed tables with the examples/create_tables.sql." -msgstr "Ustvarite potrebne tabele s examples/create_tables.sql." +msgstr "Ustvarite potrebne tabele z examples/create_tables.sql." #: libraries/relation.lib.php:295 msgid "Create a pma user and give access to these tables." @@ -12206,7 +12208,7 @@ msgstr "Časovnica" #: libraries/tbl_chart.lib.php:64 msgctxt "Chart type" msgid "Scatter" -msgstr "" +msgstr "Raztreseni" #: libraries/tbl_chart.lib.php:82 msgid "Stacked" From 0ae77814a7b1f2f9fa08aac741b0157fe6393a1d Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Wed, 1 Jan 2014 18:41:09 +0530 Subject: [PATCH 08/13] bug #4208 Can't browse tables after sorting on columns with fieldnames that have a '-' Signed-off-by: Madhura Jayaratne --- ChangeLog | 1 + libraries/sql.lib.php | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index f32c68caac..10b81f81b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ phpMyAdmin - ChangeLog 4.1.4.0 (not yet released) - bug #3840 (additional fix) When exporting to gzip format, the data is compressed 2 times +- bug #4208 Can't browse tables after sorting on columns with fieldnames that have a '-' 4.1.3.0 (2013-12-31) - bug #3938 PDFDefaultPageSize doc and easy configurability diff --git a/libraries/sql.lib.php b/libraries/sql.lib.php index 788a9d9bca..35ebf2d94e 100644 --- a/libraries/sql.lib.php +++ b/libraries/sql.lib.php @@ -230,10 +230,11 @@ function PMA_handleSortOrder($db, $table, &$analyzed_sql_results, &$full_sql_que if (empty($analyzed_sql_results['analyzed_sql'][0]['order_by_clause'])) { $sorted_col = $pmatable->getUiProp(PMA_Table::PROP_SORTED_COLUMN); if ($sorted_col) { - //remove the backquoting and tablename from retrieved preference - //to get just column name - $sorted_col = str_replace('`', '', $sorted_col); - $sorted_col = str_replace($table . '.', '', $sorted_col); + //remove the tablename from retrieved preference + //to get just the column name and the sort order + $sorted_col = str_replace( + PMA_Util::backquote($table) . '.', '', $sorted_col + ); // retrieve the remembered sorting order for current table $sql_order_to_append = ' ORDER BY ' . $sorted_col . ' '; $full_sql_query @@ -2278,7 +2279,7 @@ function PMA_executeQueryAndSendQueryResponse($analyzed_sql_results, // Handle remembered sorting order, only for single table query // Handling is not required when it's a union query // (the parser never sets the 'union' key to 0) - if (PMA_isRememberSortingOrder($analyzed_sql_results) + if (PMA_isRememberSortingOrder($analyzed_sql_results) && ! isset($analyzed_sql_results['analyzed_sql'][0]['queryflags']['union']) ) { PMA_handleSortOrder($db, $table, $analyzed_sql_results, $full_sql_query); From 45dd69d55bddc65eaaa534086486dcfffb532fe0 Mon Sep 17 00:00:00 2001 From: Chanaka Indrajith Date: Wed, 1 Jan 2014 19:50:35 +0530 Subject: [PATCH 09/13] Added rfe to changlog Signed-off-by: Chanaka Indrajith --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index f876b4f333..5cd6864a02 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ phpMyAdmin - ChangeLog ====================== 4.2.0.0 (not yet released) ++ rfe #1662 Add table comment tool tip in database structure page + rfe #1447 Single table for display Character Sets and Collations + rfe #1455 Display icons/text/both for the table row actions + rfe #1473 Transformation to convert Boolean value to text From d711af903596c019c681e6230afa73d6213efeae Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Thu, 2 Jan 2014 18:28:09 +0530 Subject: [PATCH 10/13] Fix indentation Signed-off-by: Madhura Jayaratne --- libraries/server_privileges.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/server_privileges.lib.php b/libraries/server_privileges.lib.php index 94530e3f6b..e0865078b2 100644 --- a/libraries/server_privileges.lib.php +++ b/libraries/server_privileges.lib.php @@ -3808,7 +3808,7 @@ function PMA_getHtmlForDisplayUserOverviewPage($pmaThemeImage, $text_dir) $sql_query, null, PMA_DatabaseInterface::QUERY_STORE ); $res_all = $GLOBALS['dbi']->tryQuery( - $sql_query_all, null, PMA_DatabaseInterface::QUERY_STORE + $sql_query_all, null, PMA_DatabaseInterface::QUERY_STORE ); From a6926c4f43f4b8ac42b5aed0ff2daa4c9f515eec Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Thu, 2 Jan 2014 08:31:37 -0500 Subject: [PATCH 11/13] Improve function names Signed-off-by: Marc Delisle --- libraries/server_privileges.lib.php | 50 +++++++++---------- server_privileges.php | 4 +- test/libraries/PMA_server_privileges_test.php | 36 ++++++------- 3 files changed, 45 insertions(+), 45 deletions(-) diff --git a/libraries/server_privileges.lib.php b/libraries/server_privileges.lib.php index 94530e3f6b..c67ebc8bc7 100644 --- a/libraries/server_privileges.lib.php +++ b/libraries/server_privileges.lib.php @@ -411,7 +411,7 @@ function PMA_getGrantsArray() * * @return string $html_output html snippet */ -function PMA_getHtmlForDisplayColumnPrivileges($columns, $row, $name_for_select, +function PMA_getHtmlForColumnPrivileges($columns, $row, $name_for_select, $priv_for_header, $name, $name_for_dfn, $name_for_current ) { $html_output = '
' . "\n" @@ -698,7 +698,7 @@ function PMA_getHtmlToDisplayPrivilegesTable($db = '*', * * @return string html snippet */ -function PMA_getHtmlForDisplayResourceLimits($row) +function PMA_getHtmlForResourceLimits($row) { $html_output = '
' . "\n" . '' . __('Resource limits') . '' . "\n" @@ -856,22 +856,22 @@ function PMA_getHtmlForTableSpecificPrivileges( */ function PMA_getHtmlForAttachedPrivilegesToTableSpecificColumn($columns, $row) { - $html_output = PMA_getHtmlForDisplayColumnPrivileges( + $html_output = PMA_getHtmlForColumnPrivileges( $columns, $row, 'Select_priv', 'SELECT', 'select', __('Allows reading data.'), 'Select' ); - $html_output .= PMA_getHtmlForDisplayColumnPrivileges( + $html_output .= PMA_getHtmlForColumnPrivileges( $columns, $row, 'Insert_priv', 'INSERT', 'insert', __('Allows inserting and replacing data.'), 'Insert' ); - $html_output .= PMA_getHtmlForDisplayColumnPrivileges( + $html_output .= PMA_getHtmlForColumnPrivileges( $columns, $row, 'Update_priv', 'UPDATE', 'update', __('Allows changing data.'), 'Update' ); - $html_output .= PMA_getHtmlForDisplayColumnPrivileges( + $html_output .= PMA_getHtmlForColumnPrivileges( $columns, $row, 'References_priv', 'REFERENCES', 'references', __('Has no effect in this MySQL version.'), 'References' ); @@ -1016,7 +1016,7 @@ function PMA_getHtmlForGlobalOrDbSpecificPrivs($db, $table, $row) // The "Resource limits" box is not displayed for db-specific privs if ($db == '*') { - $html_output .= PMA_getHtmlForDisplayResourceLimits($row); + $html_output .= PMA_getHtmlForResourceLimits($row); } // for Safari 2.0.2 $html_output .= '
'; @@ -1245,7 +1245,7 @@ function PMA_getHtmlForGlobalPrivTableWithCheckboxes( * * @return string $html_output a HTML snippet */ -function PMA_getHtmlForDisplayLoginInformationFields($mode = 'new') +function PMA_getHtmlForLoginInformationFields($mode = 'new') { list($username_length, $hostname_length) = PMA_getUsernameAndHostnameLength(); @@ -1681,7 +1681,7 @@ function PMA_getHtmlForAddUser($dbname) . '
' . "\n" . PMA_URL_getHiddenInputs('', '') - . PMA_getHtmlForDisplayLoginInformationFields('new'); + . PMA_getHtmlForLoginInformationFields('new'); $html_output .= '
' . "\n" . '' . __('Database for user') . '' . "\n"; @@ -2470,7 +2470,7 @@ function PMA_getChangeLoginInformationHtmlForm($username, $hostname) . '
' . "\n" . '' . __('Change Login Information / Copy User') . '' . "\n" - . PMA_getHtmlForDisplayLoginInformationFields('change'); + . PMA_getHtmlForLoginInformationFields('change'); $html_output .= '
' . "\n" . ' ' @@ -2648,7 +2648,7 @@ function PMA_getUserSpecificRights($tables, $user_host_condition, $dbname) * * @return array $found_rows, $html_output */ -function PMA_getHtmlForDisplayUserRightsInRows($db_rights, $dbname, +function PMA_getHtmlForUserRights($db_rights, $dbname, $hostname, $username ) { $html_output = ''; @@ -2728,7 +2728,7 @@ function PMA_getHtmlForDisplayUserRightsInRows($db_rights, $dbname, * * @return array $html_output, $found_rows */ -function PMA_getTableForDisplayAllTableSpecificRights( +function PMA_getHtmlForAllTableSpecificRights( $username, $hostname, $dbname ) { // table header @@ -2782,7 +2782,7 @@ function PMA_getTableForDisplayAllTableSpecificRights( $html_output .= '' . "\n"; // display rows - list ($found_rows, $html_out) = PMA_getHtmlForDisplayUserRightsInRows( + list ($found_rows, $html_out) = PMA_getHtmlForUserRights( $db_rights, $dbname, $hostname, $username ); @@ -2800,7 +2800,7 @@ function PMA_getTableForDisplayAllTableSpecificRights( * * @return string HTML snippet */ -function PMA_getHtmlForDisplaySelectDbInEditPrivs($found_rows) +function PMA_getHtmlForSelectDbInEditPrivs($found_rows) { // we already have the list of databases from libraries/common.inc.php // via $pma = new PMA; @@ -2941,7 +2941,7 @@ function PMA_getUsersOverview($result, $db_rights, $pmaThemeImage, $text_dir) . '' . "\n"; $html_output .= '' . "\n"; - $html_output .= PMA_getTableBodyForUserRightsTable($db_rights); + $html_output .= PMA_getHtmlTableBodyForUserRights($db_rights); $html_output .= '' . '' . "\n"; @@ -2978,7 +2978,7 @@ function PMA_getUsersOverview($result, $db_rights, $pmaThemeImage, $text_dir) * * @return string HTML snippet */ -function PMA_getTableBodyForUserRightsTable($db_rights) +function PMA_getHtmlTableBodyForUserRights($db_rights) { if ($GLOBALS['cfgRelation']['menuswork']) { $users_table = PMA_Util::backquote($GLOBALS['cfg']['Server']['pmadb']) @@ -3144,7 +3144,7 @@ function PMA_getFieldsetForAddDeleteUser() * * @return string HTML snippet */ -function PMA_getHtmlForDisplayTheInitials($array_initials) +function PMA_getHtmlForInitials($array_initials) { // initialize to false the letters A-Z for ($letter_counter = 1; $letter_counter < 27; $letter_counter++) { @@ -3721,7 +3721,7 @@ function PMA_getAddUserHtmlFieldset() * * @return string $html_output */ -function PMA_getHtmlHeaderForDisplayUserProperties( +function PMA_getHtmlHeaderForUserProperties( $dbname_is_wildcard, $url_dbname, $dbname, $username, $hostname, $tablename ) { $html_output = '

' . "\n" @@ -3783,7 +3783,7 @@ function PMA_getHtmlHeaderForDisplayUserProperties( * * @return string $html_output */ -function PMA_getHtmlForDisplayUserOverviewPage($pmaThemeImage, $text_dir) +function PMA_getHtmlForUserOverview($pmaThemeImage, $text_dir) { $html_output = '

' . "\n" . PMA_Util::getIcon('b_usrlist.png') @@ -3848,7 +3848,7 @@ function PMA_getHtmlForDisplayUserOverviewPage($pmaThemeImage, $text_dir) * Also not necessary if there is less than 20 privileges */ if ($GLOBALS['dbi']->numRows($res_all) > 20) { - $html_output .= PMA_getHtmlForDisplayTheInitials($array_initials); + $html_output .= PMA_getHtmlForInitials($array_initials); } /** @@ -3906,10 +3906,10 @@ function PMA_getHtmlForDisplayUserOverviewPage($pmaThemeImage, $text_dir) * * @return string $html_output */ -function PMA_getHtmlForDisplayUserProperties($dbname_is_wildcard,$url_dbname, +function PMA_getHtmlForUserProperties($dbname_is_wildcard,$url_dbname, $username, $hostname, $dbname, $tablename ) { - $html_output = PMA_getHtmlHeaderForDisplayUserProperties( + $html_output = PMA_getHtmlHeaderForUserProperties( $dbname_is_wildcard, $url_dbname, $dbname, $username, $hostname, $tablename ); @@ -3923,7 +3923,7 @@ function PMA_getHtmlForDisplayUserProperties($dbname_is_wildcard,$url_dbname, $html_output .= PMA_Message::error( __('The selected user was not found in the privilege table.') )->getDisplay(); - $html_output .= PMA_getHtmlForDisplayLoginInformationFields(); + $html_output .= PMA_getHtmlForLoginInformationFields(); //exit; } @@ -3960,14 +3960,14 @@ function PMA_getHtmlForDisplayUserProperties($dbname_is_wildcard,$url_dbname, // unescape wildcards in dbname at table level $unescaped_db = PMA_Util::unescapeMysqlWildcards($dbname); list($html_rightsTable, $found_rows) - = PMA_getTableForDisplayAllTableSpecificRights( + = PMA_getHtmlForAllTableSpecificRights( $username, $hostname, $unescaped_db ); $html_output .= $html_rightsTable; if (! strlen($dbname)) { // no database name was given, display select db - $html_output .= PMA_getHtmlForDisplaySelectDbInEditPrivs($found_rows); + $html_output .= PMA_getHtmlForSelectDbInEditPrivs($found_rows); } else { $html_output .= PMA_displayTablesInEditPrivs($dbname, $found_rows); diff --git a/server_privileges.php b/server_privileges.php index 94de2e24f3..540d614a37 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -360,7 +360,7 @@ if (isset($_REQUEST['adduser'])) { if (! isset($username)) { // No username is given --> display the overview $response->addHTML( - PMA_getHtmlForDisplayUserOverviewPage($pmaThemeImage, $text_dir) + PMA_getHtmlForUserOverview($pmaThemeImage, $text_dir) ); } else { // A user was selected -> display the user's properties @@ -375,7 +375,7 @@ if (isset($_REQUEST['adduser'])) { ) ); $response->addHTML( - PMA_getHtmlForDisplayUserProperties( + PMA_getHtmlForUserProperties( ((isset ($dbname_is_wildcard)) ? $dbname_is_wildcard : ''), $url_dbname, $username, $hostname, (isset($dbname) ? $dbname : ''), diff --git a/test/libraries/PMA_server_privileges_test.php b/test/libraries/PMA_server_privileges_test.php index 6b69d28ba1..f16590cb67 100644 --- a/test/libraries/PMA_server_privileges_test.php +++ b/test/libraries/PMA_server_privileges_test.php @@ -303,11 +303,11 @@ class PMA_ServerPrivileges_Test extends PHPUnit_Framework_TestCase } /** - * Test for PMA_getHtmlForDisplayColumnPrivileges + * Test for PMA_getHtmlForColumnPrivileges * * @return void */ - public function testPMAGetHtmlForDisplayColumnPrivileges() + public function testPMAGetHtmlForColumnPrivileges() { $columns = array( 'row1' => 'name1' @@ -321,7 +321,7 @@ class PMA_ServerPrivileges_Test extends PHPUnit_Framework_TestCase $name_for_dfn = 'name_for_dfn'; $name_for_current = 'name_for_current'; - $html = PMA_getHtmlForDisplayColumnPrivileges( + $html = PMA_getHtmlForColumnPrivileges( $columns, $row, $name_for_select, $priv_for_header, $name, $name_for_dfn, $name_for_current ); @@ -420,11 +420,11 @@ class PMA_ServerPrivileges_Test extends PHPUnit_Framework_TestCase } /** - * Test for PMA_getHtmlForDisplayResourceLimits + * Test for PMA_getHtmlForResourceLimits * * @return void */ - public function testPMAGetHtmlForDisplayResourceLimits() + public function testPMAGetHtmlForResourceLimits() { $row = array( 'max_questions' => 'max_questions', @@ -433,8 +433,8 @@ class PMA_ServerPrivileges_Test extends PHPUnit_Framework_TestCase 'max_user_connections' => 'max_user_connections', ); - //PMA_getHtmlForDisplayResourceLimits - $html = PMA_getHtmlForDisplayResourceLimits($row); + //PMA_getHtmlForResourceLimits + $html = PMA_getHtmlForResourceLimits($row); $this->assertContains( '' . __('Resource limits') . '', $html @@ -909,7 +909,7 @@ class PMA_ServerPrivileges_Test extends PHPUnit_Framework_TestCase $html ); - //validate 5: PMA_getHtmlForDisplayResourceLimits + //validate 5: PMA_getHtmlForResourceLimits $this->assertContains( '' . __('Resource limits') . '', $html @@ -1053,11 +1053,11 @@ class PMA_ServerPrivileges_Test extends PHPUnit_Framework_TestCase } /** - * Test for PMA_getHtmlForDisplayLoginInformationFields + * Test for PMA_getHtmlForLoginInformationFields * * @return void */ - public function testPMAGetHtmlForDisplayLoginInformationFields() + public function testPMAGetHtmlForLoginInformationFields() { $GLOBALS['username'] = 'pma_username'; @@ -1081,7 +1081,7 @@ class PMA_ServerPrivileges_Test extends PHPUnit_Framework_TestCase $GLOBALS['dbi'] = $dbi; - $html = PMA_getHtmlForDisplayLoginInformationFields(); + $html = PMA_getHtmlForLoginInformationFields(); list($username_length, $hostname_length) = PMA_getUsernameAndHostnameLength(); @@ -1200,9 +1200,9 @@ class PMA_ServerPrivileges_Test extends PHPUnit_Framework_TestCase $html ); - //validate 2: PMA_getHtmlForDisplayLoginInformationFields + //validate 2: PMA_getHtmlForLoginInformationFields $this->assertContains( - PMA_getHtmlForDisplayLoginInformationFields('new'), + PMA_getHtmlForLoginInformationFields('new'), $html ); @@ -1669,9 +1669,9 @@ class PMA_ServerPrivileges_Test extends PHPUnit_Framework_TestCase $html ); - //PMA_getHtmlForDisplayLoginInformationFields + //PMA_getHtmlForLoginInformationFields $this->assertContains( - PMA_getHtmlForDisplayLoginInformationFields('change'), + PMA_getHtmlForLoginInformationFields('change'), $html ); @@ -1930,11 +1930,11 @@ class PMA_ServerPrivileges_Test extends PHPUnit_Framework_TestCase } /** - * Test for PMA_getHtmlHeaderForDisplayUserProperties + * Test for PMA_getHtmlHeaderForUserProperties * * @return void */ - public function testPMAGetHtmlHeaderForDisplayUserProperties() + public function testPMAGetHtmlHeaderForUserProperties() { $dbname_is_wildcard = true; $url_dbname = "url_dbname"; @@ -1944,7 +1944,7 @@ class PMA_ServerPrivileges_Test extends PHPUnit_Framework_TestCase $tablename = "tablename"; $_REQUEST['tablename'] = "tablename"; - $html = PMA_getHtmlHeaderForDisplayUserProperties( + $html = PMA_getHtmlHeaderForUserProperties( $dbname_is_wildcard, $url_dbname, $dbname, $username, $hostname, $tablename ); From 89b57f6d87f607f61003a43aa67637dbc258d7cb Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Thu, 2 Jan 2014 22:47:08 +0530 Subject: [PATCH 12/13] Rename some functions to adhere to coding styles Signed-off-by: Madhura Jayaratne --- libraries/pmd_common.php | 12 ++++++------ pmd_general.php | 8 ++++---- pmd_relation_upd.php | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libraries/pmd_common.php b/libraries/pmd_common.php index 82b49c3bbc..8538fbb48c 100644 --- a/libraries/pmd_common.php +++ b/libraries/pmd_common.php @@ -180,9 +180,9 @@ function PMA_getScriptContr() * * @return array unique or primary indices */ -function get_pk_or_unique_keys() +function PMA_getPKOrUniqueKeys() { - return get_all_keys(true); + return PMA_getAllKeys(true); } /** @@ -192,7 +192,7 @@ function get_pk_or_unique_keys() * * @return array indices */ -function get_all_keys($unique_only = false) +function PMA_getAllKeys($unique_only = false) { include_once './libraries/Index.class.php'; @@ -219,7 +219,7 @@ function get_all_keys($unique_only = false) * * @return string */ -function get_script_tabs() +function PMA_getScriptTabs() { $retval = array( 'j_tabs' => array(), @@ -242,7 +242,7 @@ function get_script_tabs() * * @return array table positions and sizes */ -function get_tab_pos() +function PMA_getTabPos() { $cfgRelation = PMA_getRelationsParam(); @@ -276,7 +276,7 @@ function get_tab_pos() * * @return void */ -function PMD_Return_upd($b, $ret) +function PMA_returnUpd($b, $ret) { // not sure where this was defined... global $K; diff --git a/pmd_general.php b/pmd_general.php index d054ee15e6..ac4c59397a 100644 --- a/pmd_general.php +++ b/pmd_general.php @@ -14,11 +14,11 @@ require_once 'libraries/pmd_common.php'; $script_display_field = PMA_getTablesInfo(); $tab_column = PMA_getColumnsInfo(); -$script_tables = get_script_tabs(); +$script_tables = PMA_getScriptTabs(); $script_contr = PMA_getScriptContr(); -$tab_pos = get_tab_pos(); -$tables_pk_or_unique_keys = get_pk_or_unique_keys(); -$tables_all_keys = get_all_keys(); +$tab_pos = PMA_getTabPos(); +$tables_pk_or_unique_keys = PMA_getPKOrUniqueKeys(); +$tables_all_keys = PMA_getAllKeys(); $params = array('lang' => $GLOBALS['lang']); if (isset($_GET['db'])) { diff --git a/pmd_relation_upd.php b/pmd_relation_upd.php index b500d7c26e..e1b4c35131 100644 --- a/pmd_relation_upd.php +++ b/pmd_relation_upd.php @@ -64,6 +64,6 @@ if ($try_to_delete_internal_relation) { PMA_DatabaseInterface::QUERY_STORE ); } -PMD_Return_upd(1, __('Relation deleted')); +PMA_returnUpd(1, __('Relation deleted')); ?> From 8b95c41cc46603803c8b32b6e74d4950d2d2c6d9 Mon Sep 17 00:00:00 2001 From: Chanaka Indrajith Date: Thu, 2 Jan 2014 23:51:49 +0530 Subject: [PATCH 13/13] Fixed code violations in ServerConfigChecks.class.php Signed-off-by: Chanaka Indrajith --- libraries/config/ServerConfigChecks.class.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/libraries/config/ServerConfigChecks.class.php b/libraries/config/ServerConfigChecks.class.php index 7d3486b0c1..2fc1240617 100644 --- a/libraries/config/ServerConfigChecks.class.php +++ b/libraries/config/ServerConfigChecks.class.php @@ -140,8 +140,10 @@ class ServerConfigChecks $cookieAuthUsed, $blowfishSecret, $sServerAuthCfgMsg, $sSecurityInfoMsg, $blowfishSecretSet ) { - for ($i = 1, $serverCnt = $this->cfg->getServerCount(); $i <= $serverCnt; $i++) { - $cookieAuthServer = ($this->cfg->getValue("Servers/$i/auth_type") == 'cookie'); + $serverCnt = $this->cfg->getServerCount(); + for ($i = 1; $i <= $serverCnt; $i++) { + $cookieAuthServer + = ($this->cfg->getValue("Servers/$i/auth_type") == 'cookie'); $cookieAuthUsed |= $cookieAuthServer; $serverName = $this->performConfigChecksServersGetServerName( $this->cfg->getServerName($i), $i @@ -472,7 +474,8 @@ class ServerConfigChecks // $cfg['LoginCookieValidity'] // value greater than session.gc_maxlifetime will cause // random session invalidation after that time - if ($this->cfg->getValue('LoginCookieValidity') > ini_get('session.gc_maxlifetime') + $loginCookieValidity = $this->cfg->getValue('LoginCookieValidity'); + if ($loginCookieValidity > ini_get('session.gc_maxlifetime') ) { PMA_messagesSet( 'error', @@ -486,7 +489,7 @@ class ServerConfigChecks // $cfg['LoginCookieValidity'] // should be at most 1800 (30 min) // - if ($this->cfg->getValue('LoginCookieValidity') > 1800) { + if ($loginCookieValidity > 1800) { PMA_messagesSet( 'notice', 'LoginCookieValidity', @@ -500,8 +503,8 @@ class ServerConfigChecks // $cfg['LoginCookieStore'] // LoginCookieValidity must be less or equal to LoginCookieStore // - if ($this->cfg->getValue('LoginCookieStore') != 0 - && $this->cfg->getValue('LoginCookieValidity') > $this->cfg->getValue('LoginCookieStore') + if (($this->cfg->getValue('LoginCookieStore') != 0) + && ($loginCookieValidity > $this->cfg->getValue('LoginCookieStore')) ) { PMA_messagesSet( 'error',