phpbb3 change username

Discussion in 'Integration' started by piratepete, Jul 18, 2009.

  1. piratepete

    piratepete aMember Pro Customer

    Joined:
    Apr 14, 2009
    Messages:
    23
    Hi all,
    Here's my problem/bug.
    We have aMember and phpbb3 integrated with aMember and all is working fine.

    We had 600 new users wich I imported into aMember. As none had been registered on a forum or anything they were imported from our membership database with a default username of their membership number.

    They can then log into aMember and change their username to one that they want. Here in lies the problem.

    User Logs into aMember | changes username | saves changes and then goes to the forum. They are logged in when they get to the forum by aMember and they are also logged in under their new username. This is great and looks like every thing is working fine. Things start to change and get nasty on the next visit though after logging out.

    User logsinto aMember with new username which works fine. Goes to forum and isn't logged in. So user then clicks login. Enters username and password. Rejected with unknown username.

    So there is the problem.

    Now some observations/reasons.

    I tried logging into the forum with the old username and that was successful. So leads me to beleive that the forum isn't being updated properly. So had a look at the phpbb Users table and noticed that the Username field had been updated with the new username but the username_clean field was still at the old username. Which is why loging in wouldn't work.

    It would appear that when changing the username in aMember it updates the usename field in phpbb3 but not the username_clean field.

    I have found that manually changing the username_clean field to match the username field via phpMyAdmin works and allows the user to login with their new username.


    However, I have found a work around that can be done by the users themselves.
    Basically they change their username in aMember save it and logout.
    Login to the forum under their old username
    Go to the User Control Panel
    Click on the profile Tab
    Select Edit account Settings
    (the username in the username box will actually already be their new username)
    click Submit.

    This forces phpBB3 to update the username_clean field.

    So, my quest is, after all that, how do I get aMember to update the username_clean field?
  2. piratepete

    piratepete aMember Pro Customer

    Joined:
    Apr 14, 2009
    Messages:
    23
    Well, that is intersting, I just noticed this post (phpbb3 and username change) from back in January. Hmm, wonder why I didn't see it when I searched the forum before posting, mute point I guess as there was no resolution listed. I guess it's time to go and raise a support ticket.
  3. piratepete

    piratepete aMember Pro Customer

    Joined:
    Apr 14, 2009
    Messages:
    23
    Here we go I have found what appears to be the solution thanks to zenpig66 in his post Permission issue and groups with phpbb3

    Will give it a try and report back.


    Thanks zenpigg66
  4. zenpig66

    zenpig66 aMember Pro Customer

    Joined:
    Jan 1, 2009
    Messages:
    72
    cool, glad it came of use...definitely something that needs to be incorporated into the phpbb3 plugin. phpBB3 does have it's own function to deal with the username-clean field but it would be too much of a hack to incorporate it into the plugin so this pretty much mimics it.....be careful with allowing special characters, though. By default aMember doesn't allow apostrophes and I would keep it that way...the username_clean = '".strtolower($newmember[login])."' line won't reflect apostrophes correctly...btw, that was the update Alex sent to me from the first thread you found; I should have posted the username_clean resolution in that thread so others could find it easily. The user_permissions = '', line I added was something else which resolves a different issue with users not updating to their group permission correctly.

Share This Page