phpmyadmin.net
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Git
September 2011
----- 2024 -----
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
git@phpmyadmin.net
7 participants
167 discussions
Start a n
N
ew thread
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_5RC1-19145-g464a415
by Madhura Jayaratne
The branch, master has been updated via 464a4159314e9de3fc8d43ba33b4869d9e657a92 (commit) from 65fff4483e5812f70b4ee7204ce3117287e83eb9 (commit) - Log ----------------------------------------------------------------- commit 464a4159314e9de3fc8d43ba33b4869d9e657a92 Author: Madhura Jayaratne <madhura.cj(a)gmail.com> Date: Thu Sep 15 14:04:49 2011 +0530 Use PMA_getIcon() ----------------------------------------------------------------------- Summary of changes: db_operations.php | 20 ++++---------------- 1 files changed, 4 insertions(+), 16 deletions(-) diff --git a/db_operations.php b/db_operations.php index 77c2af7..6c7df59 100644 --- a/db_operations.php +++ b/db_operations.php @@ -395,10 +395,7 @@ if ($db != 'mysql') { <fieldset> <legend> <?php - if ($cfg['PropertiesIconic']) { - echo '<img class="icon ic_b_edit" src="themes/dot.gif" alt="" />'; - } - echo __('Rename database to') . ':'; + echo PMA_getIcon('b_edit.png', __('Rename database to'), true) . ':'; ?> </legend> <input id="new_db_name" type="text" name="newname" size="30" class="textfield" value="" /> @@ -421,10 +418,7 @@ if (($is_superuser || $GLOBALS['cfg']['AllowUserDropDatabase']) <div class="operations_half_width"> <fieldset class="caution"> <legend><?php -if ($cfg['PropertiesIconic']) { - echo '<img class="icon ic_b_deltbl" src="themes/dot.gif" alt="" />'; -} -echo __('Remove database'); +echo PMA_getIcon('b_deltbl.png', __('Remove database'), true); ?></legend> <ul> @@ -467,10 +461,7 @@ echo __('Remove database'); <fieldset> <legend> <?php - if ($cfg['PropertiesIconic']) { - echo '<img class="icon ic_b_edit" src="themes/dot.gif" alt="" />'; - } - echo __('Copy database to') . ':'; + echo PMA_getIcon('b_edit.png', __('Copy database to'), true) . ':'; $drop_clause = 'DROP TABLE / DROP VIEW'; ?> </legend> @@ -531,10 +522,7 @@ echo __('Remove database'); . PMA_generate_common_hidden_inputs($db, $table) . '<fieldset>' . "\n" . ' <legend>'; - if ($cfg['PropertiesIconic']) { - echo '<img class="icon ic_s_asci" src="themes/dot.gif" alt="" />'; - } - echo ' <label for="select_db_collation">' . __('Collation') . ':</label>' . "\n" + echo PMA_getIcon('s_asci.png', __('Collation'), true) . ':' . ' </legend>' . "\n" . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'db_collation', 'select_db_collation', $db_collation, false, 3) hooks/post-receive -- phpMyAdmin
12 years, 11 months
1
0
0
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_5RC1-19144-g65fff44
by Madhura Jayaratne
The branch, master has been updated via 65fff4483e5812f70b4ee7204ce3117287e83eb9 (commit) from 47b5a2b2f4b8ed659c3bed3a206534957b78b60d (commit) - Log ----------------------------------------------------------------- commit 65fff4483e5812f70b4ee7204ce3117287e83eb9 Author: Madhura Jayaratne <madhura.cj(a)gmail.com> Date: Thu Sep 15 14:09:44 2011 +0530 No need to force text here ----------------------------------------------------------------------- Summary of changes: libraries/tbl_select.lib.php | 2 +- tbl_change.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/tbl_select.lib.php b/libraries/tbl_select.lib.php index b200e45..848eb28 100644 --- a/libraries/tbl_select.lib.php +++ b/libraries/tbl_select.lib.php @@ -202,7 +202,7 @@ EOT; if ($in_fbs) { $edit_url = 'gis_data_editor.php?' . PMA_generate_common_url(); - $edit_str = PMA_getIcon('b_edit.png', __('Edit/Insert'), true); + $edit_str = PMA_getIcon('b_edit.png', __('Edit/Insert')); $str .= '<span class="open_search_gis_editor">'; $str .= PMA_linkOrButton($edit_url, $edit_str, array(), false, false, '_blank'); $str .= '</span>'; diff --git a/tbl_change.php b/tbl_change.php index 2fd9394..7bc0767 100644 --- a/tbl_change.php +++ b/tbl_change.php @@ -990,7 +990,7 @@ foreach ($rows as $row_id => $vrow) { $_url_params = $_url_params + array('gis_data[gis_type]' => strtoupper($field['pma_type'])); } $edit_url = 'gis_data_editor.php' . PMA_generate_common_url($_url_params); - $edit_str = PMA_getIcon('b_edit.png', __('Edit/Insert'), true); + $edit_str = PMA_getIcon('b_edit.png', __('Edit/Insert')); echo('<span class="open_gis_editor">'); echo(PMA_linkOrButton($edit_url, $edit_str, array(), false, false, '_blank')); echo('</span>'); hooks/post-receive -- phpMyAdmin
12 years, 11 months
1
0
0
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_5RC1-19143-g47b5a2b
by Madhura Jayaratne
The branch, master has been updated via 47b5a2b2f4b8ed659c3bed3a206534957b78b60d (commit) from 87c7d027ac101b57a2d3c445155e05de0144c29e (commit) - Log ----------------------------------------------------------------- commit 47b5a2b2f4b8ed659c3bed3a206534957b78b60d Author: Madhura Jayaratne <madhura.cj(a)gmail.com> Date: Thu Sep 15 23:00:02 2011 +0530 bug #3410077 - User overview erroneously loaded into Ajax dialog ----------------------------------------------------------------------- Summary of changes: js/server_privileges.js | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/js/server_privileges.js b/js/server_privileges.js index 738d64b..d1d051d 100644 --- a/js/server_privileges.js +++ b/js/server_privileges.js @@ -364,7 +364,8 @@ $(document).ready(function() { var button_options = {}; button_options[PMA_messages['strCancel']] = function() {$(this).dialog("close").remove();} - $.get($(this).attr('href'), {'ajax_request':true, 'edit_user_dialog': true}, function(data) { + var token = $(this).parents('form').find('input[name="token"]').val(); + $.get($(this).attr('href'), {'ajax_request':true, 'edit_user_dialog': true, 'token': token}, function(data) { $('<div id="edit_user_dialog"></div>') .append(data) .dialog({ hooks/post-receive -- phpMyAdmin
12 years, 11 months
1
0
0
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_5RC1-19142-g87c7d02
by Marc Delisle
The branch, master has been updated via 87c7d027ac101b57a2d3c445155e05de0144c29e (commit) from c1878a1abd41cdc768e264aadd0ddc6065c158d3 (commit) - Log ----------------------------------------------------------------- commit 87c7d027ac101b57a2d3c445155e05de0144c29e Author: Marc Delisle <marc(a)infomarc.info> Date: Thu Sep 15 12:37:12 2011 -0400 Missing text next to these icons ----------------------------------------------------------------------- Summary of changes: libraries/display_tbl.lib.php | 12 ++++++------ sql.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index 28db08d..b4c9646 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -2478,14 +2478,14 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) echo PMA_linkOrButton( 'sql.php' . $url_query, - PMA_getIcon('b_print.png', __('Print view')), + PMA_getIcon('b_print.png', __('Print view'), true), '', true, true, 'print_view') . "\n"; if ($_SESSION['tmp_user_values']['display_text']) { $_url_params['display_text'] = 'F'; echo PMA_linkOrButton( 'sql.php' . PMA_generate_common_url($_url_params), - PMA_getIcon('b_print.png', __('Print view (with full texts)')), + PMA_getIcon('b_print.png', __('Print view (with full texts)'), true), '', true, true, 'print_view') . "\n"; unset($_url_params['display_text']); } @@ -2527,13 +2527,13 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) echo PMA_linkOrButton( 'tbl_export.php' . PMA_generate_common_url($_url_params), - PMA_getIcon('b_tblexport.png', __('Export')), + PMA_getIcon('b_tblexport.png', __('Export'), true), '', true, true, '') . "\n"; // show chart echo PMA_linkOrButton( 'tbl_chart.php' . PMA_generate_common_url($_url_params), - PMA_getIcon('b_chart.png', __('Display chart')), + PMA_getIcon('b_chart.png', __('Display chart'), true), '', true, true, '') . "\n"; // show GIS chart @@ -2548,7 +2548,7 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) if ($geometry_found) { echo PMA_linkOrButton( 'tbl_gis_visualization.php' . PMA_generate_common_url($_url_params), - PMA_getIcon('b_globe.gif', __('Visualize GIS data')), + PMA_getIcon('b_globe.gif', __('Visualize GIS data'), true), '', true, true, '') . "\n"; } } @@ -2568,7 +2568,7 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) if (!PMA_DRIZZLE && !isset($analyzed_sql[0]['queryflags']['procedure'])) { echo PMA_linkOrButton( 'view_create.php' . $url_query, - PMA_getIcon('b_views.png', __('Create view')), + PMA_getIcon('b_views.png', __('Create view'), true), '', true, true, '') . "\n"; } if ($header_shown) { diff --git a/sql.php b/sql.php index 9695d12..41d4504 100644 --- a/sql.php +++ b/sql.php @@ -943,7 +943,7 @@ $(document).ready(makeProfilingChart); <input type="hidden" name="fields[query]" value="<?php echo urlencode(isset($complete_query) ? $complete_query : $sql_query); ?>" /> <fieldset> <legend><?php - echo PMA_getIcon('b_bookmark.png', __('Bookmark this SQL query')); + echo PMA_getIcon('b_bookmark.png', __('Bookmark this SQL query'), true); ?> </legend> hooks/post-receive -- phpMyAdmin
12 years, 11 months
1
0
0
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_5RC1-19141-gc1878a1
by Aris Feryanto
The branch, master has been updated via c1878a1abd41cdc768e264aadd0ddc6065c158d3 (commit) from 2c9b0b2675f6fa28b2e24010fc1cbcc5e5c96f17 (commit) - Log ----------------------------------------------------------------- commit c1878a1abd41cdc768e264aadd0ddc6065c158d3 Author: Aris Feryanto <aris_feryanto(a)yahoo.com> Date: Thu Sep 15 15:49:36 2011 +0700 Trigger makegrid in table search result ----------------------------------------------------------------------- Summary of changes: js/tbl_select.js | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/js/tbl_select.js b/js/tbl_select.js index 4f6ddf0..00e3a57 100644 --- a/js/tbl_select.js +++ b/js/tbl_select.js @@ -66,7 +66,7 @@ $(document).ready(function() { if (typeof response == 'string') { // found results $("#sqlqueryresults").html(response); - $("#sqlqueryresults").trigger('appendAnchor'); + $("#sqlqueryresults").trigger('makegrid'); $('#tbl_search_form') // workaround for bug #3168569 - Issue on toggling the "Hide search criteria" in chrome. .slideToggle() hooks/post-receive -- phpMyAdmin
12 years, 11 months
1
0
0
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_5RC1-19140-g2c9b0b2
by Rouslan Placella
The branch, master has been updated via 2c9b0b2675f6fa28b2e24010fc1cbcc5e5c96f17 (commit) from a764501c598bd82195a32956214c1679069758d2 (commit) - Log ----------------------------------------------------------------- commit 2c9b0b2675f6fa28b2e24010fc1cbcc5e5c96f17 Author: Rouslan Placella <rouslan(a)placella.com> Date: Wed Sep 14 23:47:51 2011 +0100 Added myself to the credits section in Documentation.html ----------------------------------------------------------------------- Summary of changes: Documentation.html | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/Documentation.html b/Documentation.html index f530db8..293728c 100644 --- a/Documentation.html +++ b/Documentation.html @@ -4989,6 +4989,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA <li>Visual query builder</li> </ul></li> +<li>Rouslan Placella (Google Summer of Code 2011) +<ul> + <li>Improved support for Stored Routines, Triggers and Events</li> + <li>Italian translation updates</li> +</ul></li> </ul> hooks/post-receive -- phpMyAdmin
12 years, 11 months
1
0
0
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_5RC1-19139-ga764501
by Madhura Jayaratne
The branch, master has been updated via a764501c598bd82195a32956214c1679069758d2 (commit) via ef4e13d459d45e957076d50ec7a04169572f63dc (commit) via 2e0297af684a2f4f4134bc40564bd9fa97710471 (commit) via 100d7a04cfab62bedca957028b6c333d6c145bc6 (commit) via f76e4277d0f22d57a75a90342e3cac647b96ee54 (commit) from 3d3a5283dc334c7fb54160293acc57a984faac1b (commit) - Log ----------------------------------------------------------------- commit a764501c598bd82195a32956214c1679069758d2 Author: Madhura Jayaratne <madhura.cj(a)gmail.com> Date: Wed Sep 14 23:43:59 2011 +0530 More coding style improvements commit ef4e13d459d45e957076d50ec7a04169572f63dc Author: Madhura Jayaratne <madhura.cj(a)gmail.com> Date: Wed Sep 14 23:30:16 2011 +0530 Proper indentation commit 2e0297af684a2f4f4134bc40564bd9fa97710471 Author: Madhura Jayaratne <madhura.cj(a)gmail.com> Date: Wed Sep 14 23:25:49 2011 +0530 Multi line function calls, if statements and assignments commit 100d7a04cfab62bedca957028b6c333d6c145bc6 Author: Madhura Jayaratne <madhura.cj(a)gmail.com> Date: Wed Sep 14 23:02:02 2011 +0530 Fix doc blocks commit f76e4277d0f22d57a75a90342e3cac647b96ee54 Author: Madhura Jayaratne <madhura.cj(a)gmail.com> Date: Wed Sep 14 22:55:43 2011 +0530 File is being conditionally included; use "include" instead ----------------------------------------------------------------------- Summary of changes: server_privileges.php | 431 +++++++++++++++++++++++++------------------------ 1 files changed, 223 insertions(+), 208 deletions(-) diff --git a/server_privileges.php b/server_privileges.php index 37ef25e..c1a1d83 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -112,17 +112,17 @@ if (isset($dbname)) { /** * Checks if the user is allowed to do what he tries to... */ -if (!$is_superuser) { - require './libraries/server_links.inc.php'; +if (! $is_superuser) { + include './libraries/server_links.inc.php'; echo '<h2>' . "\n" . PMA_getIcon('b_usrlist.png') . __('Privileges') . "\n" . '</h2>' . "\n"; PMA_Message::error(__('No Privileges'))->display(); - require './libraries/footer.inc.php'; + include './libraries/footer.inc.php'; } -$random_n = mt_rand(0,1000000); // a random number that will be appended to the id of the user forms +$random_n = mt_rand(0, 1000000); // a random number that will be appended to the id of the user forms /** * Escapes wildcard in a database+table specification @@ -134,8 +134,9 @@ $random_n = mt_rand(0,1000000); // a random number that will be appended to the * no escaping (for example test_db) but in mysql.db you'll see test\_db * for a db-specific privilege. * - * @param string $dbname Database name - * @param string $tablename Table name + * @param string $dbname Database name + * @param string $tablename Table name + * * @return string the escaped (if necessary) database.table */ function PMA_wildcardEscapeForGrant($dbname, $tablename) @@ -158,14 +159,15 @@ function PMA_wildcardEscapeForGrant($dbname, $tablename) /** * Generates a condition on the user name * - * @param string the user's initial + * @param string $initial the user's initial + * * @return string the generated condition */ function PMA_rangeOfUsers($initial = '') { // strtolower() is used because the User field // might be BINARY, so LIKE would be case sensitive - if (!empty($initial)) { + if (! empty($initial)) { $ret = " WHERE `User` LIKE '" . PMA_sqlAddSlashes($initial, true) . "%'" . " OR `User` LIKE '" . PMA_sqlAddSlashes(strtolower($initial), true) . "%'"; } else { @@ -307,10 +309,11 @@ function PMA_extractPrivInfo($row = '', $enableHTML = false) __('Allows executing stored routines.')), ); - if (!empty($row) && isset($row['Table_priv'])) { + if (! empty($row) && isset($row['Table_priv'])) { $row1 = PMA_DBI_fetch_single_row( 'SHOW COLUMNS FROM `mysql`.`tables_priv` LIKE \'Table_priv\';', - 'ASSOC', $GLOBALS['userlink']); + 'ASSOC', $GLOBALS['userlink'] + ); $av_grants = explode('\',\'', substr($row1['Type'], 5, strlen($row1['Type']) - 7)); unset($row1); $users_grants = explode(',', $row['Table_priv']); @@ -324,10 +327,10 @@ function PMA_extractPrivInfo($row = '', $enableHTML = false) $privs = array(); $allPrivileges = true; foreach ($grants as $current_grant) { - if ((!empty($row) && isset($row[$current_grant[0]])) + if ((! empty($row) && isset($row[$current_grant[0]])) || (empty($row) && isset($GLOBALS[$current_grant[0]])) ) { - if ((!empty($row) && $row[$current_grant[0]] == 'Y') + if ((! empty($row) && $row[$current_grant[0]] == 'Y') || (empty($row) && ($GLOBALS[$current_grant[0]] == 'Y' || (is_array($GLOBALS[$current_grant[0]]) @@ -339,7 +342,7 @@ function PMA_extractPrivInfo($row = '', $enableHTML = false) } else { $privs[] = $current_grant[1]; } - } elseif (!empty($GLOBALS[$current_grant[0]]) + } elseif (! empty($GLOBALS[$current_grant[0]]) && is_array($GLOBALS[$current_grant[0]]) && empty($GLOBALS[$current_grant[0] . '_none'])) { if ($enableHTML) { @@ -375,31 +378,31 @@ function PMA_extractPrivInfo($row = '', $enableHTML = false) function PMA_display_column_privs($columns, $row, $name_for_select, $priv_for_header, $name, $name_for_dfn, $name_for_current) { - echo ' <div class="item" id="div_item_' . $name . '">' . "\n" - . ' <label for="select_' . $name . '_priv">' . "\n" - . ' <tt><dfn title="' . $name_for_dfn . '">' - . $priv_for_header . '</dfn></tt>' . "\n" - . ' </label><br />' . "\n" - . ' <select id="select_' . $name . '_priv" name="' - . $name_for_select . '[]" multiple="multiple" size="8">' . "\n"; - - foreach ($columns as $current_column => $current_column_privileges) { - echo ' <option value="' . htmlspecialchars($current_column) . '"'; - if ($row[$name_for_select] == 'Y' || $current_column_privileges[$name_for_current]) { - echo ' selected="selected"'; - } - echo '>' . htmlspecialchars($current_column) . '</option>' . "\n"; + echo ' <div class="item" id="div_item_' . $name . '">' . "\n" + . ' <label for="select_' . $name . '_priv">' . "\n" + . ' <tt><dfn title="' . $name_for_dfn . '">' + . $priv_for_header . '</dfn></tt>' . "\n" + . ' </label><br />' . "\n" + . ' <select id="select_' . $name . '_priv" name="' + . $name_for_select . '[]" multiple="multiple" size="8">' . "\n"; + + foreach ($columns as $current_column => $current_column_privileges) { + echo ' <option value="' . htmlspecialchars($current_column) . '"'; + if ($row[$name_for_select] == 'Y' || $current_column_privileges[$name_for_current]) { + echo ' selected="selected"'; } + echo '>' . htmlspecialchars($current_column) . '</option>' . "\n"; + } - echo ' </select>' . "\n" - . ' <i>' . __('Or') . '</i>' . "\n" - . ' <label for="checkbox_' . $name_for_select - . '_none"><input type="checkbox"' - . (empty($GLOBALS['checkall']) ? '' : ' checked="checked"') - . ' name="' . $name_for_select . '_none" id="checkbox_' - . $name_for_select . '_none" title="' . _pgettext('None privileges', 'None') . '" />' - . _pgettext('None privileges', 'None') . '</label>' . "\n" - . ' </div>' . "\n"; + echo ' </select>' . "\n" + . ' <i>' . __('Or') . '</i>' . "\n" + . ' <label for="checkbox_' . $name_for_select + . '_none"><input type="checkbox"' + . (empty($GLOBALS['checkall']) ? '' : ' checked="checked"') + . ' name="' . $name_for_select . '_none" id="checkbox_' + . $name_for_select . '_none" title="' . _pgettext('None privileges', 'None') . '" />' + . _pgettext('None privileges', 'None') . '</label>' . "\n" + . ' </div>' . "\n"; } // end function @@ -409,6 +412,7 @@ function PMA_display_column_privs($columns, $row, $name_for_select, * @param string $db the database * @param string $table the table * @param boolean $submit wheather to display the submit button or not + * * @global array $cfg the phpMyAdmin configuration * @global ressource $user_link the database connection * @@ -426,20 +430,17 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = true) $username = $GLOBALS['username']; $hostname = $GLOBALS['hostname']; if ($db == '*') { - $sql_query = - "SELECT * FROM `mysql`.`user`" + $sql_query = "SELECT * FROM `mysql`.`user`" ." WHERE `User` = '" . PMA_sqlAddSlashes($username) . "'" ." AND `Host` = '" . PMA_sqlAddSlashes($hostname) . "';"; } elseif ($table == '*') { - $sql_query = - "SELECT * FROM `mysql`.`db`" + $sql_query = "SELECT * FROM `mysql`.`db`" ." WHERE `User` = '" . PMA_sqlAddSlashes($username) . "'" ." AND `Host` = '" . PMA_sqlAddSlashes($hostname) . "'" ." AND '" . PMA_unescape_mysql_wildcards($db) . "'" ." LIKE `Db`;"; } else { - $sql_query = - "SELECT `Table_priv`" + $sql_query = "SELECT `Table_priv`" ." FROM `mysql`.`tables_priv`" ." WHERE `User` = '" . PMA_sqlAddSlashes($username) . "'" ." AND `Host` = '" . PMA_sqlAddSlashes($hostname) . "'" @@ -471,7 +472,8 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = true) if (isset($row['Table_priv'])) { $row1 = PMA_DBI_fetch_single_row( 'SHOW COLUMNS FROM `mysql`.`tables_priv` LIKE \'Table_priv\';', - 'ASSOC', $GLOBALS['userlink']); + 'ASSOC', $GLOBALS['userlink'] + ); // note: in MySQL 5.0.3 we get "Create View', 'Show view'; // the View for Create is spelled with uppercase V // the view for Show is spelled with lowercase v @@ -514,7 +516,8 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = true) .' AND `Db`' .' = \'' . PMA_sqlAddSlashes(PMA_unescape_mysql_wildcards($db)) . "'" .' AND `Table_name`' - .' = \'' . PMA_sqlAddSlashes($table) . '\';'); + .' = \'' . PMA_sqlAddSlashes($table) . '\';' + ); while ($row1 = PMA_DBI_fetch_row($res)) { $row1[1] = explode(',', $row1[1]); @@ -535,17 +538,25 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = true) // privs that are attached to a specific column - PMA_display_column_privs($columns, $row, 'Select_priv', - 'SELECT', 'select', __('Allows reading data.'), 'Select'); + PMA_display_column_privs( + $columns, $row, 'Select_priv', 'SELECT', + 'select', __('Allows reading data.'), 'Select' + ); - PMA_display_column_privs($columns, $row, 'Insert_priv', - 'INSERT', 'insert', __('Allows inserting and replacing data.'), 'Insert'); + PMA_display_column_privs( + $columns, $row, 'Insert_priv', 'INSERT', + 'insert', __('Allows inserting and replacing data.'), 'Insert' + ); - PMA_display_column_privs($columns, $row, 'Update_priv', - 'UPDATE', 'update', __('Allows changing data.'), 'Update'); + PMA_display_column_privs( + $columns, $row, 'Update_priv', 'UPDATE', + 'update', __('Allows changing data.'), 'Update' + ); - PMA_display_column_privs($columns, $row, 'References_priv', - 'REFERENCES', 'references', __('Has no effect in this MySQL version.'), 'References'); + PMA_display_column_privs( + $columns, $row, 'References_priv', 'REFERENCES', 'references', + __('Has no effect in this MySQL version.'), 'References' + ); // privs that are not attached to a specific column @@ -684,7 +695,7 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = true) . ' <input type="checkbox"' . ' name="' . $priv[0] . '_priv" id="checkbox_' . $priv[0] . '_priv"' . ' value="Y" title="' . $priv[2] . '"' - . ((!empty($GLOBALS['checkall']) || $row[$priv[0] . '_priv'] == 'Y') ? ' checked="checked"' : '') + . ((! empty($GLOBALS['checkall']) || $row[$priv[0] . '_priv'] == 'Y') ? ' checked="checked"' : '') . '/>' . "\n" . ' <label for="checkbox_' . $priv[0] . '_priv"><tt><dfn title="' . $priv[2] . '">' . $priv[1] . '</dfn></tt></label>' . "\n" @@ -723,7 +734,7 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = true) . $row['max_user_connections'] . '" size="11" maxlength="11" title="' . __('Limits the number of simultaneous connections the user may have.') . '" />' . "\n" . ' </div>' . "\n" . ' </fieldset>' . "\n"; - } + } // for Safari 2.0.2 echo ' <div class="clearfloat"></div>' . "\n"; } @@ -740,8 +751,9 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = true) * Displays the fields used by the "new user" form as well as the * "change login information / copy user" form. * - * @param string $mode are we creating a new user or are we just - * changing one? (allowed values: 'new', 'change') + * @param string $mode are we creating a new user or are we just + * changing one? (allowed values: 'new', 'change') + * * @global array $cfg the phpMyAdmin configuration * @global ressource $user_link the database connection * @@ -816,16 +828,16 @@ function PMA_displayLoginInformationFields($mode = 'new') // when we start editing a user, $GLOBALS['pred_hostname'] is not defined if (! isset($GLOBALS['pred_hostname']) && isset($GLOBALS['hostname'])) { switch (strtolower($GLOBALS['hostname'])) { - case 'localhost': - case '127.0.0.1': - $GLOBALS['pred_hostname'] = 'localhost'; - break; - case '%': - $GLOBALS['pred_hostname'] = 'any'; - break; - default: - $GLOBALS['pred_hostname'] = 'userdefined'; - break; + case 'localhost': + case '127.0.0.1': + $GLOBALS['pred_hostname'] = 'localhost'; + break; + case '%': + $GLOBALS['pred_hostname'] = 'any'; + break; + default: + $GLOBALS['pred_hostname'] = 'userdefined'; + break; } } echo ' <option value="any"' @@ -836,7 +848,7 @@ function PMA_displayLoginInformationFields($mode = 'new') . ((isset($GLOBALS['pred_hostname']) && $GLOBALS['pred_hostname'] == 'localhost') ? ' selected="selected"' : '') . '>' . __('Local') . '</option>' . "\n"; - if (!empty($thishost)) { + if (! empty($thishost)) { echo ' <option value="thishost"' . ((isset($GLOBALS['pred_hostname']) && $GLOBALS['pred_hostname'] == 'thishost') ? ' selected="selected"' : '') . '>' . __('This Host') @@ -894,8 +906,7 @@ function PMA_displayLoginInformationFields($mode = 'new') * Changes / copies a user, part I */ if (isset($_REQUEST['change_copy'])) { - $user_host_condition = - ' WHERE `User`' + $user_host_condition = ' WHERE `User`' .' = \'' . PMA_sqlAddSlashes($old_username) . "'" .' AND `Host`' .' = \'' . PMA_sqlAddSlashes($old_hostname) . '\';'; @@ -926,20 +937,20 @@ if (isset($_REQUEST['adduser_submit']) || isset($_REQUEST['change_copy'])) { $username = ''; } switch ($pred_hostname) { - case 'any': - $hostname = '%'; - break; - case 'localhost': - $hostname = 'localhost'; - break; - case 'hosttable': - $hostname = ''; - break; - case 'thishost': - $_user_name = PMA_DBI_fetch_value('SELECT USER()'); - $hostname = substr($_user_name, (strrpos($_user_name, '@') + 1)); - unset($_user_name); - break; + case 'any': + $hostname = '%'; + break; + case 'localhost': + $hostname = 'localhost'; + break; + case 'hosttable': + $hostname = ''; + break; + case 'thishost': + $_user_name = PMA_DBI_fetch_value('SELECT USER()'); + $hostname = substr($_user_name, (strrpos($_user_name, '@') + 1)); + unset($_user_name); + break; } $sql = "SELECT '1' FROM `mysql`.`user`" . " WHERE `User` = '" . PMA_sqlAddSlashes($username) . "'" @@ -953,8 +964,7 @@ if (isset($_REQUEST['adduser_submit']) || isset($_REQUEST['change_copy'])) { $create_user_real = 'CREATE USER \'' . PMA_sqlAddSlashes($username) . '\'@\'' . PMA_sqlAddSlashes($hostname) . '\''; - $real_sql_query = - 'GRANT ' . join(', ', PMA_extractPrivInfo()) . ' ON *.* TO \'' + $real_sql_query = 'GRANT ' . join(', ', PMA_extractPrivInfo()) . ' ON *.* TO \'' . PMA_sqlAddSlashes($username) . '\'@\'' . PMA_sqlAddSlashes($hostname) . '\''; if ($pred_password != 'none' && $pred_password != 'keep') { $sql_query = $real_sql_query . ' IDENTIFIED BY \'***\''; @@ -964,7 +974,7 @@ if (isset($_REQUEST['adduser_submit']) || isset($_REQUEST['change_copy'])) { $create_user_real .= ' IDENTIFIED BY \'' . PMA_sqlAddSlashes($pma_pw) . '\''; } } else { - if ($pred_password == 'keep' && !empty($password)) { + if ($pred_password == 'keep' && ! empty($password)) { $real_sql_query .= ' IDENTIFIED BY PASSWORD \'' . $password . '\''; if (isset($create_user_real)) { $create_user_real .= ' IDENTIFIED BY PASSWORD \'' . $password . '\''; @@ -979,8 +989,9 @@ if (isset($_REQUEST['adduser_submit']) || isset($_REQUEST['change_copy'])) { * @todo similar code appears twice in this script */ if ((isset($Grant_priv) && $Grant_priv == 'Y') - || (isset($max_questions) || isset($max_connections) - || isset($max_updates) || isset($max_user_connections))) { + || (isset($max_questions) || isset($max_connections) + || isset($max_updates) || isset($max_user_connections)) + ) { $real_sql_query .= ' WITH'; $sql_query .= ' WITH'; if (isset($Grant_priv) && $Grant_priv == 'Y') { @@ -1033,58 +1044,58 @@ if (isset($_REQUEST['adduser_submit']) || isset($_REQUEST['change_copy'])) { } switch (PMA_ifSetOr($_REQUEST['createdb'], '0')) { - case '1' : - // Create database with same name and grant all privileges - $q = 'CREATE DATABASE IF NOT EXISTS ' - . PMA_backquote(PMA_sqlAddSlashes($username)) . ';'; - $sql_query .= $q; - if (! PMA_DBI_try_query($q)) { - $message = PMA_Message::rawError(PMA_DBI_getError()); - break; - } + case '1' : + // Create database with same name and grant all privileges + $q = 'CREATE DATABASE IF NOT EXISTS ' + . PMA_backquote(PMA_sqlAddSlashes($username)) . ';'; + $sql_query .= $q; + if (! PMA_DBI_try_query($q)) { + $message = PMA_Message::rawError(PMA_DBI_getError()); + break; + } - /** - * If we are not in an Ajax request, we can't reload navigation now - */ - if ($GLOBALS['is_ajax_request'] != true) { - // this is needed in case tracking is on: - $GLOBALS['db'] = $username; - $GLOBALS['reload'] = true; - PMA_reloadNavigation(); - } + /** + * If we are not in an Ajax request, we can't reload navigation now + */ + if ($GLOBALS['is_ajax_request'] != true) { + // this is needed in case tracking is on: + $GLOBALS['db'] = $username; + $GLOBALS['reload'] = true; + PMA_reloadNavigation(); + } - $q = 'GRANT ALL PRIVILEGES ON ' - . PMA_backquote(PMA_sqlAddSlashes($username)) . '.* TO \'' - . PMA_sqlAddSlashes($username) . '\'@\'' . PMA_sqlAddSlashes($hostname) . '\';'; - $sql_query .= $q; - if (! PMA_DBI_try_query($q)) { - $message = PMA_Message::rawError(PMA_DBI_getError()); - } - break; - case '2' : - // Grant all privileges on wildcard name (username\_%) - $q = 'GRANT ALL PRIVILEGES ON ' - . PMA_backquote(PMA_sqlAddSlashes($username) . '\_%') . '.* TO \'' - . PMA_sqlAddSlashes($username) . '\'@\'' . PMA_sqlAddSlashes($hostname) . '\';'; - $sql_query .= $q; - if (! PMA_DBI_try_query($q)) { - $message = PMA_Message::rawError(PMA_DBI_getError()); - } - break; - case '3' : - // Grant all privileges on the specified database to the new user - $q = 'GRANT ALL PRIVILEGES ON ' - . PMA_backquote(PMA_sqlAddSlashes($dbname)) . '.* TO \'' + $q = 'GRANT ALL PRIVILEGES ON ' + . PMA_backquote(PMA_sqlAddSlashes($username)) . '.* TO \'' . PMA_sqlAddSlashes($username) . '\'@\'' . PMA_sqlAddSlashes($hostname) . '\';'; - $sql_query .= $q; - if (! PMA_DBI_try_query($q)) { + $sql_query .= $q; + if (! PMA_DBI_try_query($q)) { $message = PMA_Message::rawError(PMA_DBI_getError()); - } - break; - case '0' : - default : - break; + } + break; + case '2' : + // Grant all privileges on wildcard name (username\_%) + $q = 'GRANT ALL PRIVILEGES ON ' + . PMA_backquote(PMA_sqlAddSlashes($username) . '\_%') . '.* TO \'' + . PMA_sqlAddSlashes($username) . '\'@\'' . PMA_sqlAddSlashes($hostname) . '\';'; + $sql_query .= $q; + if (! PMA_DBI_try_query($q)) { + $message = PMA_Message::rawError(PMA_DBI_getError()); + } + break; + case '3' : + // Grant all privileges on the specified database to the new user + $q = 'GRANT ALL PRIVILEGES ON ' + . PMA_backquote(PMA_sqlAddSlashes($dbname)) . '.* TO \'' + . PMA_sqlAddSlashes($username) . '\'@\'' . PMA_sqlAddSlashes($hostname) . '\';'; + $sql_query .= $q; + if (! PMA_DBI_try_query($q)) { + $message = PMA_Message::rawError(PMA_DBI_getError()); + } + break; + case '0' : + default : + break; } } else { if (isset($create_user_real)) { @@ -1109,24 +1120,23 @@ if (isset($_REQUEST['adduser_submit']) || isset($_REQUEST['change_copy'])) { * Changes / copies a user, part III */ if (isset($_REQUEST['change_copy'])) { - $user_host_condition = - ' WHERE `User`' + $user_host_condition = ' WHERE `User`' .' = \'' . PMA_sqlAddSlashes($old_username) . "'" .' AND `Host`' .' = \'' . PMA_sqlAddSlashes($old_hostname) . '\';'; $res = PMA_DBI_query('SELECT * FROM `mysql`.`db`' . $user_host_condition); while ($row = PMA_DBI_fetch_assoc($res)) { - $queries[] = - 'GRANT ' . join(', ', PMA_extractPrivInfo($row)) + $queries[] = 'GRANT ' . join(', ', PMA_extractPrivInfo($row)) .' ON ' . PMA_backquote($row['Db']) . '.*' .' TO \'' . PMA_sqlAddSlashes($username) . '\'@\'' . PMA_sqlAddSlashes($hostname) . '\'' . ($row['Grant_priv'] == 'Y' ? ' WITH GRANT OPTION;' : ';'); } PMA_DBI_free_result($res); $res = PMA_DBI_query( - 'SELECT `Db`, `Table_name`, `Table_priv`' - .' FROM `mysql`.`tables_priv`' . $user_host_condition, - $GLOBALS['userlink'], PMA_DBI_QUERY_STORE); + 'SELECT `Db`, `Table_name`, `Table_priv` FROM `mysql`.`tables_priv`' . $user_host_condition, + $GLOBALS['userlink'], + PMA_DBI_QUERY_STORE + ); while ($row = PMA_DBI_fetch_assoc($res)) { $res2 = PMA_DBI_QUERY( @@ -1141,7 +1151,9 @@ if (isset($_REQUEST['change_copy'])) { .' AND `Table_name`' .' = \'' . PMA_sqlAddSlashes($row['Table_name']) . "'" .';', - null, PMA_DBI_QUERY_STORE); + null, + PMA_DBI_QUERY_STORE + ); $tmp_privs1 = PMA_extractPrivInfo($row); $tmp_privs2 = array( @@ -1167,21 +1179,20 @@ if (isset($_REQUEST['change_copy'])) { } unset($tmp_array); } - if (count($tmp_privs2['Select']) > 0 && !in_array('SELECT', $tmp_privs1)) { + if (count($tmp_privs2['Select']) > 0 && ! in_array('SELECT', $tmp_privs1)) { $tmp_privs1[] = 'SELECT (`' . join('`, `', $tmp_privs2['Select']) . '`)'; } - if (count($tmp_privs2['Insert']) > 0 && !in_array('INSERT', $tmp_privs1)) { + if (count($tmp_privs2['Insert']) > 0 && ! in_array('INSERT', $tmp_privs1)) { $tmp_privs1[] = 'INSERT (`' . join('`, `', $tmp_privs2['Insert']) . '`)'; } - if (count($tmp_privs2['Update']) > 0 && !in_array('UPDATE', $tmp_privs1)) { + if (count($tmp_privs2['Update']) > 0 && ! in_array('UPDATE', $tmp_privs1)) { $tmp_privs1[] = 'UPDATE (`' . join('`, `', $tmp_privs2['Update']) . '`)'; } - if (count($tmp_privs2['References']) > 0 && !in_array('REFERENCES', $tmp_privs1)) { + if (count($tmp_privs2['References']) > 0 && ! in_array('REFERENCES', $tmp_privs1)) { $tmp_privs1[] = 'REFERENCES (`' . join('`, `', $tmp_privs2['References']) . '`)'; } unset($tmp_privs2); - $queries[] = - 'GRANT ' . join(', ', $tmp_privs1) + $queries[] = 'GRANT ' . join(', ', $tmp_privs1) . ' ON ' . PMA_backquote($row['Db']) . '.' . PMA_backquote($row['Table_name']) . ' TO \'' . PMA_sqlAddSlashes($username) . '\'@\'' . PMA_sqlAddSlashes($hostname) . '\'' . (in_array('Grant', explode(',', $row['Table_priv'])) ? ' WITH GRANT OPTION;' : ';'); @@ -1192,15 +1203,13 @@ if (isset($_REQUEST['change_copy'])) { /** * Updates privileges */ -if (!empty($update_privs)) { +if (! empty($update_privs)) { $db_and_table = PMA_wildcardEscapeForGrant($dbname, (isset($tablename) ? $tablename : '')); - $sql_query0 = - 'REVOKE ALL PRIVILEGES ON ' . $db_and_table + $sql_query0 = 'REVOKE ALL PRIVILEGES ON ' . $db_and_table . ' FROM \'' . PMA_sqlAddSlashes($username) . '\'@\'' . PMA_sqlAddSlashes($hostname) . '\';'; if (! isset($Grant_priv) || $Grant_priv != 'Y') { - $sql_query1 = - 'REVOKE GRANT OPTION ON ' . $db_and_table + $sql_query1 = 'REVOKE GRANT OPTION ON ' . $db_and_table . ' FROM \'' . PMA_sqlAddSlashes($username) . '\'@\'' . PMA_sqlAddSlashes($hostname) . '\';'; } else { $sql_query1 = ''; @@ -1209,8 +1218,7 @@ if (!empty($update_privs)) { // Should not do a GRANT USAGE for a table-specific privilege, it // causes problems later (cannot revoke it) if (! (isset($tablename) && 'USAGE' == implode('', PMA_extractPrivInfo()))) { - $sql_query2 = - 'GRANT ' . join(', ', PMA_extractPrivInfo()) + $sql_query2 = 'GRANT ' . join(', ', PMA_extractPrivInfo()) . ' ON ' . $db_and_table . ' TO \'' . PMA_sqlAddSlashes($username) . '\'@\'' . PMA_sqlAddSlashes($hostname) . '\''; @@ -1250,7 +1258,7 @@ if (!empty($update_privs)) { // See
https://sourceforge.net/tracker/index.php?func=detail&aid=3285929&group_id=…
$sql_query0 = ''; } - if (isset($sql_query1) && !PMA_DBI_try_query($sql_query1)) { + if (isset($sql_query1) && ! PMA_DBI_try_query($sql_query1)) { // this one may fail, too... $sql_query1 = ''; } @@ -1271,11 +1279,9 @@ if (!empty($update_privs)) { if (isset($_REQUEST['revokeall'])) { $db_and_table = PMA_wildcardEscapeForGrant($dbname, isset($tablename) ? $tablename : ''); - $sql_query0 = - 'REVOKE ALL PRIVILEGES ON ' . $db_and_table + $sql_query0 = 'REVOKE ALL PRIVILEGES ON ' . $db_and_table . ' FROM \'' . PMA_sqlAddSlashes($username) . '\'@\'' . PMA_sqlAddSlashes($hostname) . '\';'; - $sql_query1 = - 'REVOKE GRANT OPTION ON ' . $db_and_table + $sql_query1 = 'REVOKE GRANT OPTION ON ' . $db_and_table . ' FROM \'' . PMA_sqlAddSlashes($username) . '\'@\'' . PMA_sqlAddSlashes($hostname) . '\';'; PMA_DBI_query($sql_query0); @@ -1312,7 +1318,7 @@ if (isset($_REQUEST['change_pw'])) { // here $nopass could be == 1 if (empty($message)) { - $hashing_function = (!empty($pw_hash) && $pw_hash == 'old' ? 'OLD_' : '') + $hashing_function = (! empty($pw_hash) && $pw_hash == 'old' ? 'OLD_' : '') . 'PASSWORD'; // in $sql_query which will be displayed, hide the password @@ -1442,13 +1448,13 @@ $link_export = '<a class="export_user_anchor ' . $conditional_class . '" href="s . '</a>'; /** - * If we are in an Ajax request for Create User/Edit User/Revoke User/Flush Privileges, - * show $message and exit. + * If we are in an Ajax request for Create User/Edit User/Revoke User/ + * Flush Privileges, show $message and exit. */ if ($GLOBALS['is_ajax_request'] && ! isset($_REQUEST['export']) && (! isset($_REQUEST['adduser']) || $_add_user_error) && ! isset($_REQUEST['initial']) && ! isset($_REQUEST['showall']) && ! isset($_REQUEST['edit_user_dialog']) && ! isset($_REQUEST['db_specific'])) { if (isset($sql_query)) { - $extra_data['sql_query'] = PMA_showMessage(NULL, $sql_query); + $extra_data['sql_query'] = PMA_showMessage(null, $sql_query); } if (isset($_REQUEST['adduser_submit']) || isset($_REQUEST['change_copy'])) { @@ -1456,12 +1462,12 @@ if ($GLOBALS['is_ajax_request'] && ! isset($_REQUEST['export']) && (! isset($_RE * generate html on the fly for the new user that was just created. */ $new_user_string = '<tr>'."\n" - .'<td> <input type="checkbox" name="selected_usr[]" id="checkbox_sel_users_" value="' . htmlspecialchars($username) . '&#27;' . htmlspecialchars($hostname) . '" /> </td>'."\n" + .'<td> <input type="checkbox" name="selected_usr[]" id="checkbox_sel_users_" value="' . htmlspecialchars($username) . '&#27;' . htmlspecialchars($hostname) . '" /> </td>' . "\n" .'<td><label for="checkbox_sel_users_">' . (empty($username) ? '<span style="color: #FF0000">' . __('Any') . '</span>' : htmlspecialchars($username) ) . '</label></td>' . "\n" .'<td>' . htmlspecialchars($hostname) . '</td>' . "\n"; $new_user_string .= '<td>'; - if (!empty($password) || isset($pma_pw)) { + if (! empty($password) || isset($pma_pw)) { $new_user_string .= __('Yes'); } else { $new_user_string .= '<span style="color: #FF0000">' . __('No') . '</span>'; @@ -1479,8 +1485,8 @@ if ($GLOBALS['is_ajax_request'] && ! isset($_REQUEST['export']) && (! isset($_RE $new_user_string .='</td>'; - $new_user_string .= '<td>'.sprintf($link_edit, urlencode($username), urlencode($hostname), '', '' ).'</td>'."\n"; - $new_user_string .= '<td>'.sprintf($link_export, urlencode($username), urlencode($hostname), (isset($initial) ? $initial : '')).'</td>'."\n"; + $new_user_string .= '<td>' . sprintf($link_edit, urlencode($username), urlencode($hostname), '', '') . '</td>' . "\n"; + $new_user_string .= '<td>' . sprintf($link_export, urlencode($username), urlencode($hostname), (isset($initial) ? $initial : '')) . '</td>' . "\n"; $new_user_string .= '</tr>'; @@ -1500,7 +1506,7 @@ if ($GLOBALS['is_ajax_request'] && ! isset($_REQUEST['export']) && (! isset($_RE if (isset($update_privs)) { $extra_data['db_specific_privs'] = false; if (isset($dbname_is_wildcard)) { - $extra_data['db_specific_privs'] = !$dbname_is_wildcard; + $extra_data['db_specific_privs'] = ! $dbname_is_wildcard; } $new_privileges = join(', ', PMA_extractPrivInfo('', true)); @@ -1521,10 +1527,10 @@ if (isset($viewing_mode) && $viewing_mode == 'db') { // Gets the database structure $sub_part = '_structure'; - require './libraries/db_info.inc.php'; + include './libraries/db_info.inc.php'; echo "\n"; } else { - require './libraries/server_links.inc.php'; + include './libraries/server_links.inc.php'; } @@ -1555,8 +1561,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs . __('User overview') . "\n" . '</h2>' . "\n"; - $sql_query = - 'SELECT *,' . + $sql_query = 'SELECT *,' . " IF(`Password` = _latin1 '', 'N', 'Y') AS 'Password'" . ' FROM `mysql`.`user`'; @@ -1574,7 +1579,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs $sql_query = 'SELECT * FROM `mysql`.`user`'; $res = PMA_DBI_try_query($sql_query, null, PMA_DBI_QUERY_STORE); - if (!$res) { + if (! $res) { PMA_Message::error(__('No Privileges'))->display(); PMA_DBI_free_result($res); unset($res); @@ -1634,9 +1639,9 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs /** * Displays the initials - * In an Ajax request, we don't need to show this. Also not necassary if there is less than 20 privileges + * In an Ajax request, we don't need to show this. + * Also not necassary if there is less than 20 privileges */ - if ($GLOBALS['is_ajax_request'] != true && PMA_DBI_num_rows($res) > 20 ) { // initialize to false the letters A-Z @@ -1716,16 +1721,16 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs . ' <td>' . htmlspecialchars($host['Host']) . '</td>' . "\n"; echo ' <td>'; switch ($host['Password']) { - case 'Y': - echo __('Yes'); - break; - case 'N': - echo '<span style="color: #FF0000">' . __('No') . '</span>'; - break; - // this happens if this is a definition not coming from mysql.user - default: - echo '--'; // in future version, replace by "not present" - break; + case 'Y': + echo __('Yes'); + break; + case 'N': + echo '<span style="color: #FF0000">' . __('No') . '</span>'; + break; + // this happens if this is a definition not coming from mysql.user + default: + echo '--'; // in future version, replace by "not present" + break; } // end switch echo '</td>' . "\n" . ' <td><tt>' . "\n" @@ -1797,7 +1802,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs $flushnote->addParam('<a href="server_privileges.php?' . $GLOBALS['url_query'] . '&flush_privileges=1" id="reload_privileges_anchor" class="' . $conditional_class . '">', false); $flushnote->addParam('</a>', false); $flushnote->display(); - } + } } else { @@ -1812,7 +1817,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs echo '<h2>' . "\n" . PMA_getIcon('b_usredit.png') . __('Edit Privileges') . ': ' - . __('User') ; + . __('User'); if (isset($dbname)) { echo ' <i><a href="server_privileges.php?' @@ -1864,8 +1869,10 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs } echo PMA_generate_common_hidden_inputs($_params); - PMA_displayPrivTable(PMA_ifSetOr($dbname, '*', 'length'), - PMA_ifSetOr($tablename, '*', 'length')); + PMA_displayPrivTable( + PMA_ifSetOr($dbname, '*', 'length'), + PMA_ifSetOr($tablename, '*', 'length') + ); echo '</form>' . "\n"; @@ -1892,8 +1899,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs . '</thead>' . "\n" . '<tbody>' . "\n"; - $user_host_condition = - ' WHERE `User`' + $user_host_condition = ' WHERE `User`' . ' = \'' . PMA_sqlAddSlashes($username) . "'" . ' AND `Host`' . ' = \'' . PMA_sqlAddSlashes($hostname) . "'"; @@ -1942,7 +1948,8 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs // as we are in the db specific rights display we want // all db names escaped, also from other sources $db_rights_row['Db'] = PMA_escape_mysql_wildcards( - $db_rights_row['Db']); + $db_rights_row['Db'] + ); $db_rights[$db_rights_row['Db']] = $db_rights_row; } @@ -2011,8 +2018,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs PMA_DBI_free_result($db_rights_result); unset($db_rights_sql, $db_rights_sqls, $db_rights_result, $db_rights_row); - $sql_query = - 'SELECT `Table_name`,' + $sql_query = 'SELECT `Table_name`,' .' `Table_priv`,' .' IF(`Column_priv` = _latin1 \'\', 0, 1)' .' AS \'Column_priv\'' @@ -2060,17 +2066,23 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs } echo '</td>' . "\n" . ' <td>'; - printf($link_edit, htmlspecialchars(urlencode($username)), + printf( + $link_edit, + htmlspecialchars(urlencode($username)), urlencode(htmlspecialchars($hostname)), urlencode((! isset($dbname)) ? $row['Db'] : htmlspecialchars($dbname)), - urlencode((! isset($dbname)) ? '' : $row['Table_name'])); + urlencode((! isset($dbname)) ? '' : $row['Table_name']) + ); echo '</td>' . "\n" . ' <td>'; if (! empty($row['can_delete']) || isset($row['Table_name']) && strlen($row['Table_name'])) { - printf($link_revoke, htmlspecialchars(urlencode($username)), + printf( + $link_revoke, + htmlspecialchars(urlencode($username)), urlencode(htmlspecialchars($hostname)), urlencode((! isset($dbname)) ? $row['Db'] : htmlspecialchars($dbname)), - urlencode((! isset($dbname)) ? '' : $row['Table_name'])); + urlencode((! isset($dbname)) ? '' : $row['Table_name']) + ); } echo '</td>' . "\n" . '</tr>' . "\n"; @@ -2088,7 +2100,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs $pred_db_array =PMA_DBI_fetch_result('SHOW DATABASES;'); echo ' <label for="text_dbname">' . __('Add privileges on the following database') . ':</label>' . "\n"; - if (!empty($pred_db_array)) { + if (! empty($pred_db_array)) { echo ' <select name="pred_dbname" class="autosubmit">' . "\n" . ' <option value="" selected="selected">' . __('Use text field') . ':</option>' . "\n"; foreach ($pred_db_array as $current_db) { @@ -2112,13 +2124,13 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs if ($res = @PMA_DBI_try_query('SHOW TABLES FROM ' . PMA_backquote(PMA_unescape_mysql_wildcards($dbname)) . ';', null, PMA_DBI_QUERY_STORE)) { $pred_tbl_array = array(); while ($row = PMA_DBI_fetch_row($res)) { - if (! isset($found_rows) || !in_array($row[0], $found_rows)) { + if (! isset($found_rows) || ! in_array($row[0], $found_rows)) { $pred_tbl_array[] = $row[0]; } } PMA_DBI_free_result($res); unset($res, $row); - if (!empty($pred_tbl_array)) { + if (! empty($pred_tbl_array)) { echo ' <select name="pred_tablename" class="autosubmit">' . "\n" . ' <option value="" selected="selected">' . __('Use text field') . ':</option>' . "\n"; foreach ($pred_tbl_array as $current_table) { @@ -2158,7 +2170,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs } if (! isset($dbname) && ! $user_does_not_exists) { - require_once './libraries/display_change_password.lib.php'; + include_once './libraries/display_change_password.lib.php'; echo '<form action="server_privileges.php" method="post" onsubmit="return checkPassword(this);">' . "\n" . PMA_generate_common_hidden_inputs('', '') @@ -2205,7 +2217,10 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs '2' => __('Grant all privileges on wildcard name (username\\_%)')); if (! empty($dbname) ) { - $choices['3'] = sprintf( __('Grant all privileges on database "%s"'), htmlspecialchars($dbname)); + $choices['3'] = sprintf( + __('Grant all privileges on database "%s"'), + htmlspecialchars($dbname) + ); $default_choice = 3; echo '<input type="hidden" name="dbname" value="' . htmlspecialchars($dbname) . '" />' . "\n"; } @@ -2291,8 +2306,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs . ' AND `Trigger_priv` = \'N\''; } - $sql_query = - '(SELECT ' . $list_of_privileges . ', `Db`' + $sql_query = '(SELECT ' . $list_of_privileges . ', `Db`' .' FROM `mysql`.`db`' .' WHERE \'' . PMA_sqlAddSlashes($checkprivs) . "'" .' LIKE `Db`' @@ -2358,7 +2372,8 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs urlencode($current_user), urlencode($current_host), urlencode(! isset($current['Db']) || $current['Db'] == '*' ? '' : $current['Db']), - ''); + '' + ); $user_form .= '</td>' . "\n" . ' </tr>' . "\n"; } hooks/post-receive -- phpMyAdmin
12 years, 11 months
1
0
0
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_5RC1-19134-g3d3a528
by Madhura Jayaratne
The branch, master has been updated via 3d3a5283dc334c7fb54160293acc57a984faac1b (commit) via d3bd40b56d619f0672e323844095cc8b36e9e49e (commit) via e27ba519c5265109d6e3ad629297d057b2c53496 (commit) from 6f9f58080e06e795aba963ad169e438e6fae00a2 (commit) - Log ----------------------------------------------------------------- commit 3d3a5283dc334c7fb54160293acc57a984faac1b Merge: 6f9f580 d3bd40b Author: Madhura Jayaratne <madhura.cj(a)gmail.com> Date: Wed Sep 14 22:50:54 2011 +0530 Merge branch 'QA_3_4' ----------------------------------------------------------------------- Summary of changes: ChangeLog | 1 + js/server_privileges.js | 2 +- server_privileges.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 37671bb..1ce49af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -54,6 +54,7 @@ phpMyAdmin - ChangeLog - bug #3404886 [navi] Edit SQL statement after error - bug #3403165 [interface] Collation not displayed for long enum fields - bug #3399951 [export] Config for export compression not used +- bug #3400690 [privileges] DB-specific privileges won't submit 3.4.5.0 (2011-09-14) - bug #3375325 [interface] Page list in navigation frame looks odd diff --git a/js/server_privileges.js b/js/server_privileges.js index c695dab..738d64b 100644 --- a/js/server_privileges.js +++ b/js/server_privileges.js @@ -385,7 +385,7 @@ $(document).ready(function() { * @memberOf jQuery * @name edit_user_submit */ - $("#edit_user_dialog").find("form").live('submit', function(event) { + $("#edit_user_dialog").find("form:not(#db_or_table_specific_priv)").live('submit', function(event) { /** @lends jQuery */ event.preventDefault(); diff --git a/server_privileges.php b/server_privileges.php index 2735de9..37ef25e 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -1875,7 +1875,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs // but only if $dbname contains no wildcards // table header - echo '<form action="server_privileges.php" method="post">' . "\n" + echo '<form action="server_privileges.php" id="db_or_table_specific_priv" method="post">' . "\n" . PMA_generate_common_hidden_inputs('', '') . '<input type="hidden" name="username" value="' . htmlspecialchars($username) . '" />' . "\n" . '<input type="hidden" name="hostname" value="' . htmlspecialchars($hostname) . '" />' . "\n" hooks/post-receive -- phpMyAdmin
12 years, 11 months
1
0
0
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_5RC1-19131-g6f9f580
by Madhura Jayaratne
The branch, master has been updated via 6f9f58080e06e795aba963ad169e438e6fae00a2 (commit) via 1f26c2f84181deab4cfcafe3a862520c5ee456e3 (commit) via 5959ae1c5a9fb19e5fbb736f91919684f36b0454 (commit) via 2260e1081463c5e05df12ecd30346c362a9fb91b (commit) from abc1d3c345dfd11ea3d940c5b944d05fc173ec34 (commit) - Log ----------------------------------------------------------------- commit 6f9f58080e06e795aba963ad169e438e6fae00a2 Merge: 1f26c2f abc1d3c Author: Madhura Jayaratne <madhura.cj(a)gmail.com> Date: Wed Sep 14 22:49:09 2011 +0530 Merge branch 'master' of
ssh://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit 1f26c2f84181deab4cfcafe3a862520c5ee456e3 Author: Madhura Jayaratne <madhura.cj(a)gmail.com> Date: Wed Sep 14 15:29:09 2011 +0530 Wrap some long lines commit 5959ae1c5a9fb19e5fbb736f91919684f36b0454 Author: Madhura Jayaratne <madhura.cj(a)gmail.com> Date: Wed Sep 14 15:09:48 2011 +0530 Coding style improvements commit 2260e1081463c5e05df12ecd30346c362a9fb91b Author: Madhura Jayaratne <madhura.cj(a)gmail.com> Date: Wed Sep 14 15:02:46 2011 +0530 Proper indentation for switch-case statement ----------------------------------------------------------------------- Summary of changes: db_structure.php | 236 ++++++++++++++++++++++++++++++++--------------------- 1 files changed, 142 insertions(+), 94 deletions(-) diff --git a/db_structure.php b/db_structure.php index 8673471..b46fe29 100644 --- a/db_structure.php +++ b/db_structure.php @@ -22,7 +22,8 @@ $GLOBALS['js_include'][] = 'jquery/timepicker.js'; if (empty($is_info)) { // Drops/deletes/etc. multiple tables if required if ((!empty($submit_mult) && isset($selected_tbl)) - || isset($mult_btn)) { + || isset($mult_btn) + ) { $action = 'db_structure.php'; $err_url = 'db_structure.php?'. PMA_generate_common_url($db); @@ -96,7 +97,10 @@ if (isset($_REQUEST['sort_order'])) { $_url_params['sort_order'] = $_REQUEST['sort_order']; } -PMA_listNavigator($total_num_tables, $pos, $_url_params, 'db_structure.php', 'frame_content', $GLOBALS['cfg']['MaxTableList']); +PMA_listNavigator( + $total_num_tables, $pos, $_url_params, 'db_structure.php', + 'frame_content', $GLOBALS['cfg']['MaxTableList'] +); ?> <form method="post" action="db_structure.php" name="tablesForm" id="tablesForm"> @@ -110,7 +114,9 @@ $sum_size = (double) 0; $overhead_size = (double) 0; $overhead_check = ''; $checked = !empty($checkall) ? ' checked="checked"' : ''; -$num_columns = $cfg['PropertiesNumColumns'] > 1 ? ceil($num_tables / $cfg['PropertiesNumColumns']) + 1 : 0; +$num_columns = $cfg['PropertiesNumColumns'] > 1 + ? ceil($num_tables / $cfg['PropertiesNumColumns']) + 1 + : 0; $row_count = 0; @@ -139,83 +145,88 @@ foreach ($tables as $keyname => $each_table) { switch ( $each_table['ENGINE']) { // MyISAM, ISAM or Heap table: Row count, data size and index size // are accurate; data size is accurate for ARCHIVE - case 'MyISAM' : - case 'ISAM' : - case 'HEAP' : - case 'MEMORY' : - case 'ARCHIVE' : - case 'Aria' : - case 'Maria' : - if ($db_is_information_schema) { - $each_table['Rows'] = PMA_Table::countRecords($db, - $each_table['Name']); - } + case 'MyISAM' : + case 'ISAM' : + case 'HEAP' : + case 'MEMORY' : + case 'ARCHIVE' : + case 'Aria' : + case 'Maria' : + if ($db_is_information_schema) { + $each_table['Rows'] = PMA_Table::countRecords( + $db, $each_table['Name'] + ); + } - if ($is_show_stats) { - $tblsize = doubleval($each_table['Data_length']) + doubleval($each_table['Index_length']); - $sum_size += $tblsize; - list($formatted_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0); - if (isset($each_table['Data_free']) && $each_table['Data_free'] > 0) { - list($formatted_overhead, $overhead_unit) = PMA_formatByteDown($each_table['Data_free'], 3, ($each_table['Data_free'] > 0) ? 1 : 0); - $overhead_size += $each_table['Data_free']; - } - } - break; - case 'InnoDB' : - case 'PBMS' : - // InnoDB table: Row count is not accurate but data and index sizes are. - // PBMS table in Drizzle: TABLE_ROWS is taken from table cache, so it may be unavailable - - if (($each_table['ENGINE'] == 'InnoDB' && $each_table['TABLE_ROWS'] < $GLOBALS['cfg']['MaxExactCount']) - || !isset($each_table['TABLE_ROWS'])) { - $each_table['COUNTED'] = true; - $each_table['TABLE_ROWS'] = PMA_Table::countRecords($db, - $each_table['TABLE_NAME'], $force_exact = true, - $is_view = false); - } else { - $each_table['COUNTED'] = false; + if ($is_show_stats) { + $tblsize = doubleval($each_table['Data_length']) + doubleval($each_table['Index_length']); + $sum_size += $tblsize; + list($formatted_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0); + if (isset($each_table['Data_free']) && $each_table['Data_free'] > 0) { + list($formatted_overhead, $overhead_unit) = PMA_formatByteDown($each_table['Data_free'], 3, ($each_table['Data_free'] > 0) ? 1 : 0); + $overhead_size += $each_table['Data_free']; } + } + break; + case 'InnoDB' : + case 'PBMS' : + // InnoDB table: Row count is not accurate but data and index sizes are. + // PBMS table in Drizzle: TABLE_ROWS is taken from table cache, so it may be unavailable + + if (($each_table['ENGINE'] == 'InnoDB' + && $each_table['TABLE_ROWS'] < $GLOBALS['cfg']['MaxExactCount']) + || !isset($each_table['TABLE_ROWS']) + ) { + $each_table['COUNTED'] = true; + $each_table['TABLE_ROWS'] = PMA_Table::countRecords( + $db, $each_table['TABLE_NAME'], + $force_exact = true, $is_view = false + ); + } else { + $each_table['COUNTED'] = false; + } - // Drizzle doesn't provide data and index length, check for null - if ($is_show_stats && $each_table['Data_length'] !== null) { - $tblsize = $each_table['Data_length'] + $each_table['Index_length']; - $sum_size += $tblsize; - list($formatted_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0); - } - //$display_rows = ' - '; - break; - // Mysql 5.0.x (and lower) uses MRG_MyISAM and MySQL 5.1.x (and higher) uses MRG_MYISAM - // Both are aliases for MERGE - case 'MRG_MyISAM' : - case 'MRG_MYISAM' : - case 'MERGE' : - case 'BerkeleyDB' : - // Merge or BerkleyDB table: Only row count is accurate. - if ($is_show_stats) { - $formatted_size = ' - '; - $unit = ''; - } - break; - // for a view, the ENGINE is sometimes reported as null, - // or on some servers it's reported as "SYSTEM VIEW" - case null : - case 'SYSTEM VIEW' : - case 'FunctionEngine' : - // if table is broken, Engine is reported as null, so one more test - if ($each_table['TABLE_TYPE'] == 'VIEW') { - // countRecords() takes care of $cfg['MaxExactCountViews'] - $each_table['TABLE_ROWS'] = PMA_Table::countRecords($db, - $each_table['TABLE_NAME'], $force_exact = true, - $is_view = true); - $table_is_view = true; - } - break; - default : - // Unknown table type. - if ($is_show_stats) { - $formatted_size = 'unknown'; - $unit = ''; - } + // Drizzle doesn't provide data and index length, check for null + if ($is_show_stats && $each_table['Data_length'] !== null) { + $tblsize = $each_table['Data_length'] + $each_table['Index_length']; + $sum_size += $tblsize; + list($formatted_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0); + } + //$display_rows = ' - '; + break; + // Mysql 5.0.x (and lower) uses MRG_MyISAM and MySQL 5.1.x (and higher) uses MRG_MYISAM + // Both are aliases for MERGE + case 'MRG_MyISAM' : + case 'MRG_MYISAM' : + case 'MERGE' : + case 'BerkeleyDB' : + // Merge or BerkleyDB table: Only row count is accurate. + if ($is_show_stats) { + $formatted_size = ' - '; + $unit = ''; + } + break; + // for a view, the ENGINE is sometimes reported as null, + // or on some servers it's reported as "SYSTEM VIEW" + case null : + case 'SYSTEM VIEW' : + case 'FunctionEngine' : + // if table is broken, Engine is reported as null, so one more test + if ($each_table['TABLE_TYPE'] == 'VIEW') { + // countRecords() takes care of $cfg['MaxExactCountViews'] + $each_table['TABLE_ROWS'] = PMA_Table::countRecords( + $db, $each_table['TABLE_NAME'], + $force_exact = true, $is_view = true + ); + $table_is_view = true; + } + break; + default : + // Unknown table type. + if ($is_show_stats) { + $formatted_size = 'unknown'; + $unit = ''; + } } // end switch if (! PMA_Table::isMerge($db, $each_table['TABLE_NAME'])) { @@ -254,7 +265,8 @@ foreach ($tables as $keyname => $each_table) { $row_count++; if ($table_is_view) { - $hidden_fields[] = '<input type="hidden" name="views[]" value="' . htmlspecialchars($each_table['TABLE_NAME']) . '" />'; + $hidden_fields[] = '<input type="hidden" name="views[]" value="' + . htmlspecialchars($each_table['TABLE_NAME']) . '" />'; } if ($each_table['TABLE_ROWS'] > 0 || $table_is_view) { @@ -287,20 +299,27 @@ foreach ($tables as $keyname => $each_table) { . ' ' . PMA_backquote($each_table['TABLE_NAME']); $drop_message = sprintf( $table_is_view ? __('View %s has been dropped') : __('Table %s has been dropped'), - str_replace(' ', ' ', htmlspecialchars($each_table['TABLE_NAME']))); + str_replace(' ', ' ', htmlspecialchars($each_table['TABLE_NAME'])) + ); } $tracking_icon = ''; if (PMA_Tracker::isActive()) { if (PMA_Tracker::isTracked($GLOBALS["db"], $truename)) { - $tracking_icon = '<a href="tbl_tracking.php?' . $url_query.'&table=' . $truename . '"><img class="icon ic_eye" src="themes/dot.gif" alt="' . __('Tracking is active.') . '" title="' . __('Tracking is active.') . '" /></a>'; + $tracking_icon = '<a href="tbl_tracking.php?' . $url_query + . '&table=' . $truename . '"><img class="icon ic_eye" src="themes/dot.gif" alt="' + . __('Tracking is active.') . '" title="' . __('Tracking is active.') . '" /></a>'; } elseif (PMA_Tracker::getVersion($GLOBALS["db"], $truename) > 0) { - $tracking_icon = '<a href="tbl_tracking.php?' . $url_query . '&table=' . $truename . '"><img class="icon ic_eye" src="themes/dot.gif" alt="' . __('Tracking is not active.') . '" title="' . __('Tracking is not active.') . '" /></a>'; + $tracking_icon = '<a href="tbl_tracking.php?' . $url_query + . '&table=' . $truename . '"><img class="icon ic_eye" src="themes/dot.gif" alt="' + . __('Tracking is not active.') . '" title="' . __('Tracking is not active.') . '" /></a>'; } } - if ($num_columns > 0 && $num_tables > $num_columns - && (($row_count % $num_columns) == 0)) { + if ($num_columns > 0 + && $num_tables > $num_columns + && ($row_count % $num_columns) == 0 + ) { $row_count = 1; $odd_row = true; ?> @@ -325,17 +344,23 @@ foreach ($tables as $keyname => $each_table) { } foreach ($server_slave_Wild_Do_Table as $db_table) { $table_part = PMA_extract_db_or_table($db_table, 'table'); - if (($db == PMA_extract_db_or_table($db_table, 'db')) && (preg_match("@^" . substr($table_part, 0, strlen($table_part) - 1) . "@", $truename))) { + if (($db == PMA_extract_db_or_table($db_table, 'db')) + && (preg_match("@^" . substr($table_part, 0, strlen($table_part) - 1) . "@", $truename)) + ) { $do = true; } } //////////////////////////////////////////////////////////////////// - if ((strlen(array_search($truename, $server_slave_Ignore_Table)) > 0) || (strlen(array_search($db, $server_slave_Ignore_DB)) > 0)) { + if ((strlen(array_search($truename, $server_slave_Ignore_Table)) > 0) + || (strlen(array_search($db, $server_slave_Ignore_DB)) > 0) + ) { $ignored = true; } foreach ($server_slave_Wild_Ignore_Table as $db_table) { $table_part = PMA_extract_db_or_table($db_table, 'table'); - if (($db == PMA_extract_db_or_table($db_table)) && (preg_match("@^" . substr($table_part, 0, strlen($table_part) - 1) . "@", $truename))) { + if (($db == PMA_extract_db_or_table($db_table)) + && (preg_match("@^" . substr($table_part, 0, strlen($table_part) - 1) . "@", $truename)) + ) { $ignored = true; } } @@ -350,7 +375,13 @@ foreach ($tables as $keyname => $each_table) { <th><?php echo $browse_table_label; ?> <?php echo (! empty($tracking_icon) ? $tracking_icon : ''); ?> </th> - <?php if ($server_slave_status) { ?><td align="center"><?php echo $ignored ? ' <img class="icon ic_s_cancel" src="themes/dot.gif" alt="NOT REPLICATED" />' : ''. $do ? ' <img class="icon ic_s_success" src="themes/dot.gif" alt="REPLICATED" />' : ''; ?></td><?php } ?> + <?php if ($server_slave_status) { ?><td align="center"><?php + echo $ignored + ? ' <img class="icon ic_s_cancel" src="themes/dot.gif" alt="NOT REPLICATED" />' + : ''. + $do + ? ' <img class="icon ic_s_success" src="themes/dot.gif" alt="REPLICATED" />' + : ''; ?></td><?php } ?> <td align="center"><?php echo $browse_table; ?></td> <td align="center"> <a href="tbl_structure.php?<?php echo $tbl_url_query; ?>"> @@ -380,10 +411,20 @@ foreach ($tables as $keyname => $each_table) { if ($table_is_view) { // Drizzle views use FunctionEngine, and the only place where they are available are I_S and D_D // schemas, where we do exact counting - if ($each_table['TABLE_ROWS'] >= $GLOBALS['cfg']['MaxExactCountViews'] && $each_table['ENGINE'] != 'FunctionEngine') { + if ($each_table['TABLE_ROWS'] >= $GLOBALS['cfg']['MaxExactCountViews'] + && $each_table['ENGINE'] != 'FunctionEngine' + ) { $row_count_pre = '~'; $sum_row_count_pre = '~'; - $show_superscript = PMA_showHint(PMA_sanitize(sprintf(__('This view has at least this number of rows. Please refer to %sdocumentation%s.'), '[a@./Documentation.html#cfg_MaxExactCountViews@_blank]', '[/a]'))); + $show_superscript = PMA_showHint( + PMA_sanitize( + sprintf( + __('This view has at least this number of rows. Please refer to %sdocumentation%s.'), + '[a@./Documentation.html#cfg_MaxExactCountViews@_blank]', + '[/a]' + ) + ) + ); } } elseif ($each_table['ENGINE'] == 'InnoDB' && (! $each_table['COUNTED'])) { // InnoDB table: we did not get an accurate row count @@ -437,10 +478,13 @@ if ($is_show_stats) { <?php // for blobstreaming - if the number of tables is 0, set tableReductionCount to 0 // (we don't want negative numbers here) - if ($num_tables == 0) + if ($num_tables == 0) { $tableReductionCount = 0; - - echo sprintf(_ngettext('%s table', '%s tables', $num_tables - $tableReductionCount), PMA_formatNumber($num_tables - $tableReductionCount, 0)); + } + echo sprintf( + _ngettext('%s table', '%s tables', $num_tables - $tableReductionCount), + PMA_formatNumber($num_tables - $tableReductionCount, 0) + ); ?> </th> <?php @@ -456,7 +500,8 @@ if (!($cfg['PropertiesNumColumns'] > 1)) { $default_engine = PMA_DBI_fetch_value('SHOW VARIABLES LIKE \'storage_engine\';', 0, 1); echo ' <th align="center">' . "\n" . ' <dfn title="' - . sprintf(__('%s is the default storage engine on this MySQL server.'), $default_engine) . '">' .$default_engine . '</dfn></th>' . "\n"; + . sprintf(__('%s is the default storage engine on this MySQL server.'), $default_engine) + . '">' .$default_engine . '</dfn></th>' . "\n"; // we got a case where $db_collation was empty echo ' <th align="center">' . "\n"; if (! empty($db_collation)) { @@ -545,7 +590,10 @@ if (!$db_is_information_schema && !$cfg['DisableMultiTableMaintenance']) { </form> <?php // display again the table list navigator -PMA_listNavigator($total_num_tables, $pos, $_url_params, 'db_structure.php', 'frame_content', $GLOBALS['cfg']['MaxTableList']); +PMA_listNavigator( + $total_num_tables, $pos, $_url_params, 'db_structure.php', + 'frame_content', $GLOBALS['cfg']['MaxTableList'] +); ?> </div> <hr /> hooks/post-receive -- phpMyAdmin
12 years, 11 months
1
0
0
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, QA_3_4, updated. RELEASE_3_4_5RC1-11-gd3bd40b
by Madhura Jayaratne
The branch, QA_3_4 has been updated via d3bd40b56d619f0672e323844095cc8b36e9e49e (commit) from e27ba519c5265109d6e3ad629297d057b2c53496 (commit) - Log ----------------------------------------------------------------- commit d3bd40b56d619f0672e323844095cc8b36e9e49e Author: Madhura Jayaratne <madhura.cj(a)gmail.com> Date: Wed Sep 14 22:43:48 2011 +0530 bug #3400690 [privileges] DB-specific privileges won't submit Db/table specific privileges has not been ajaxified. So skip it for now. ----------------------------------------------------------------------- Summary of changes: ChangeLog | 1 + js/server_privileges.js | 2 +- server_privileges.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d05c29a..83aa38d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ phpMyAdmin - ChangeLog - bug #3404886 [navi] Edit SQL statement after error - bug #3403165 [interface] Collation not displayed for long enum fields - bug #3399951 [export] Config for export compression not used +- bug #3400690 [privileges] DB-specific privileges won't submit 3.4.5.0 (2011-09-14) - bug #3375325 [interface] Page list in navigation frame looks odd diff --git a/js/server_privileges.js b/js/server_privileges.js index f178c6c..fe0f69f 100644 --- a/js/server_privileges.js +++ b/js/server_privileges.js @@ -346,7 +346,7 @@ $(document).ready(function() { * @memberOf jQuery * @name edit_user_submit */ - $("#edit_user_dialog").find("form").live('submit', function(event) { + $("#edit_user_dialog").find("form:not(#db_or_table_specific_priv)").live('submit', function(event) { /** @lends jQuery */ event.preventDefault(); diff --git a/server_privileges.php b/server_privileges.php index 81de01f..12fb1db 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -1790,7 +1790,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs // but only if $dbname contains no wildcards // table header - echo '<form action="server_privileges.php" method="post">' . "\n" + echo '<form action="server_privileges.php" id="db_or_table_specific_priv" method="post">' . "\n" . PMA_generate_common_hidden_inputs('', '') . '<input type="hidden" name="username" value="' . htmlspecialchars($username) . '" />' . "\n" . '<input type="hidden" name="hostname" value="' . htmlspecialchars($hostname) . '" />' . "\n" hooks/post-receive -- phpMyAdmin
12 years, 11 months
1
0
0
0
← Newer
1
...
7
8
9
10
11
12
13
...
17
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Results per page:
10
25
50
100
200