1
liture
Changing registered user to Admin from database??
  • 2005/8/25 7:43

  • liture

  • Just popping in

  • Posts: 42

  • Since: 2005/8/10


Can anybody tell me if is is possible to Changing registered user to Admin from database?? and how?

Cheers!

2
Antoine
Re: Changing registered user to Admin from database??
  • 2005/8/25 8:20

  • Antoine

  • Friend of XOOPS

  • Posts: 112

  • Since: 2004/11/14


Basically you need to make this user a member of the Admin group. For these examples I will assume you use XOOPS as your db prefix.

1) First look up the uid of the user in the xoops_user table.
2) Then run the following query:
Insert Into xoops_groups_users_link
(groupiduidValues (1, [your uid])

Where [your uid] is the uid you looked up.

3
liture
Re: Changing registered user to Admin from database??
  • 2005/8/25 8:31

  • liture

  • Just popping in

  • Posts: 42

  • Since: 2005/8/10


Thnak you for your reply.

I ge tthe following error:
#1146 - Table 'datamine.dpt001_groups_users_link' doesn't exist

Datamine is mine database, dpt001 is the prefix, and 10 is my userid

Any suggestion?

Cheers!

4
tedsmith
Re: Changing registered user to Admin from database??
  • 2005/8/25 8:34

  • tedsmith

  • Home away from home

  • Posts: 1151

  • Since: 2004/6/2 1


Not sure what XOOPS version you're using, but in 2.0.13.1 and below, you just edit the users rank using 'Edit User' in System Admin - Edit User - Select USer - User Rank = Webmaster. Then in addition, just add that user to the webmasters group. No need to tinker with code.

5
liture
Re: Changing registered user to Admin from database??
  • 2005/8/25 8:36

  • liture

  • Just popping in

  • Posts: 42

  • Since: 2005/8/10


Thanks for your reply, but as I said, I cant not access the admin control panel, that is why I am trying to do all this

I am using the latest 2.2 xoops

6
Dave_L
Re: Changing registered user to Admin from database??
  • 2005/8/25 9:22

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Quote:
#1146 - Table 'datamine.dpt001_groups_users_link' doesn't exist


That's odd. That table should exist.

Is this a new install or an upgrade?
Has the problem always been present?

7
liture
Re: Changing registered user to Admin from database??
  • 2005/8/25 9:29

  • liture

  • Just popping in

  • Posts: 42

  • Since: 2005/8/10


The table is there and I can access it and see its content, so I agree with you

Well as I explained in other post my real problem was that I deleted by mistake the content of the table user_profile, so after that I was not able to access with any user, not even admin, all I got was the empty page with only the header of the template.

Bust since I was still able to register new users, I thought about registering a user and converting it to admin so overcome this problem..and this is my life story :)

So the new version of XOOPS is great like always, it was my fault, and now I am trying to figure out how I can fix it.I have to mention that I tried to upload the user_profile content from a previous backup of the database, and I had SQL error also, so any suggestion is really really welcomed :)

Cheers!

8
Antoine
Re: Changing registered user to Admin from database??
  • 2005/8/25 9:33

  • Antoine

  • Friend of XOOPS

  • Posts: 112

  • Since: 2004/11/14


Can you edit the groups_users_link table directly somehow? If that is the case just add a new row setting groupid to 1 and uid to the uid of the user you'd like to make admin.

9
liture
Re: Changing registered user to Admin from database??
  • 2005/8/25 9:38

  • liture

  • Just popping in

  • Posts: 42

  • Since: 2005/8/10


That was so good, thank you Antoine, I was able to change it like this, you saved my a** and nice avatar by the way

My question now is how to safely remove other users and old admin account? I will never touch the database again

10
Antoine
Re: Changing registered user to Admin from database??
  • 2005/8/25 9:58

  • Antoine

  • Friend of XOOPS

  • Posts: 112

  • Since: 2004/11/14


Well normaly you would delete users from the Admin Panel->Edit Users. Select the user there, set the dropdown to delete and hit 'Go!'.
Should you feel the need to do this in the DB directly somehow you just look up the uid of the users you want to delete, remove the rows in groups_users_link that contain that uid and lastly delete that user from the users table.

Login

Who's Online

173 user(s) are online (101 user(s) are browsing Support Forums)


Members: 0


Guests: 173


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits