HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Feedback [fixed]

vrijvlindervrijvlinder Papillon-Sauvage MVP

I have fixed this plugin to work with Vanilla 2.0.18.8

It redirects guests to the sign in page.

Comments

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    I would like to be able to pick which pages to force sign in on, anyone have a clue?

    Developers ? anyone ....

  • hgtonighthgtonight ∞ · New Moderator
    edited April 2013

    You could filter by controller, method, what ever you want.

    Use the $Sender information to pick.

    E.g. Don't force a sign in on the discussions or category pages.

    // Get the controller name
    $Controller = $Sender->ControllerName;
    $ShowOnController = array(
        'discussioncontroller',
        'discussionscontroller',
        'categoriescontroller'
    );
    
    // force sign in if we aren't in an approved controller
    if (!InArrayI($Controller, $ShowOnController)) {
        if(strpos($_SERVER['REQUEST_URI'],'termsofservice') == true || strpos($_SERVER['REQUEST_URI'],'emailavailable') || strpos($_SERVER['REQUEST_URI'],'usernameavailable')) { 
        }
        else if(Gdn::Session()->UserID == 0 && strpos($_SERVER['REQUEST_URI'],'entry') == false) { 
            header('location:/entry'); 
        }
    }
    

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    excellent !! I will try that and get back :)

    By the way the link to the sign in page is not entry it is /entry/signin and the header location would be forum/entry/signin,

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    it looked good but can't get past syntax errors....will keep trying

  • hgtonighthgtonight ∞ · New Moderator

    Sorry, I downloaded the version in the repository. The controller logic is sound. :-)

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    Oh yea I am sure that is, but I am not great with solving syntax errors , just need to figure out what I am doing wrong..would be great to have options via the dashboard as far as choosing what can or can't be seen. I want to be able to use this specifically for the gallery plugin.

  • hgtonighthgtonight ∞ · New Moderator

    Gotcha. I ripped this off my latest post list plugin. You should be able to drum up a list of controllers pragmatically. ..

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

Sign In or Register to comment.