Home › Forums › Legacy Support › Support queries › How-to & Troubleshooting › How to prevent login to dashbord to users from another subsite in WP multisite?
- This topic has 29 replies, 4 voices, and was last updated 2 years, 7 months ago by Usapuka.
-
AuthorPosts
-
May 7, 2021 at 6:59 pm #356552UsapukaSpectatorHello, 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:
With the plugin activated no one can log in to the site. Thanks, regards.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(); } }
May 7, 2021 at 9:15 pm #356561UsapukaSpectatorThis reply has been marked as private.May 8, 2021 at 10:58 pm #356681UsapukaSpectatorAnother 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?May 10, 2021 at 3:05 pm #356827Anshuman SahuKeymasterthis 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 .May 10, 2021 at 3:55 pm #356829UsapukaSpectatorHi 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,May 12, 2021 at 2:12 pm #357069Anshuman SahuKeymasterYes 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 ?May 12, 2021 at 3:46 pm #357086UsapukaSpectatorThis reply has been marked as private.May 13, 2021 at 2:07 pm #357210Anshuman SahuKeymasterThis reply has been marked as private.May 13, 2021 at 2:43 pm #357217UsapukaSpectatorHello 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,May 14, 2021 at 9:42 am #357332UsapukaSpectatorAnother 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.May 14, 2021 at 3:11 pm #357430Anshuman SahuKeymasterPlease 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.May 14, 2021 at 6:25 pm #357451UsapukaSpectatorHi 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,May 15, 2021 at 12:58 pm #357547UsapukaSpectatorHi 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,May 15, 2021 at 1:32 pm #357566Anshuman SahuKeymasterOk currently disabled the fix in your site , we are checking why this is not working ,you can add students now .May 15, 2021 at 2:16 pm #357577UsapukaSpectatorThanks Alex, I added an estudent without problem. -
AuthorPosts
- You must be logged in to reply to this topic.