• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

no user with admin permissions

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

somehow i managed to remove the admin permissions from both my account with rights for the admin control panel.
Is there any way to create a new admin user in the database, or give an existing user admin rights without access to the admin pages?

kind regards,
Rene Boere
[originally posted on jforum.net by rboere]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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]
reply
    Bookmark Topic Watch Topic
  • New Topic