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.

Feature requests

2»

Comments

  • peregrineperegrine MVP
    edited July 2012
    put this in the  default.master.php
    
       if (Gdn::$Session->IsValid()) {
                $this->Menu->AddLink('FAQS', T('FAQS'), '/faqs');
                }
    
    
    put this in the application
    
    if  (!Gdn::Session()->IsValid()) {
                 exit();  
                }
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • SheilaSheila ✭✭

    peregrine said:
    put this in the default.master.php

    if (Gdn::$Session->IsValid()) {
    $this->Menu->AddLink('FAQS', T('FAQS'), '/faqs');
    }

    I get Fatal error: Access to undeclared static property: Gdn::$Session in /themes/default/views/default.master.php on line 32

  • peregrineperegrine MVP
    edited July 2012

    try this then

    $Session = Gdn::Session();
    
    if ($Session->IsValid()) {
       $this->Menu->AddLink('FAQS', T('FAQS'), '/faqs'); 
     }
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • SheilaSheila ✭✭
    edited July 2012

    ^ Just superb! That did it. Thank you once again :)

    That hided also other custom page link that is listed after 'Faq' and which I want guests to see since it's a contact page, but I solved that with adding manage and view options to contact-page.

    I could have naturally moved contact link before faq if it was any other page, but contact just shoudn't be in the middle of main menu unless that is most important page of the site.

    peregrine said:
    the options for permissions will show up in each role towards the bottom just before the default category permissions.

    I found an answer to this, why I did not see any new options in role management. In order to changes take an effect, plugin needs to be turned off and back on.

Sign In or Register to comment.