diff options
author | Herman van Rink <rink@initfour.nl> | 2011-05-13 11:36:13 +0400 |
---|---|---|
committer | Herman van Rink <rink@initfour.nl> | 2011-05-13 11:36:13 +0400 |
commit | 76a93bafdf69ece26e0492fbc903ec264456c6df (patch) | |
tree | 8bc2fc8e9e0b0e4efa3b375aa56c45e62e513277 /server_privileges.php | |
parent | 3ff49129e11e9e6e9ba9fd6ca376fbf510c2ffb4 (diff) | |
parent | 584679c854920714516932d9ad11f7055530f464 (diff) |
Merge branch 'QA_3_4'
Diffstat (limited to 'server_privileges.php')
-rw-r--r-- | server_privileges.php | 72 |
1 files changed, 21 insertions, 51 deletions
diff --git a/server_privileges.php b/server_privileges.php index daf8a990ba..44adb0d10d 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -509,6 +509,8 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = TRUE) // g l o b a l o r d b - s p e c i f i c // + $privTable_names = array(0 => __('Data'), 1 => __('Structure'), 2 => __('Administration')); + // d a t a $privTable[0] = array( array('Select', 'SELECT', __('Allows reading data.')), @@ -582,59 +584,27 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = TRUE) . $GLOBALS['url_query'] . '" onclick="setCheckboxes(\'addUsersForm_' . $random_n . '\', false); return false;">' . __('Uncheck All') . '</a>)' . "\n" . ' </legend>' . "\n" - . ' <p><small><i>' . __(' Note: MySQL privilege names are expressed in English ') . '</i></small></p>' . "\n" - . ' <fieldset>' . "\n" - . ' <legend>' . __('Data') . '</legend>' . "\n"; - foreach ($privTable[0] as $priv) - { - echo ' <div class="item">' . "\n" - . ' <input type="checkbox"' - . (empty($GLOBALS['checkall']) ? '' : ' checked="checked"') - . ' name="' . $priv[0] . '_priv" id="checkbox_' . $priv[0] - . '_priv" value="Y" ' - . ($row[$priv[0] . '_priv'] == 'Y' ? 'checked="checked" ' : '') - . 'title="' . $priv[2] . '"/>' . "\n" - . ' <label for="checkbox_' . $priv[0] - . '_priv"><tt><dfn title="' . $priv[2] . '">' . $priv[1] - . '</dfn></tt></label>' . "\n" - . ' </div>' . "\n"; - } - echo ' </fieldset>' . "\n" - . ' <fieldset>' . "\n" - . ' <legend>' . __('Structure') . '</legend>' . "\n"; - foreach ($privTable[1] as $priv) - { - echo ' <div class="item">' . "\n" - . ' <input type="checkbox"' - . (empty($GLOBALS['checkall']) ? '' : ' checked="checked"') - . ' name="' . $priv[0] . '_priv" id="checkbox_' . $priv[0] - . '_priv" value="Y" ' - . ($row[$priv[0] . '_priv'] == 'Y' ? 'checked="checked" ' : '') - . 'title="' . $priv[2] . '"/>' . "\n" - . ' <label for="checkbox_' . $priv[0] - . '_priv"><tt><dfn title="' . $priv[2] . '">' . $priv[1] - . '</dfn></tt></label>' . "\n" - . ' </div>' . "\n"; - } - echo ' </fieldset>' . "\n" - . ' <fieldset>' . "\n" - . ' <legend>' . __('Administration') . '</legend>' . "\n"; - foreach ($privTable[2] as $priv) - { - echo ' <div class="item">' . "\n" - . ' <input type="checkbox"' - . (empty($GLOBALS['checkall']) ? '' : ' checked="checked"') - . ' name="' . $priv[0] . '_priv" id="checkbox_' . $priv[0] - . '_priv" value="Y" ' - . ($row[$priv[0] . '_priv'] == 'Y' ? 'checked="checked" ' : '') - . 'title="' . $priv[2] . '"/>' . "\n" - . ' <label for="checkbox_' . $priv[0] - . '_priv"><tt><dfn title="' . $priv[2] . '">' . $priv[1] - . '</dfn></tt></label>' . "\n" - . ' </div>' . "\n"; + . ' <p><small><i>' . __(' Note: MySQL privilege names are expressed in English ') . '</i></small></p>' . "\n"; + + // Output the Global privilege tables with checkboxes + foreach($privTable as $i => $table) { + echo ' <fieldset>' . "\n" + . ' <legend>' . __($privTable_names[$i]) . '</legend>' . "\n"; + foreach ($table as $priv) + { + echo ' <div class="item">' . "\n" + . ' <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"' : '') + . '/>' . "\n" + . ' <label for="checkbox_' . $priv[0] . '_priv"><tt><dfn title="' . $priv[2] . '">' + . $priv[1] . '</dfn></tt></label>' . "\n" + . ' </div>' . "\n"; + } + echo ' </fieldset>' . "\n"; } - echo ' </fieldset>' . "\n"; // The "Resource limits" box is not displayed for db-specific privs if ($db == '*') { echo ' <fieldset>' . "\n" |