https://bugzilla.wikimedia.org/show_bug.cgi?id=52549

       Web browser: ---
            Bug ID: 52549
           Summary: Same ID used when merging two case-different users
           Product: MediaWiki extensions
           Version: REL1_21 branch
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Unprioritized
         Component: UserMerge
          Assignee: m...@tgries.de
          Reporter: carl.le...@lexisnexis.com
    Classification: Unclassified
   Mobile Platform: ---

BACKGROUND:
-----------
User accounts on Wikimedia are case-sensitive.

After switching to the LdapAuthentication extension, existing users who
authenticated against the ldap server are munged to be "Propercase". Even if
there is an identical account in the wiki user table, LdapAuthentication
extension creates a new account anyway, so that there are now two in the
system:

   MyUserName
   Myusername


PROBLEM:
--------
When attempting to merge two accounts with the same text, but different casing,
this extension selects the same ID for BOTH, causing no merge to take place and
the selected account to be LOST if the delete option is checked.

This is because User::newFromName selects the incorrect user id.

Note I am using the latest GIT master of UserMerge. (extension version reports
1.7.0, even though the extension download page shows 1.8.0)


WORK AROUND:
------------
I corrected this in my local build by changing:

FROM:
$objOldUser = User::newFromName( $olduser_text );
$olduserID = $objOldUser->idForName();

$objNewUser = User::newFromName( $newuser_text );
$newuserID = $objNewUser->idForName();


TO:
$olduserID = User::idFromName( $olduser_text );
$objOldUser = User::newFromId( $olduserID );

$newuserID = User::idFromName( $newuser_text );
$objNewUser = User::newFromId( $newuserID );


I also added the following as another check, but could use an i18n:

//check if attempting to merge into same user
} elseif($olduserID == $newuserID) { 
   $validNewUser = false;
   $out->addHTML("new user cannot be the same as the old one");
} else {
   // newuser looks good
   $validNewUser = true;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to