Difference between revisions of "Manually creating a new Admin user"

From GeeklogWiki
Jump to: navigation, search
(Manually creating a new Admin user)
 
(Added SQL statement to reset the password)
 
Line 5: Line 5:
 
* Obviously, if you forgot your password, you can request a new one using the "forgot password" option, <tt>www.example.com/users.php?mode=getpassword</tt>
 
* Obviously, if you forgot your password, you can request a new one using the "forgot password" option, <tt>www.example.com/users.php?mode=getpassword</tt>
 
* If your email address isn't valid any more then you can edit it directly in the database (field ''email'' in the ''gl_users'' table).
 
* If your email address isn't valid any more then you can edit it directly in the database (field ''email'' in the ''gl_users'' table).
* If sending the email doesn't work (due to spam filters or the mail server being down) you can reset your password to "password" by changing the ''passwd'' field in the ''gl_users'' table to <tt>5f4dcc3b5aa765d61d8327deb882cf99</tt>.
+
* If sending the email doesn't work (due to spam filters or the mail server being down) you can reset your password to "password" by changing the ''passwd'' field in the ''gl_users'' table to <tt>5f4dcc3b5aa765d61d8327deb882cf99</tt>. So in an SQL statement: <pre>UPDATE gl_users SET passwd = '5f4dcc3b5aa765d61d8327deb882cf99' WHERE uid = 2;</pre> (assuming your user's id is 2, which is the case for the default Admin account).
  
 
If none of the above work or if your database is damaged and you can't use a backup then it may be time to create a new Admin user (i.e. a new user that is a member Geeklog's Root group).
 
If none of the above work or if your database is damaged and you can't use a backup then it may be time to create a new Admin user (i.e. a new user that is a member Geeklog's Root group).

Latest revision as of 19:33, 13 May 2008

Try these things first

Here's a few things you can do in the rare event that you are being locked out of your site's Admin account:

  • Obviously, if you forgot your password, you can request a new one using the "forgot password" option, www.example.com/users.php?mode=getpassword
  • If your email address isn't valid any more then you can edit it directly in the database (field email in the gl_users table).
  • If sending the email doesn't work (due to spam filters or the mail server being down) you can reset your password to "password" by changing the passwd field in the gl_users table to 5f4dcc3b5aa765d61d8327deb882cf99. So in an SQL statement:
    UPDATE gl_users SET passwd = '5f4dcc3b5aa765d61d8327deb882cf99' WHERE uid = 2;
    (assuming your user's id is 2, which is the case for the default Admin account).

If none of the above work or if your database is damaged and you can't use a backup then it may be time to create a new Admin user (i.e. a new user that is a member Geeklog's Root group).


Creating a new Admin user

First of all, you need an account that you can log into. If you already have such an account, you can upgrade it with the steps outlined below. Otherwise, simply sign up as a new user on your own site.

Next, you need to know the user ID (uid) of that account. You can look it up in the database or you can go to your own profile page (e.g. from the link in the Who's Online block or go to My Account and save the information, which will also take you to your profile page). Check the URL in your browser - it will read something like .../users.php?mode=profile&uid=242 where instead of "242" you will see your user's uid.

The final step is to make that user a member of the Root group. This is achieved by the following SQL request (replacing "myuid" with your user's actual uid):

INSERT INTO gl_group_assignments (ug_main_grp_id, ug_uid) VALUES (1, myuid);

When you log in as that user, you should then have full access to everything on your Geeklog site again and can proceed to fix your original Admin account, if necessary.