Saturday 2 August 2008

Unable to reset a member's password in IP.Board

I came across a strange problem with IP.Board today where I was unable to reset a user's password using the admin interface. I got the error message "There was an error loading the user's account". A quick search didn't find anything useful, so this solution is both for those also suffering and for myself if it ever happens again.

First, this appears to be caused by changing email addresses using the admin interface and also, based on some quick searching, appears to happen mostly to admin accounts.

IP.Board member accounts are stored in the ipb_members tables. Passwords (MD5'd) and the salt is stored in the ipb_members_converge table. This table contains a column called coverge_id, which appears to be the member's ID (ipb_members.id). The table also contains a column converge_email, which appears to be the member's email (ipb_members.email).

For whatever reason, the email addresses can become out of sync. If this happens, changing passwords for the affected users produces the error "There was an error loading the user's account".

The solution is pretty easy; update ipb_members_converge.converge_email so that the email address for the user ID that is causing problems matches the email stored in ipb_members.email.

For example, let ipb_members.email = admin@example.com for user ID 123. You may find that ipb_members_converge table lists the email as test@example.com for user ID 123, so run the following query to get them in sync:

UPDATE ipb_members_converge
SET converge_email = 'admin@example.com'
WHERE converge_id = '123';

The IP.Board admin interface makes this pretty easy as you can execute DB queries directly from the interface using the SQL Toolbox (under the Admin tab). Very useful if you don't have access to the DB server from where you are.

After running the query, reset the member's password as normal. If you had the same problem as me, you're done.

You could run a query that will sync the emails for all accounts, but I don't know IP.Board well enough to recommend that, so I'd have to recommend against it. This issue is obviously so rare that it shouldn't be much of a hassle to fix each account manually.