reenable a non-privileged user to change his password; display the Reload MySQL link only if user has proper rights
This commit is contained in:
@@ -5,6 +5,11 @@ phpMyAdmin - Changelog
|
||||
$Id$
|
||||
$Source$
|
||||
|
||||
2005-12-27 Marc Delisle <lem9@users.sourceforge.net>
|
||||
* 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ř <michal@cihar.com>
|
||||
* libraries/import.lib.php, libraries/import/sql.php: Handle correctly
|
||||
dumps with commented out commands (eg. from mysqldump).
|
||||
|
@@ -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
|
||||
|
13
main.php
13
main.php
@@ -39,8 +39,10 @@ echo '<div id="maincontainer">' . "\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',
|
||||
|
Reference in New Issue
Block a user