View Issue Details

IDProjectCategoryView StatusLast Update
0012727mantisbtadministrationpublic2011-04-05 14:23
Reporterdregad Assigned Todhx  
PrioritylowSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Versiongit trunk 
Target Version1.2.5Fixed in Version1.2.5 
Summary0012727: Updating username when old username = realname results in error 807
Description

When updating an existing user record (manage_user_update.php), having username equal to realname, changing the realname field results in the following error when pressing the "Update User" button:

APPLICATION ERROR #807
The "Real Name" chosen matches another user's login name. Please choose another.

This is an incorrect behavior, there is no actual duplicate username (the function check matches the current user record).

Steps To Reproduce
  1. Create a test user:
    username = "test"
    realname = "test"
  2. Update the user by changing username to another value, e.g. "test1"
Additional Information

This can be reproduced both in master and 1.2.x branches

Tagspatch
Attached Files
0001-Fix-12727-Error-807-when-Updating-username-with-matc.patch (970 bytes)   
From 662940b19b22ab4c3d7df707d176cb44effe1154 Mon Sep 17 00:00:00 2001
From: Damien Regad <damien.regad@merckserono.net>
Date: Thu, 27 Jan 2011 17:07:15 +0100
Subject: [PATCH] Fix #12727: Error 807 when Updating username with matching realname

Updating username when old username = realname wrongly results in error
due to uniqueness check based on new username instead of the old one
---
 manage_user_update.php |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/manage_user_update.php b/manage_user_update.php
index ad70b44..a8de097 100644
--- a/manage_user_update.php
+++ b/manage_user_update.php
@@ -80,7 +80,7 @@
 		# strip extra space from real name
 		$t_realname = string_normalize( $f_realname );
 		user_ensure_realname_valid( $t_realname );
-		user_ensure_realname_unique( $f_username, $t_realname );
+		user_ensure_realname_unique( $t_old_username, $t_realname );
 	}
 
 	if ( $t_ldap && config_get( 'use_ldap_email' ) ) {
-- 
1.7.1

Activities

dregad

dregad

2011-01-27 11:15

developer   ~0028106

The uniqueness check for realname in manage_user_update.php was incorrectly checking on the new username instead of the old one.

Patch for 1.2.x attached.

dhx

dhx

2011-02-28 05:58

reporter   ~0028317

Thanks Damien, I have committed your patch!

Related Changesets

MantisBT: master adac8061

2011-01-27 11:07

Damien Regad

Committer: dhx


Details Diff
Fix 0012727: Error 807 when Updating username with matching realname

Updating username when old username = realname wrongly results in error
due to uniqueness check based on new username instead of the old one

Signed-off-by: David Hicks <hickseydr@optusnet.com.au>
Affected Issues
0012727
mod - manage_user_update.php Diff File

MantisBT: master-1.2.x 22f36fc0

2011-01-27 11:07

Damien Regad

Committer: dhx


Details Diff
Fix 0012727: Error 807 when Updating username with matching realname

Updating username when old username = realname wrongly results in error
due to uniqueness check based on new username instead of the old one

Signed-off-by: David Hicks <hickseydr@optusnet.com.au>
Affected Issues
0012727
mod - manage_user_update.php Diff File