diff --git a/ChangeLog b/ChangeLog index 79b7e7b4c..a7f900b84 100755 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,8 @@ $Source$ * lang/italian.inc.php3: updated thanks to Pietro Danesi. * defines.inc.php3: php3 does not allow to use TRUE or FALSE constants with the 'define()' function. + * users_detail.php3; lang/*: added an option to change the server from an + user page. 2001-09-18 Loïc Chapeaux * tbl_create.php3; tbl_addfield.php3: fixed a bug with "auto_increment" diff --git a/user_details.php3 b/user_details.php3 index 55eecf62d..2ec648395 100644 --- a/user_details.php3 +++ b/user_details.php3 @@ -326,7 +326,7 @@ function normal_operations() - +   @@ -604,6 +604,25 @@ function edit_operations($host, $user) +
  • +
    + + + + + +
    + " /> +   + +
    + + + " /> + " /> +
    +
  • +
  • @@ -902,7 +921,7 @@ if (empty($host)) { $js_to_run = 'user_details.js'; include('./header.inc.php3'); -if (!empty($host)) { +if (!empty($host) && !isset($submit_chgServer)) { echo '

    ' . "\n"; echo ' ' . $strHost . ' ' . $host . ' - ' . $strUser . ' ' . (($pma_user) ? $pma_user : $strAny) . "\n"; echo '

    '; @@ -999,6 +1018,34 @@ else if (isset($submit_addUser)) { } // 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 '

    ' . "\n"; + echo ' ' . $strHost . ' ' . $host . ' - ' . $strUser . ' ' . (($pma_user) ? $pma_user : $strAny) . "\n"; + echo '

    '; + show_message(sprintf($strUpdateServMessage, '' . $pma_user . '@' . $host . '') . '
    ' . $strRememberReload); +} + // Changes the password of an user else if (isset($submit_chgPswd)) { $show_query = 'y';