added an option to change the server from an user page
This commit is contained in:
@@ -15,6 +15,8 @@ $Source$
|
|||||||
* lang/italian.inc.php3: updated thanks to Pietro Danesi.
|
* lang/italian.inc.php3: updated thanks to Pietro Danesi.
|
||||||
* defines.inc.php3: php3 does not allow to use TRUE or FALSE constants with
|
* defines.inc.php3: php3 does not allow to use TRUE or FALSE constants with
|
||||||
the 'define()' function.
|
the 'define()' function.
|
||||||
|
* users_detail.php3; lang/*: added an option to change the server from an
|
||||||
|
user page.
|
||||||
|
|
||||||
2001-09-18 Lo<4C>c Chapeaux <lolo@phpheaven.net>
|
2001-09-18 Lo<4C>c Chapeaux <lolo@phpheaven.net>
|
||||||
* tbl_create.php3; tbl_addfield.php3: fixed a bug with "auto_increment"
|
* tbl_create.php3; tbl_addfield.php3: fixed a bug with "auto_increment"
|
||||||
|
@@ -326,7 +326,7 @@ function normal_operations()
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<input type="radio" name="anyhost" checked="checked" />
|
<input type="radio" name="anyhost" checked="checked" />
|
||||||
<?php echo $GLOBALS['strAnyHost']; ?>
|
<?php echo $GLOBALS['strAnyHost'] . "\n"; ?>
|
||||||
</td>
|
</td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td>
|
<td>
|
||||||
@@ -604,6 +604,25 @@ function edit_operations($host, $user)
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<form action="user_details.php3" method="post" name="serverForm">
|
||||||
|
<?php echo $GLOBALS['strUpdateServer'] . "\n"; ?>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="new_server" size="10" value="<?php echo str_replace('"', '"', $host); ?>" />
|
||||||
|
|
||||||
|
<input type="submit" name="submit_chgServer" value="<?php echo $GLOBALS['strGo']; ?>" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
|
||||||
|
<input type="hidden" name="server" value="<?php echo $server; ?>" />
|
||||||
|
<input type="hidden" name="host" value="<?php echo str_replace('"', '"', $host); ?>" />
|
||||||
|
<input type="hidden" name="pma_user" value="<?php echo str_replace('"', '"', $pma_user); ?>" />
|
||||||
|
</form>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<form action="user_details.php3" method="post" name="passForm" onsubmit="return checkPassword(this)">
|
<form action="user_details.php3" method="post" name="passForm" onsubmit="return checkPassword(this)">
|
||||||
<?php echo $GLOBALS['strUpdatePassword'] . "\n"; ?>
|
<?php echo $GLOBALS['strUpdatePassword'] . "\n"; ?>
|
||||||
@@ -902,7 +921,7 @@ if (empty($host)) {
|
|||||||
|
|
||||||
$js_to_run = 'user_details.js';
|
$js_to_run = 'user_details.js';
|
||||||
include('./header.inc.php3');
|
include('./header.inc.php3');
|
||||||
if (!empty($host)) {
|
if (!empty($host) && !isset($submit_chgServer)) {
|
||||||
echo '<h1>' . "\n";
|
echo '<h1>' . "\n";
|
||||||
echo ' ' . $strHost . ' ' . $host . ' - ' . $strUser . ' ' . (($pma_user) ? $pma_user : $strAny) . "\n";
|
echo ' ' . $strHost . ' ' . $host . ' - ' . $strUser . ' ' . (($pma_user) ? $pma_user : $strAny) . "\n";
|
||||||
echo '</h1>';
|
echo '</h1>';
|
||||||
@@ -999,6 +1018,34 @@ else if (isset($submit_addUser)) {
|
|||||||
} // end else
|
} // end else
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Changes the server that an user can access
|
||||||
|
else if (isset($submit_chgServer)) {
|
||||||
|
$show_query = 'y';
|
||||||
|
$edit = TRUE;
|
||||||
|
if (empty($host)) {
|
||||||
|
$host = '%';
|
||||||
|
}
|
||||||
|
if (empty($pma_user)) {
|
||||||
|
$pma_user = '%';
|
||||||
|
}
|
||||||
|
if (empty($new_server)) {
|
||||||
|
$new_server = '%';
|
||||||
|
} else if (get_magic_quotes_gpc()) {
|
||||||
|
$new_server = stripslashes($new_server);
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql_query = 'UPDATE user '
|
||||||
|
. 'SET host = \'' . sql_addslashes($new_server) . '\' '
|
||||||
|
. 'WHERE user = \'' . sql_addslashes($pma_user) . '\' AND host = \'' . sql_addslashes($host) . '\'';
|
||||||
|
$result = @mysql_query($sql_query) or mysql_die('', '', FALSE);
|
||||||
|
|
||||||
|
$host = $new_server;
|
||||||
|
echo '<h1>' . "\n";
|
||||||
|
echo ' ' . $strHost . ' ' . $host . ' - ' . $strUser . ' ' . (($pma_user) ? $pma_user : $strAny) . "\n";
|
||||||
|
echo '</h1>';
|
||||||
|
show_message(sprintf($strUpdateServMessage, '<span style="color: #002E80">' . $pma_user . '@' . $host . '</span>') . '<br />' . $strRememberReload);
|
||||||
|
}
|
||||||
|
|
||||||
// Changes the password of an user
|
// Changes the password of an user
|
||||||
else if (isset($submit_chgPswd)) {
|
else if (isset($submit_chgPswd)) {
|
||||||
$show_query = 'y';
|
$show_query = 'y';
|
||||||
|
Reference in New Issue
Block a user