Alex help in multisite setup in wplms 4

Home Forums Legacy Support Support queries How-to & Troubleshooting Alex help in multisite setup in wplms 4

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #378038
    nawrasj
    Spectator
    I have a multisite setup for WPLMS 4.2 Network site: xyz.com sub site: xyz.com/subsite1 sub site: xyz.com/subsite2 if user is registered on the subsite2 and log in on network site. the user should redirect to the subsite where he is registered. but they are on the network site. they dont redirect. in other normal multisite setup it works the way i explained. they redirect. that's a serious issue.
    #378115
    Anshuman Sahu
    Keymaster
    Are you on version 3 or version 4? By default user wont be able to login on multiple sites they can only login to site they are registered .
    #378147
    nawrasj
    Spectator
    This reply has been marked as private.
    #378374
    Anshuman Sahu
    Keymaster
    Hi we need some time to check this meanwhile please check multisite setup , with settigs you can allow login to different sites . but for the redirecting you need to set the app page as per : https://www.youtube.com/watch?v=8QkRH3yE6Hg and then set login redirection from wp-admin-> lms -> settings to profile pages .
    #378551
    nawrasj
    Spectator
    this does not help. can you refine the code I sent. it has a looping issue which makes the site to not load. also if a user is an admin on subsite this will not work as well. so please change the if the condition so that it should work only for the basic user and instructors registered on the subsite.
    #378703
    Anshuman Sahu
    Keymaster
    You can try below hook is changed coz init runs at every instance as oon as site is accessed :
    function mu_check_if_user_needs_redirecting(){
    global $blog_id;
    if ( is_user_logged_in() && !current_user_can_for_blog( $blog_id, 'manage_options' ) ) {
        $active_blog = get_active_blog_for_user(get_current_user_id());
        $blogid = get_current_blog_id();
        if ($blogid != $active_blog->blog_id){
            wp_redirect($active_blog->siteurl);
            exit;
        }
    }
    }
    add_action( 'wp_login', 'mu_check_if_user_needs_redirecting', 768);
    #378711
    nawrasj
    Spectator
    it only works if user is super admin / network admin. if user is only admin on a subsite the IF condition fails. so please change the if the condition so that it should work only for the basic user and instructors registered on the subsite.
    #378806
    Anshuman Sahu
    Keymaster
    We need to research on it as the feature not available with theme .Please provide some time.
    #379223
    nawrasj
    Spectator
    This reply has been marked as private.
    #379399
    Anshuman Sahu
    Keymaster
    I searched for this and found that this is already done by wordpress , it redirects user to his site . It seems the user is actually activated on all of your sites please check if that is the case .
    #379418
    nawrasj
    Spectator
    do you need a video?? i can show it is not working
    #379454
    Anshuman Sahu
    Keymaster
    Yes please share your site url in private reply to check this out.
Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Alex help in multisite setup in wplms 4’ is closed to new replies.