Manager Lockout

From MODx Wiki

Jump to: navigation, search


Contents

Forgot username and password or been blocked ?

This assumes you have access to your database somehow e.g. you have PHPMyAdmin or something similar.

Open your MODx database with said application.

Forgot

  1. Go to the table modx_manager_users
  2. Edit record id 1
  3. username = admin
  4. password = e10adc3949ba59abbe56e057f20f883e
  5. Save record
  6. Exit database application
  7. Go to Modx Manager login
  8. Username = admin
  9. Password = 123456

Blocked

  1. Go to the table modx_user_attributes
  2. Edit record id 1
  3. blocked = 0
  4. Save record
  5. Exit database application
  6. Go to Modx Manager login
  7. Login with your username and password

How to Add a Manager User using MySQL only

This requires that you have MySQL access to the database. I've had to "break in" to several MODx sites when clients have forgotten their passwords, or when an angry admin has abandoned the site...

The procedure requires that you insert a row into two different tables. Note that the table names listed here do not have prefixes; your install may use slightly different table names, e.g. "modx_manager_users".

First, you need to create a manager user by inserting a row into the manager_users table:

INSERT INTO manager_users (username,password) VALUES ('yourname','e19d5cd5af0378da05f63f891c7467af');

Here's I'm using the hash value of "abcd1234" as a default password. I'll change this later.

After doing this, you need to get the id of your newly created user.

mysql> select * from manager_users WHERE username='yourname';
+----+----------+----------------------------------+
| id | username | password                         |
+----+----------+----------------------------------+
|  4 | yourname | e19d5cd5af0378da05f63f891c7467af | 
+----+----------+----------------------------------+

Remember the id from the result. (Here the id is 4).

Next insert a row into the user_attributes table:

mysql> INSERT INTO user_attributes (InternalKey,role) VALUES ('4','1');

Now you should be able to log into the manager. The first thing you'll want to do is change your password!

Personal tools