Switching UIDs for a user

As zitronenroellchen told us, there is a much simpler way to do this.
First identify the UID of the user you want to change. Then get the target UID. For me, I wanted to replace 155 by 1, the default value for Superuser.

Search the database and identify the tables where UID field is present.

For any table in the list
Change over the UID of the destination if it exists.

UPDATE `mybb_threads` SET uid=999 WHERE uid = 1;
UPDATE `mybb_threads` SET uid=1 WHERE uid = 155;
UPDATE `mybb_posts` SET uid=999 WHERE uid = 1;
UPDATE `mybb_posts` SET uid=1 WHERE uid = 155;[/code]

And finally, replace the user in mybb_users:

UPDATE `mybb_users` SET uid=1 WHERE uid = 155;[/code]

Of course, an easier way is to add the user to the list of SuperAdmins

Just discovered that, to retake SuperAdmin permissions for a user, there is a much easier solution, to edit config.php

$config['super_admins'] = 'UID1,UID2';

Plugin uploader issues once again!

DROP TABLE `mybb_pluginuploader`;
alter table `mybb_users` drop column `pluginuploader_key`;[/code]


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.