Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Redirect if 'not' logged in

Hi - I've downloaded and set up Vanilla Forums fine and so far I'm happy with what I see.

I've set the forum to connect with my wordpress website using the WP Vanilla Connect plugin and again this works great. My forum can be accessed via a subdomain http://forum.url.com/

I was wondering if there was a way in which if a visitor is 'not' logged into wordpress that if they visit that subdomain they are redirected to a Register page?

Thanks. Gavin.

Best Answer

«13

Answers

  • Options

    Thanks, I'll try these out and feedback. Just updated to Version 2.1b1 and discovered the jsConnect plugin no longer works :( so will be considering what to do with that first.

    Will keep you informed.

  • Options

    did it work?

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    use the plugin forceredirect it works on all versions.

  • Options

    I installed and activated ForceRedirect 1.3 and changed the location to the directory where our forum is located.

    The problem I see is that a non-member visitor can see the Discussions and is only forced to Sign-In/Register when they click on Add Comment.

    How might I change the settings so that a visitor is directed to a Welcome page that explains the Group purpose and rules then only to the Sign In/Register page?

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    The problem I see is that a non-member visitor can see the Discussions and is only forced to Sign-In/Register when they click on Add Comment.

    Ok please read the info about the plugin in the plugin's page it explains how to remove the controller/page so only the one you want is seen.

    If you remove them all except the entrycontroller then they will just go directly to the sign in/register page when they go to your forum. In effect making the sign in page the home page.

    How might I change the settings so that a visitor is directed to a Welcome page that explains the Group purpose and rules then only to the Sign In/Register page?

    You can create an Extra Page using the ExtraPage plugin which would contain that info and then you would only have :

    entrycontroller and plugincontroller as the pages that could be viewed by guests and remove the others.

  • Options

    Thank you for your quick reply! :-)
    BTW: I love the Vanilla setup interface!
    Also, Galleries 1.2 seems to be working fine (after I tweaked it a little), Privacy Notice 1.2 also fine, Version Check 1.3 as well.
    I changed the line to this" $ShowOnController = array('entrycontroller');
    When I go to the site using my phone I am still able to view the Discussions.
    Only "Add a Comment" forces Sign In

  • Options

    I don't see any need to change anything in ExtraPage/design/exp.css and am used to pre-5 (my son says pre-4) HTML so will have to educate myself re. css first.
    I'm really confused by ExtraPage/locale/en-CA/definitions.php as I thought that was all about language dictionaries -
    Do I change $Definition['ExtraPage'] = 'New Page';
    to ...
    $Definition['ExtraPage'] = 'What is OACHE all about?'; to cause there to be a Title for the page where ForceRedirect sends visitors?

  • Options

    Oh, and back in ForceRedirect I changed $ShowOnController = array('entrycontroller');
    to
    $ShowOnController = array('entrycontroller, plugincontroller');

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited July 2013

    When I go to the site using my phone I am still able to view the Discussions. Only "Add a Comment" forces Sign In

    ok please try adding 'MobileFriendly'=>TRUE; like I did below in the plugin info . This should make the plugin work on the mobile too.

    $PluginInfo['ForceRedirect'] = array(
       'Name' => 'ForceRedirect',
       'Description' => 'Redirects all Guest users to the Signin page and keeps the parts you don\'t want to show, private.',
       'Version' => '1.3',
       'MobileFriendly'=>TRUE,
       'Author' => 'VrijVlinder',
       
    );
    
    

    I'm really confused by ExtraPage/locale/en-CA/definitions.php as I thought that was all about >language dictionaries - Do I change $Definition['ExtraPage'] = 'New Page'; to ... >$Definition['ExtraPage'] = 'What is OACHE all about?';

    yes the $Definitions can be to change a language or just the words.

    You will need to put a link to the sign in page in the your extra page so people can navigate to sign up or log in.

    It renders the menu so maybe you can add the link to the menu using add menu item plugin by peregrine. To put the link to the entry/signin page. However with force redirect they would go to the login anyway if they click anything.

    You can make your landing page be the extra page by changing the route to the home page in the routes in the dashboard

    in the settings then Routes change the default controller from

    DefaultController discussions Internal

    to

    DefaultController plugin/ExtraPage Internal

    this will make the extra page intro page the landing page people see when they go to the forum. You could also add the guest module to the page if you wanted.

  • Options

    I added 'MobileFriendly'=>TRUE, and that forced me to a Page Not Found, which is an improvement for Forum privacy.
    It is going to: /oachegroup/entry/signin so I guess I need to look there.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    lol that is not supposed to happen , though let me look into that ....

    But the link to the sign in page is just entry even though it is called entry sign in (for the popup)

    /oachegroup/entry

    should be the right link to the log in page

  • Options

    I think I had ForceRedirect wrong.
    It was:
    header('location:/oachegroup/entry/signin');
    I just tried:
    header('location:/entry/signin');
    That worked!

  • Options

    "It worked" means that it forces me, via my phone, to the Sign In page.
    It's 1am here so I need to get some sleep.
    Tomorrow I need to look at how to allow an option on the Sign In page to allow a Visitor to view a "More Info" page.
    Thanks!

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    Good you are getting there, get some rest :)

  • Options

    Does 'MobileFriendly'=>TRUE; need to be added globally to Vanilla addons?

    I noticed that I could not Sign In to my admin account from my phone - it just kept cycling me back to the Sign In screen.

  • Options

    Gallery displays the first picture I posted there but when I go to add pictures to the same Album it tries to bring me to http://oachegroup.org/oachegroup/gallery/graduation2013 which brings up "Page Not Found".

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    It works for me to sign in from the phone. ....

    You need to make sure you change the parts in the links for the plugin from forum to oachegroup

    in the Galleries Views gallery.php

    You will see those parts that say forum just change them all to oachegroup

  • Options

    I already edited gallery.php but am thinking I got it wrong - so now I'm not sure what to fix.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    ok how about you copy the gallery.php and zip it up here and I can look at it ?

Sign In or Register to comment.