From d1346a3c2d6e3b0b15fc7d1f48a243b3c7d20c01 Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Thu, 13 Oct 2005 08:47:09 +0000 Subject: [PATCH] XHTML compl., NOTICE, Icons for Edit/Revoke Links --- ChangeLog | 2 + server_privileges.php | 124 ++++++++++++++++++++++++++++++------------ 2 files changed, 90 insertions(+), 36 deletions(-) diff --git a/ChangeLog b/ChangeLog index 736a8685d..538df31bd 100755 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,8 @@ $Source$ 2005-10-13 Sebastian Mendel * left.php: preselect db if only one db + * server_privileges.php: + XHTML compl., NOTICE, Icons for Edit/Revoke Links 2005-10-12 Sebastian Mendel * css/phpmyadmin.css.php, libraries/common.lib.php, diff --git a/server_privileges.php b/server_privileges.php index 44e5b39b4..ef5dd4255 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -28,8 +28,8 @@ if (!empty($pred_tablename)) { if (!$is_superuser) { require('./server_links.inc.php'); echo '

' . "\n" - . ' ' . ($GLOBALS['cfg']['MainPageIconic'] ? '' : '') - . ' ' . $GLOBALS['strPrivileges'] . "\n" + . ($GLOBALS['cfg']['MainPageIconic'] ? '' : '') + . $GLOBALS['strPrivileges'] . "\n" . '

' . "\n" . $GLOBALS['strNoPrivileges'] . "\n"; require_once('./footer.inc.php'); @@ -283,6 +283,7 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = TRUE, $indent = // privs that are not attached to a specific column + echo $spaces . '
' . "\n"; foreach($row as $current_grant => $current_grant_value) { if (in_array(substr($current_grant, 0, (strlen($current_grant) - 5)), array('Select', 'Insert', 'Update', 'References'))) { continue; @@ -301,8 +302,7 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = TRUE, $indent = $tmp_current_grant = $current_grant; } - echo $spaces . '
' . "\n" - . $spaces . '
' . "\n" + echo $spaces . '
' . "\n" . $spaces . ' ' . "\n"; @@ -406,7 +406,7 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = TRUE, $indent = . $spaces . ' ( ' . $GLOBALS['strCheckAll'] . ' /' . "\n" . $spaces . ' ' . $GLOBALS['strUncheckAll'] . ' )' . "\n" . $spaces . ' ' . "\n" - . $spaces . '

' . $GLOBALS['strEnglishPrivileges'] . '

' . "\n" + . $spaces . '

' . $GLOBALS['strEnglishPrivileges'] . '

' . "\n" . $spaces . '
' . "\n" . $spaces . ' ' . $GLOBALS['strData'] . '' . "\n"; foreach ( $privTable[0] as $priv ) @@ -521,7 +521,7 @@ function PMA_displayLoginInformationFields($mode = 'new', $indent = 0 ) . $spaces . ' ' . "\n" . $spaces . ' ' . "\n" . $spaces . '' . "\n" - . $spaces . '' . "\n" + . $spaces . '' . "\n" . $spaces . '
' . "\n" . $spaces . '
' . "\n" . $spaces . '
' . "\n" . $spaces . '
' . "\n" . $spaces . '
' . "\n" . $spaces . '
' . "\n" . $spaces . '' . "\n" . $spaces . '' . "\n" - . $spaces . ' ' . "\n" - . $spaces . ' ' . "\n" + . $spaces . ' ' . "\n" + . $spaces . ' ' . "\n" . $spaces . '' . "\n" - . $spaces . '' . "\n" + . $spaces . '' . "\n" . $spaces . '
' . "\n" . $spaces . '' . "\n"; } // end of the 'PMA_displayUserAndHostFields()' function @@ -1030,6 +1030,34 @@ if (isset($viewing_mode) && $viewing_mode == 'db') { } +/** + * defines some standard links + */ +$link_edit = ''; +if ( $GLOBALS['cfg']['PropertiesIconic'] ) { + $link_edit .= '' . $GLOBALS['strEditPrivileges'] . ''; +} else { + $link_edit .= $GLOBALS['strEditPrivileges']; +} +$link_edit .= ''; + +$link_revoke = ''; +if ( $GLOBALS['cfg']['PropertiesIconic'] ) { + $link_revoke .= '' . $GLOBALS['strRevoke'] . ''; +} else { + $link_revoke .= $GLOBALS['strRevoke']; +} +$link_revoke .= ''; + /** * Displays the page */ @@ -1037,7 +1065,7 @@ if (empty($adduser) && empty($checkprivs)) { if (!isset($username)) { // No username is given --> display the overview echo '

' . "\n" - . ' ' . ($GLOBALS['cfg']['MainPageIconic'] ? '' : '') + . ($GLOBALS['cfg']['MainPageIconic'] ? '' : '') . $GLOBALS['strUserOverview'] . "\n" . '

' . "\n"; @@ -1161,13 +1189,10 @@ if (empty($adduser) && empty($checkprivs)) { . ' ' . join(',' . "\n" . ' ', $privs) . "\n" . ' ' . "\n" . ' ' . ($row['Grant_priv'] == 'Y' ? $GLOBALS['strYes'] : $GLOBALS['strNo']) . '' . "\n" - . ' '; - if ($GLOBALS['cfg']['PropertiesIconic']) { - echo '' . $GLOBALS['strEditPrivileges'] . ''; - } else { - echo $GLOBALS['strEditPrivileges']; - } - echo '' . "\n" + . ' '; + printf( $link_edit, urlencode( $row['User'] ), + urlencode( $row['Host'] ), '', '' ); + echo '' . "\n" . ' ' . "\n"; $odd_row = ! $odd_row; } @@ -1242,11 +1267,11 @@ if (empty($adduser) && empty($checkprivs)) { echo '

' . "\n" . ($GLOBALS['cfg']['PropertiesIconic'] ? '' : '' ) - . ' ' . $GLOBALS['strUser'] . ' \'' . htmlspecialchars($username) . '\'@\'' . htmlspecialchars($hostname) . '\'' . "\n"; + . $GLOBALS['strUser'] . ' \'' . htmlspecialchars($username) . '\'@\'' . htmlspecialchars($hostname) . '\'' . "\n"; if (!empty($dbname)) { - echo ' - ' . $GLOBALS['strDatabase'] . ' ' . htmlspecialchars($dbname) . '' . "\n"; + echo ' - ' . $GLOBALS['strDatabase'] . ' ' . htmlspecialchars($dbname) . '' . "\n"; if (!empty($tablename)) { - echo ' - ' . $GLOBALS['strTable'] . ' ' . htmlspecialchars($tablename) . '' . "\n"; + echo ' - ' . $GLOBALS['strTable'] . ' ' . htmlspecialchars($tablename) . '' . "\n"; } } echo ' : ' . $GLOBALS['strEditPrivileges'] . '

' . "\n"; @@ -1275,7 +1300,7 @@ if (empty($adduser) && empty($checkprivs)) { . '' . "\n" . '' . "\n" . '
' . "\n" - . '' . (empty($dbname) ? $GLOBALS['strDbPrivileges'] : $GLOBALS['strTblPrivileges']) . '' . "\n" + . '' . (empty($dbname) ? $GLOBALS['strDbPrivileges'] : $GLOBALS['strTblPrivileges']) . '' . "\n" . '' . "\n" . '' . "\n" . '' . "\n" @@ -1314,8 +1339,16 @@ if (empty($adduser) && empty($checkprivs)) { . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" . '' . "\n"; $row2 = PMA_DBI_fetch_assoc($res2); $odd_row = ! $odd_row; @@ -1339,8 +1372,18 @@ if (empty($adduser) && empty($checkprivs)) { echo $GLOBALS['strNo']; } echo '' . "\n" - . ' ' . "\n" - . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" . '' . "\n"; $odd_row = ! $odd_row; } // end while @@ -1356,8 +1399,16 @@ if (empty($adduser) && empty($checkprivs)) { . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" . '' . "\n"; $row2 = PMA_DBI_fetch_assoc($res2); @@ -1431,7 +1482,7 @@ if (empty($adduser) && empty($checkprivs)) { . '' . "\n" . '' . "\n" . '
' . "\n" - . ' ' . $GLOBALS['strChangePassword'] . '' . "\n" + . ' ' . $GLOBALS['strChangePassword'] . '' . "\n" . '
' . (empty($dbname) ? $GLOBALS['strDatabase'] : $GLOBALS['strTable']) . '' . $GLOBALS['strNo'] . '' . $GLOBALS['strYes'] . '' . $GLOBALS['strEdit'] . '' . $GLOBALS['strRevoke'] . ''; + printf( $link_edit, urlencode( $username ), + urlencode( $hostname ), + urlencode( $row2['Db'] ), + '' ); + echo ''; + printf( $link_revoke, urlencode( $username ), + urlencode( $hostname ), urlencode( $row2['Db'] ), '' ); + echo '
' . $GLOBALS['strEdit'] . '' . $GLOBALS['strRevoke'] . ''; + printf( $link_edit, urlencode( $username ), + urlencode( $hostname ), + urlencode( empty($dbname) ? $row['Db'] : $dbname ), + urlencode( empty($dbname) ? '' : $row['Table_name'] ) ); + echo ''; + printf( $link_revoke, urlencode( $username ), + urlencode( $hostname ), + urlencode( empty( $dbname ) ? $row['Db'] : $dbname ), + urlencode( empty( $dbname ) ? '' : $row['Table_name'] ) ); + echo '
' . $GLOBALS['strNo'] . '' . $GLOBALS['strYes'] . '' . $GLOBALS['strEdit'] . '' . $GLOBALS['strRevoke'] . ''; + printf( $link_edit, urlencode( $username ), + urlencode( $hostname ), + urlencode( $row2['Db'] ), + '' ); + echo ''; + printf( $link_revoke, urlencode( $username ), + urlencode( $hostname ), urlencode( $row2['Db'] ), '' ); + echo '
' . "\n" . ' ' . "\n" . ' ' . "\n" @@ -1448,7 +1499,7 @@ if (empty($adduser) && empty($checkprivs)) { . ' ' . "\n" . ' ' . "\n" . '
' . "\n" - . '
' . "\n" + . '' . "\n" . '' . "\n" @@ -1608,11 +1659,12 @@ if (empty($adduser) && empty($checkprivs)) { . ' ' . "\n" . ' ' . ($current['Grant_priv'] == 'Y' ? $GLOBALS['strYes'] : $GLOBALS['strNo']) . "\n" . ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n" - . ' ' . $GLOBALS['strEdit'] . "\n" - . ' ' . "\n" - . ' ' . "\n" + . ' ' . "\n"; + printf( $link_edit, urlencode( $current_user ), + urlencode( $current_host ), + urlencode( ! isset( $current['Db'] ) || $current['Db'] == '*' ? '' : $current['Db'] ), + '' ); + echo '' . "\n" . ' ' . "\n"; } if (empty($row) && empty($row1) && empty($row2)) {