posted 16 years ago
You can do this via direct access to your database. E.g., via MySQL's admin GUI or command line tool. There are two common ways that admin rights can be lost:
First, the administration group might have had the admin permissions dropped from it. To check if this is the case, use this query:
select * from jforum_roles where name = 'perm_administration'
There should be at least one group_id with this permission.
If this isn't the case, do the following:
Find the group id of the administration group with:
select group_id from jforum_groups where group_name = 'Administration'
Then add back in the admin permission with:
INSERT INTO jforum_roles (group_id, name) VALUES (<ADMIN_GROUP_ID>, 'perm_administration');
Replace the <ADMIN_GROUP_ID with your group id.
>
====
The next possible problem could be that the admin user has been removed from the Administration group. To fix this do the following:
Find the user id (number) of the user you want to be the administrator with a query like:
select user_id from jforum_users where username = 'admin'
replace admin with a different one if desired). Write down the number returned.
Next get the group_id number of the Administration group with the query:
select group_id from jforum_groups where group_name = 'Administration'
Finally, add the user back into the administration group with:
insert into jforum_user_groups ( group_id, user_id) values ( <admin group id>, <admin user id> )
Replace the <..> items in the values part with the numbers from the first two queries.
Note, if you don't find the Administration group, it might have been deleted. A quick way to get around this is to grant admin rights to an existing group. Recreate the administration group with admin rights and correct membership, and then remove admin rights from the other group.
[originally posted on jforum.net by monroe]