Title: Multisite issue
Last modified: April 7, 2020

---

# Multisite issue

 *  Resolved [tobsen11](https://wordpress.org/support/users/tobsen11/)
 * (@tobsen11)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/multisite-issue-47/)
 * I just discovered an unwanted behaviour on a multisite installation.
 * I run a network with serveral sites on different subdomains. Each site has an
   autologin user with autologin code who should only be able to access his primary
   blog.
 * But when I use a user’s autologin code on another site, I’m logged in on that
   site, too.
 * Can you please add an additional check, whether a user has access to a specific
   site on the network?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [tobbecokta](https://wordpress.org/support/users/tobbecokta/)
 * (@tobbecokta)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/multisite-issue-47/#post-12685708)
 * Hi,
 * I am also running Autologin Links on a multisite installation, but the problem
   I am having is that logged in users are automatically redirected to /shop url,
   instead of the url that they are trying to access…
 * Are you having the same issue?
 *  Plugin Author [WPAutoLogin](https://wordpress.org/support/users/wpautologin/)
 * (@wpautologin)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/multisite-issue-47/#post-12697121)
 * Dear [@tobsen11](https://wordpress.org/support/users/tobsen11/)
 * I understand that this might be unwanted and I tested the multi-site behavior
   yesterday myself and saw the same behavior. However, this seems is part of WordPress
   rather than my plugin:
 * If you go to the login page of any subpage of a multisite setup, you can login
   to a that subpage with any username/password combination that has an account 
   on some other subpage. You cannot do anything then, but you are logged in. I 
   therefore, conclude that this is not an actual bug in my plugin but rather the
   way wordpress mutlisite setups work. (Tested with wordpress 5.4.0).
 * The correct fix here would likely be to install another type of plugin that prevents
   access to other pages that a user is not the owner of.
 * Hope that helps, regards,
    Paul K.
 *  Thread Starter [tobsen11](https://wordpress.org/support/users/tobsen11/)
 * (@tobsen11)
 * [6 years ago](https://wordpress.org/support/topic/multisite-issue-47/#post-12779571)
 * Thanks a lot for the hint, Paul.
 * I’ve added a small function to my plugin that redirects the user in case he is
   not member of the blog:
 *     ```
       function validate_user() {
       global $current_user;
           get_currentuserinfo();
           if (!is_user_member_of_blog($current_user->ID)) {
       	   $site = get_active_blog_for_user($current_user->ID);
       	   wp_redirect(get_site_url($site->blog_id, '', 'https'));
           }
       }
       add_action('template_redirect', 'validate_user');
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Multisite issue’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/autologin-links.svg)
 * [Autologin Links](https://wordpress.org/plugins/autologin-links/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autologin-links/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autologin-links/)
 * [Active Topics](https://wordpress.org/support/plugin/autologin-links/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autologin-links/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autologin-links/reviews/)

## Tags

 * [multisite](https://wordpress.org/support/topic-tag/multisite/)

 * 3 replies
 * 3 participants
 * Last reply from: [tobsen11](https://wordpress.org/support/users/tobsen11/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/multisite-issue-47/#post-12779571)
 * Status: resolved