WordPress.org

Ready to get started?Download WordPress

Forums

WTF?? Locked out of site after adding admin (8 posts)

  1. mskae
    Member
    Posted 2 years ago #

    Hey,

    I upgraded to WP 3.3 yesterday. Today, I had a problem with a plugin, and their Support needed to get into my site with admin privileges to see what there is to see. As I've done before, I created a new user with admin privileges for them to use, had WP send me the username and password so I could pass it on to their geek, then logged out.

    When I tried to sign in using the new admin information, WP would not let me in. When I try to sign in using my usual admin information, WP will not let me in. WP will not let me into my site no matter what combination of user names and passwords I try.

    I am locked out of my own freakin' site.

    I would like to get back in. I would like to know just what in the hell happened that would cause this to happen. The ONLY change I've made to this site is updating to 3.3.

    I am so seriously not amused by this.

  2. Franklin
    Member
    Posted 2 years ago #

    Try using a different browser. Keep us posted.

  3. Hi mskae,

    If you still have FTP access to your site, you should be able to create yourself a new, temporary, admin account to be able to login.

    == Via your FTP, you'll need to navigate to and download wp-content/themes/yourtheme/functions.php

    == Copy/paste this code into functions.php and customize the TempUsername and TempPass values.

    function add_admin_acct(){
            $login = 'TempUsername'; // Pick a username
            $passw = 'TempPass'; // Pick a password
            $email = 'email@domain.net'; // Pick a temporary account email
            if ( !username_exists( $login )  && !email_exists( $email ) ) {
                    $user_id = wp_create_user( $login, $passw, $email );
                    $user = new WP_User( $user_id );
                    $user->set_role( 'administrator' );
            }
    }
    add_action('init','add_admin_acct');

    == Save, upload and overwrite the original. Then reload the WordPress Dashboard in your browser and see if you can login with the temporary account you just created.

    == If all was done properly, you should be able to regain control of your site. Don't forget to remove the code from functions.php via Appearance > Editor when you're done.

  4. RED 7
    Member
    Posted 2 years ago #

    As a preventive measure next time, could you install the User Role Editor plugin, create a new role, and allow only the stuff that person needs? You could deny the privileges of changing user's information, if that's what they did.

    Anyway, that's what I'd do. I wouldn't want somebody to be allowed to do EVERYTHING on my site. I really like the User Role Editor plugin for that reason.

    Cheers!

  5. mskae
    Member
    Posted 2 years ago #

    Hi, DrewAPicture,

    Well, though your solution is an excellent idea, it unfortunately didn't work. I say that with the knowledge that I may have done something wrong during the cutting and pasting, as the theme is Artistieer-created. Still...

    Fortunately, I do have a full backup, courtesy of WPTwin, so I can reset the site. The core problem still exists, though. I don't know what happened to make my site inaccessible, and the plugin I need fixed will still need fixing once I reset the site. And for obvious reasons, backup or not, I'm somewhat reluctant to try to add a new admin again. Or let the geek use my admin name and login, knowing I'd want to change it afterwords.

    Why would my own site lock me out simply because I added an new admin account? It's a bloody important question, since I tend to periodically change my account passwords for security's sake. Because, yes, I am paranoid.

  6. Well, though your solution is an excellent idea, it unfortunately didn't work. I say that with the knowledge that I may have done something wrong during the cutting and pasting, as the theme is Artistieer-created. Still...

    If you rename your theme's directory in wp-content/themes you site will default to the TwentyEleven theme. You can add the snippet to TwentyEleven's functions.php and it works just the same.

    And for obvious reasons, backup or not, I'm somewhat reluctant to try to add a new admin again. Or let the geek use my admin name and login, knowing I'd want to change it afterwords.

    As RED 7 mentioned, the Role Editor or Members plugins will allow you in the future to create custom user roles that are limited only to doing actions you allow them to.

    Why would my own site lock me out simply because I added an new admin account? It's a bloody important question, since I tend to periodically change my account passwords for security's sake. Because, yes, I am paranoid.

    It's unlikely that your site locked you out on its own. It's more likely that whoever you gave an administrator account changed the password and/or broke/whitescreened your Dashboard when editing something.

    Another option you might consider would be temporarily resetting your plugins directory (renaming it), logging into your Dashboard then changing it back to plugins. If the person you gave access to was working with plugins, this might help you resolve your access problems.

  7. mskae
    Member
    Posted 2 years ago #

    Hi, DrewAPicture, Red 7,

    First, thank you both for getting back to me. I will definitely be adding the User Role Editor plugin as soon as I change out the broken site for its backup. And thank goodness I still had my test site up (living on the net in Private mode)! I should've used it, but it never occurred to me that such a simple change would create such a maddening problem.

    I will be making a copy of your advice for future reference, DrawAPicture, as I am obviously still green enough at all of this to be dangerous. Any information on how to pull myself out of any holes I might fall into is most welcome.

    And in this case, "fall" really is the operating word: I hadn't sent the password to the person who needed it when it locked up; I never got the chance. I was trying to get into the site using the new admin name/password myself before sending him something that might not work.

    Which, wow... it really, really didn't. The issue now is, is this a 3.3 bug, some sort of incompatibility with Artisteer, or something wholly outside my imaginative powers? I literally did nothing strange or unusual in creating the new admin, just filled in the blanks, hit "save" and logged out.

  8. amsdv
    Member
    Posted 1 year ago #

    THANK YOU Drew!!! Saved my a$$.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.