I want to disable temporarily site visiting and user logins to a multisite blog for the site maintenance time, excepting for super-admins and for a specific user. I found this function (thanks @joshc) and it works very well, but I don't know how to add the specific username to it so it can visit the site too. Please help!
This is what I tried, but without success, the user test_user is not allowed to login:
function site_maintenance() {
global $user_login;
get_currentuserinfo();
if ( !is_super_admin() || $user_login != 'test_user' ) {
$logout_url = wp_login_url().'?mode=maintainance';
wp_logout();
wp_redirect( $logout_url, 302 );
die();
}
}
add_action('get_header', 'site_maintenance');