summaryrefslogtreecommitdiff
path: root/inc/auth/mysql.class.php
diff options
context:
space:
mode:
authormatthiasgrimm <matthiasgrimm@users.sourceforge.net>2005-11-11 19:58:16 +0100
committermatthiasgrimm <matthiasgrimm@users.sourceforge.net>2005-11-11 19:58:16 +0100
commit630a9e82946b0369902147a0f0d41297bf32aff6 (patch)
tree87f703f93ace611dfd49d3b3b935a49b348f3d9b /inc/auth/mysql.class.php
parentc00aef76210cc7e657a9e8a02cdacdf305c76af3 (diff)
downloadrpg-630a9e82946b0369902147a0f0d41297bf32aff6.tar.gz
rpg-630a9e82946b0369902147a0f0d41297bf32aff6.tar.bz2
change username fix
This patch adds support for changing the username in modifyUser() which is needed by the user manager. darcs-hash:20051111185816-7ef76-062a7d949beaa90981d4fef8dfa70edc9d4723e6.gz
Diffstat (limited to 'inc/auth/mysql.class.php')
-rw-r--r--inc/auth/mysql.class.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/inc/auth/mysql.class.php b/inc/auth/mysql.class.php
index ad9d532d3..f0dde6ae0 100644
--- a/inc/auth/mysql.class.php
+++ b/inc/auth/mysql.class.php
@@ -164,7 +164,10 @@ class auth_mysql extends auth_basic {
if($this->openDB()) {
$this->lockTables("WRITE");
if (($info = $this->getUserInfo($user)) !== false) {
+ $newuser = $user;
foreach ($changes as $field => $value) {
+ if ($field == 'user')
+ $newuser = $value;
if ($field == 'pass' && !$this->cnf['encryptPass'])
$value = auth_cryptPassword($value);
$info[$field] = $value; // update user record
@@ -172,7 +175,7 @@ class auth_mysql extends auth_basic {
$rc = $this->delUser($user); // remove user from database
if ($rc)
- $rc = $this->addUser($user,$info['pass'],$info['name'],$info['mail'],$info['grps']);
+ $rc = $this->addUser($newuser,$info['pass'],$info['name'],$info['mail'],$info['grps']);
if (!$rc)
msg($lang['modUserFailed'], -1);
}