• Resolved barnabas1

    (@barnabas1)


    Hello,

    After changing the User ID no β€œ1”in the settings of the plugin, which was my ID as an admin, now I cannot login to the dashboard.

    What a clever thing to have in the settings!

    Can you please help to discover what my User ID I have now and restore it back to number 1? I have FTP access, I don’t have Cpanel.

Viewing 15 replies - 1 through 15 (of 22 total)
  • Thread Starter barnabas1

    (@barnabas1)

    Is the Admin ID changed permanently via SQL after I run the tool in the settings, or is a temporary change for as long as the iThemes plugin is installed?

    Hi barnabas1,

    I’m afraid it’s a permanent change in the database.

    +++++ To prevent any confusion, I’m not iThemes +++++

    Thread Starter barnabas1

    (@barnabas1)

    And what do I do now?

    Thread Starter barnabas1

    (@barnabas1)

    What a bomb to throw in the settings, I’m blown away! ??

    Shortest route would be to restore a database backup. If you have one …

    Note that this tool used to include a warning (create a database backup before using this tool) but as of the new UI introduced in the 8.x release, that warning seems to have disappeared. Very inconvenient.

    Thread Starter barnabas1

    (@barnabas1)

    Strangest UI on earth! Like a minefield ??

    Thread Starter barnabas1

    (@barnabas1)

    The inconvenience of the daily database backup is that you loose the woocommerce orders that were placed between the backups.

    Anyway, maybe create a new admin via SSH if possible is the best option. I must dig to find the commands…

    You can find the executed sql in the better-wp-security/core/modules/admin-user/active.php file, #78 – #98.

    If familiar with sql you should be able to undo whatever the tool did.

    Let me know whether you wish to try this.

    There is another (final) piece of the puzzle I’l need to figure out for a full undo.

    Thread Starter barnabas1

    (@barnabas1)

    I’m not an expert but I’ve used SQL in the past.

    Please, share if you manage to put all the pieces together, it’s always good to try something new.

    (The procedure described below is not yet finished. So please wait implementing it till it’s finished)

    Ok, before we can start and attempt to reverse the changes made in the database by the β€œChange User ID 1” tool, we need to determin the new ID assigned to your administrator user. Easiest method is to look at the data in the wp_users table using a tool like phpMyAdmin.

    Additionally you’ll need to write down/make a note of all the data associated with that ID value in the wp_users table.

    (It’s probably also a good idea to make a database backup before proceeding).

    We are going to need the collected data in the 6 SQL statements below:

    delete from wp_users where ID=?;

    Where ? needs to be substituted with the new ID value.

    insert into wp_users ('ID', 'user_login', 'user_pass', 'user_nicename', 'user_email', 'user_url', 'user_registered', 'user_activation_key', 'user_status', 'display_name') values ('1', …);

    Where … needs to be substituted with the 9 correct comma separated (string) values.

    update wp_posts set post_author=1 where post_author=?;
    update wp_usermeta set user_id=1 where user_id=?;
    update wp_comments set user_id=1 where user_id=?;
    update wp_links set link_owner=1 where link_owner=?;

    Where ? needs to be substituted with the new ID value.

    That’s it for the 6 SQL commands.

    But we are not there yet. Work in progress …

    • This reply was modified 2 years, 5 months ago by nlpro.
    • This reply was modified 2 years, 5 months ago by nlpro.
    • This reply was modified 2 years, 5 months ago by nlpro.
    • This reply was modified 2 years, 5 months ago by nlpro.
    • This reply was modified 2 years, 5 months ago by nlpro.
    Thread Starter barnabas1

    (@barnabas1)

    Thank you @nlpro. Looking forward for the whole solution.

    Ok, so the last step is to replace the new user ID value(s) with 1 in the notification-center settings.

    For this purpose we will activate (if not already) a new Debug menu option by adding the line below to the WordPresswp-config.php file:

    define('ITSEC_DEBUG', true);

    If properly added to the wp-config.php file you can now navigate to the Security > Debug menu option.

    On the Debug page under the Settings section select notification-center from the drop down list. After clicking the Load button the UI will show you an array with all notification settings. The UI control actually allows you to change values.

    So for every user_list key with the new user ID value, we’ll need to change that (integer) value to 1.
    Be very careful not to make any mistakes/typos!

    Finally when changes are completed click on the Save button.

    That’s it. We have now fully reversed the changes made by the β€œChange User ID 1” tool.

    Any questions, let me know ??

    Thread Starter barnabas1

    (@barnabas1)

    Thank you @nlpro ????

    I’m not on a pc now but I’ll try later in the day and let you know how it goes.

    Thread Starter barnabas1

    (@barnabas1)

    @nlpro I found the admin new ID and I’m ready to start.

    Could you please clarify for the second commandm whether the user_pass requires the password in plain text or I need to give a parameter to it?

    • This reply was modified 2 years, 5 months ago by barnabas1.
    • This reply was modified 2 years, 5 months ago by barnabas1.

    Ok. Good luck.

    user_pass requires the password in plain (encrypted) text. That means the encrypted string as stored in the database. Not the password like you enter it when logging in.

    Note that after using the β€œChange User ID 1” tool, the tool disappears from the list of tools in the iTSec plugin UI. This makes sense because the tool can normally only be run once.

    But this also means that if you are able to reverse (even if it’s just the SQL part) the changes, the β€œChange User ID 1” tool will show up again in the UI.

    Basically the β€œChange User ID 1” tool will only show up if a user with ID 1 exists in the database.

    • This reply was modified 2 years, 5 months ago by nlpro.
    • This reply was modified 2 years, 5 months ago by nlpro.
Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘Locked Out’ is closed to new replies.