[wp-hackers] Users being created in master site and local site

Lox lox.dev at knc.nc
Sun Jan 8 20:33:01 UTC 2012


Hello,

2012/1/9 Robert Lusby <nanogwp at gmail.com>

> How does a site admin, with access only to their local site, ensure that
> when deleting a user, it gets removed from their local site, and the
> network site?
>

I think giving a blog admin the permission to *remove* a user from the
network is a bad idea as it will affect other blogs (you can still add a
hook on user modification checking if it is still subscribed to any blog
and then, remove it if not)
But you can prevent users from login to the blogs they've been removed
from. For this, add a filter to the authenticate hook:

function my_authenticate ($user, $username, $password) {
    if( $user && is_user_member_of_blog($user->ID) ) return $user;
    return null;
}
add_filter('authenticate', 'my_authenticate', 10, 3);

 OR ... when a user is created, create that user in the local site only
> (and not the network user list).
>

As signup is done on the main site, this one is more difficult to achieve.
If you made a custom signup form, make sure no capabilities are set on the
main blog on signup.

Regards.

-- 
Lox
lox.dev at knc.nc


More information about the wp-hackers mailing list