How to prevent login to dashbord to users from another subsite in WP multisite?

Home Forums Legacy Support Support queries How-to & Troubleshooting How to prevent login to dashbord to users from another subsite in WP multisite?

Viewing 15 posts - 1 through 15 (of 30 total)
  • Author
    Posts
  • #356552
    Usapuka
    Spectator
    Hello, I have set up my multisite from scratch, in addition to the main site https://tecnobiz.com.ar/ I have set up a subsite https://campus.tecnobiz.com.ar/. If a user wants to log in to WordPress on a site where they are not regitered as a user, they cannot (which is correct). If a user (instructor or student) on the main site or subsite wants to log into VibeBP they can and log into the corresponding dashboard (also in the subsite where he is not registered). https://screencast-o-matic.com/watch/crhiFlVfhRk How can I avoid this? I have tried putting in the wplms-customizer, the script:
    add_action('authenticate',  'validate_on_login', 100, 3);
    
    function validate_on_login(){
      if (!is_user_logged_in()) {
         return;
      }
    
      $user = wp_get_current_user();
    
      //allow only login if user is member of this blog
    
      if (!is_user_member_of_blog( $user->ID, get_current_blog_id() ) && !is_super_admin( $user->ID )) {
        wp_logout();
        wp_redirect(network_site_url());exit();
      }
    }
    With the plugin activated no one can log in to the site. Thanks, regards.
    #356561
    Usapuka
    Spectator
    This reply has been marked as private.
    #356681
    Usapuka
    Spectator
    Another problem I encountered is that when the Instructor is adding students to a course, among the options, students from the subdomain appear. That is to say, when adding students to Site A, students that belong to Site B also appear between the options: https://prnt.sc/12oz2z2. How can this be avoided?
    #356827
    Anshuman Sahu
    Keymaster
    this seems to be an issue , members apeparing in search from other sites . restrict users fron subsites : The another snippet should work fine , currently there is no settings present in wplms for this .
    #356829
    Usapuka
    Spectator
    Hi Alex, The login seems to be a problem with VideBP, and if I put the script in wplms-customizer, there is no way to login to the site. What else can I do? Are you going to look into this issue?:
    this seems to be an issue , members apeparing in search from other sites.
    Regards,
    #357069
    Anshuman Sahu
    Keymaster
    Yes we are working on this and tried to test this but your ftp credentials Im not able to write the files properly (there is some error in writing the files to server ), can you please share your new ftp credentials ?
    #357086
    Usapuka
    Spectator
    This reply has been marked as private.
    #357210
    Anshuman Sahu
    Keymaster
    This reply has been marked as private.
    #357217
    Usapuka
    Spectator
    Hello Alex, Now when I want to add students to the course, none of them appear: neither the site's own nor the subsite's: https://prnt.sc/12vqnvm My subsite is: https://campus.tecnobiz.com.ar/ see https://prnt.sc/12vqnvm Regards,
    #357332
    Usapuka
    Spectator
    Another problem I encountered: I had to reboot my PC and when I tried to log in to WP I got this error: https://prnt.sc/12x22m8 but when I went back to the home page, I realised that I was logged in.
    #357430
    Anshuman Sahu
    Keymaster
    Please enable both sync ""vbebp to wp and wp to vibebp . Please goto wp-admin -> WPLMS -> buddypress -> check if you have allowed access to member directory set to "all" and single member profile view to all.
    #357451
    Usapuka
    Spectator
    Hi Alex, "vbebp to wp and wp to vibebp" are enabled. Member directory set to “all” and single member profile view to all. But nothing changed: when I want to add students to the course, none of them appear: neither the site’s own nor the subsite’s. The login problem remains. Regards,
    #357547
    Usapuka
    Spectator
    Hi Alex, I am currently unable to add students to the courses, please I would need a solution to this to continue working on my site. Thanks, regards,
    #357566
    Anshuman Sahu
    Keymaster
    Ok currently disabled the fix in your site , we are checking why this is not working ,you can add students now .
    #357577
    Usapuka
    Spectator
    Thanks Alex, I added an estudent without problem.
Viewing 15 posts - 1 through 15 (of 30 total)
  • You must be logged in to reply to this topic.