Current i have tested, with different blogs in Multisite; works.
One blog is protected via plugin, the plugin is active in this blog; the other blogs are not protected; its possible to see frontend and also to view the login page.
maybe you have more information
Like i said it works.
But on the blog which is not protected it redirects to the Login Page instead of the Front Page.
I’ll send you PM with the Link if you want.
Now i have also tested, if the plugn is not active in a blog of a network, then it is possible to go to the login page, no redirect — hmm; stupid.
Please send me this; but current i don’t have it a pm.
maybe an idea.
change the last function in the plugin with this code; maybe it helps you.
public static function redirect() {
/**
* Checks if a user is logged in or has rights on the blog in multisite,
* if not redirects them to the login page
*/
$reauth = ! current_user_can( 'read' ) &&
function_exists( 'is_multisite' ) &&
is_plugin_active( plugin_basename( __FILE__ ) ) &&
is_multisite() ? TRUE : FALSE;
if ( ! is_user_logged_in() || $reauth ) {
nocache_headers();
wp_redirect(
wp_login_url( $_SERVER[ 'REQUEST_URI' ], $reauth ),
$status = 302
);
exit();
}
}