diff --git a/ChangeLog b/ChangeLog index 5e389b4d9..245c1cb05 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,11 @@ phpMyAdmin - Changelog $Id$ $Source$ +2005-12-27 Marc Delisle + * main.php, libraries/check_user_privileges.lib.php: + - reenable a non-privileged user to change his password + - display the Reload MySQL link only if user has proper rights + 2005-12-25 Michal Čihař * libraries/import.lib.php, libraries/import/sql.php: Handle correctly dumps with commented out commands (eg. from mysqldump). diff --git a/libraries/check_user_privileges.lib.php b/libraries/check_user_privileges.lib.php index 7a7bf6c92..d842c636b 100644 --- a/libraries/check_user_privileges.lib.php +++ b/libraries/check_user_privileges.lib.php @@ -36,6 +36,9 @@ function PMA_analyseShowGrant($rs_usr, &$is_create_db_priv, &$db_to_create, &$is $show_grants_dbname = substr($row[0], strpos($row[0], ' ON ') + 4,(strpos($row[0], '.', strpos($row[0], ' ON ')) - strpos($row[0], ' ON ') - 4)); $show_grants_dbname = ereg_replace('^`(.*)`','\\1', $show_grants_dbname); $show_grants_str = substr($row[0],6,(strpos($row[0],' ON ')-6)); + if ($show_grants_str == 'RELOAD') { + $is_reload_priv = true; + } if (($show_grants_str == 'ALL') || ($show_grants_str == 'ALL PRIVILEGES') || ($show_grants_str == 'CREATE') || strpos($show_grants_str, 'CREATE')) { if ($show_grants_dbname == '*') { // a global CREATE privilege diff --git a/main.php b/main.php index 4ef413200..819428f68 100644 --- a/main.php +++ b/main.php @@ -39,8 +39,10 @@ echo '
' . "\n"; if ( $server > 0 ) { require_once('./libraries/check_user_privileges.lib.php'); - $cfg['ShowChgPassword'] = $is_superuser = PMA_isSuperuser(); - + // why this? a non-priv user should be able to change his + // password if the configuration permits + //$cfg['ShowChgPassword'] = $is_superuser = PMA_isSuperuser(); + $is_superuser = PMA_isSuperuser(); if ($cfg['Server']['auth_type'] == 'config') { $cfg['ShowChgPassword'] = FALSE; @@ -154,9 +156,10 @@ if ( $server > 0 ) { PMA_printListItem( $strStorageEngines, 'li_mysql_engines', './server_engines.php?' . $common_url_query ); - PMA_printListItem( $strReloadMySQL, 'li_flush_privileges', - './server_privileges.php?flush_privileges=1&' . $common_url_query, - 'flush' ); + if ($is_reload_priv) { + PMA_printListItem( $strReloadMySQL, 'li_flush_privileges', + './server_privileges.php?flush_privileges=1&' . $common_url_query, 'flush' ); + } if ($is_superuser) { PMA_printListItem( $strPrivileges, 'li_mysql_privilegs',