Fixed some bugs with modifying user privileges

This commit is contained in:
Loïc Chapeaux
2001-10-09 17:34:32 +00:00
parent ec82dd603d
commit 529bfd1b32
2 changed files with 13 additions and 4 deletions

View File

@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
$Id$
$Source$
2001-10-09 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* user_details.php3, lines 1232-1245 & 1254: fixed some bugs with modifying
user privileges.
2001-10-08 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* lang/danish.inc.php3: updated thanks to
Niels Oesten <niels at oesten.dk>.

View File

@@ -863,7 +863,7 @@ function table_users($host = FALSE, $user = FALSE)
<a href="<?php echo (($check_url != '') ? $check_url : '#'); ?>">
<?php echo $GLOBALS['strGrants']; ?></a>
</td>
-->
//-->
<td>
<?php echo $row['Host'] . "\n"; ?>
</td>
@@ -1230,14 +1230,19 @@ else if (isset($grants) && $grants) {
} // end if
$list_priv = array('Select', 'Insert', 'Update', 'Delete', 'Create', 'Drop', 'Reload',
'Shutdown', 'Process', 'File', 'Grant', 'References', 'Index', 'Alter');
for ($i = 0; $i < 14; $i++) {
'Shutdown', 'Process', 'File', 'References', 'Index', 'Alter');
for ($i = 0; $i < 13; $i++) {
$priv_name = $list_priv[$i] . '_priv';
if (isset($$priv_name)) {
$sql_query .= (empty($sql_query) ? $list_priv[$i] : ', ' . $list_priv[$i]) . $col_list;
}
} // end for
unset($list_priv);
if (empty($sql_query)) {
$sql_query = 'USAGE' . $col_list;
}
$priv_grant = 'Grant_priv';
$priv_grant = (isset($$priv_grant) ? ' WITH GRANT OPTION' : '');
$sql_query .= ' ON '
. (($anydb || empty($dbgrant)) ? '*' : backquote($dbgrant))
@@ -1246,7 +1251,7 @@ else if (isset($grants) && $grants) {
$sql_query .= ' TO ' . '\'' . sql_addslashes($pma_user) . '\'' . '@' . '\'' . sql_addslashes($host) . '\'';
$sql_query = 'GRANT ' . $sql_query;
$sql_query = 'GRANT ' . $sql_query . $priv_grant;
$result = @mysql_query($sql_query) or mysql_die('', '', FALSE, $err_url . '&host=' . urlencode($host) . '&pma_user=' . urlencode($pma_user) . '&grants=1');
show_message($strAddPrivMessage);
} // end if