register user only with specific Host name

I think the User Domain Whitelist plugin is exactly what you want: The User Domain Whitelist/Blacklist plugin limits user registration to only registrants with an email address from the domain white list below OR prevents registrants with an email address from the domain black list below from registering.

How do I set user account inactive?

how about just setting user meta. Something like ‘my_inactive’ and set it to true, then you can evaluate by something like if( get_user_meta( $user, ‘my_inactive’ ) === true ) and have a quick way to check that without destroying any of the user privileges or anything. This will allow you to hook login and just … Read more

allow only lowercase user registrations

The filter validate_username sends and expects a boolean value, not a string. Hook into sanitize_user and use mb_strtolower(). Sample code, not tested: add_filter( ‘sanitize_user’, ‘wpse_83689_lower_case_user_name’ ); function wpse_83689_lower_case_user_name( $name ) { // might be turned off if ( function_exists( ‘mb_strtolower’ ) ) return mb_strtolower( $name ); return strtolower( $name ); }