None of the solutions presented really works for me. I truly want a real user moderation. Since I installed wordpress for the first time ever today I don’t really know how to write a plugin, but I have hacked around a bit this evening and I got up a solution that actually sets users as not being able to login after being created from the web, but can login when created from admin. At the moment I need to manually update the mysql-table to allow them to login, but I’m working on integrating this into my “hack” as well.
What I have used is the “user_status” field in the wp_users table. This field as far as I can see is deprecated and is no longer used. If you feel uneasy of using this field you can easily add your own one instead.
What I’ve done is simply the following.
1. In /wp-register.php:
Locate the following:
if ( !$user_id )
$errors[‘user_id’] = [..and so on ..]
else
wp_new_user_notification($user_id, $password);
Change to:
if ( !$user_id ){
$errors[‘user_id’] = [..and so on ..]
}else{
wp_new_user_notification($user_id, $password);
$wpdb->query(“UPDATE $wpdb->users SET user_status = -1
WHERE user_login = ‘$user_login'”);
}
2. In /wp-login.php:
Locate the following:
$user = new WP_User(0, $user_login);
Below it, add:
$status = $wpdb->get_var(“SELECT user_status FROM $wpdb->users WHERE user_login = ‘$user_login'”);
if($status == -1){
$error = ‘Your user has not been approved yet.’;
}else{
Locate the row:
} else if ( $user_login || $user_pass ) {
Add a line above with a single
}
Well, that’s it so far. Hope it can get someone on the right track ??