We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Unable to add another admin | Forum

Devin
Devin Feb 1 '12
I just bought a site from someone, and I used the main admin account at the beginning. I realized it had history with people so I deleted it after I assigned admin permissions to another account.

Well, the other account, I was a dumb one and used FB connect in the first place. I also deleted the original account. Now even when I assign the Admin role to another account, it does nothing. I also can still see 'deleted user' in the Moderator assignment section as still having admin rights.

Anyone have any insight into this?
Michael Leader
Michael Feb 2 '12
You can always dive into the database and make your account admin.
It can take some working out but it is possible.

Another way is if you find your account in your db, copy the encrypted password string, then edit the first account.  ID1, the original admin and replace the encrypted string with the one that was in your account.  The original admin account should now have the same password as you.
The Forum post is edited by Michael Feb 2 '12
Devin
Devin Feb 4 '12
Even if that original admin account was deleted? The previous owner already signed up again taking that username, so I don't think that would work.
Michael Leader
Michael Feb 5 '12
I think it is impossible to delete the original admin id1 account unless it is done via the db. 

I did the id1 change before and it worked a treat.  Just backup your db before tinkering. 

I have replaced password strings and changed user I'd in the db before and it did work fine.  With ANY account. 
Devin
Devin Feb 6 '12
I looked and saw something on this before but it was a dead end. Do you have instructions on this anywhere?
Michael Leader
Michael Feb 7 '12
OK.
Method 1:
1 Create a new account in your site called newadmin and a password of 123456, give it a working email.  verify the email when it appears so you now have a user on your site.

2 Once you are working in your site, goto your database, best using phpmyadmin. Open table ow_base_user

3 Check the 1st user, the colum called ID, the 1st user should be ID 1.

4 Edit that line and change the ID field from 1 to 9999. Save changes.

5 Now look at the last record in the users list in the db.  It should be the one you just created called newadmin.

6 Edit that record and change the ID to 1.  Save changes.

7 Now open up another tab or window in your browser and login using newadmin and 123456 and you SHOULD have admin privilges.


Method 2:

1: Open up your db ow_base_users and edit the ID 1 user.

2: Open notepad in your PC and copy the "password" field from the database into it. It will be a big long number/letter line.  make sure you don't mistake it for the account type.

3: Close that and look for your newadmin account in that table, it will be at/near the end of the list.  Copy THAT password string down into notepad in a new line.

4: go back to the 1st account ID1 and edit it.  Replace the password string that is there with the one from your newadmin account. (Take a note of the username for the ID1 account)

5:  Open up a new window/tab in your browser, open your site.  Login with the original ID1 username account but use 123456 as the password.  That should get you into the original account.  Change the email etc to suit yourself.


Remember to backup your database BEFORE doing any editing in it.
It looks a lot longer than actually doing it.

If you are still not sure, drop me a PM with your site URL and host logins and I can do it for you.  It takes seconds to do.