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

Feedback [fixed]

I have fixed this plugin to work with Vanilla 2.0.18.8

It redirects guests to the sign in page.

Comments

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

    Developers ? anyone ....

  • hgtonighthgtonight MVP
    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.

  • 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,

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

  • 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.

  • 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.

  • 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.