Users running a non-download version of Vanilla (pulled from github), on branch release/2019.016 or master from the last 2 weeks should upgrade to release/2019.017 or latest master for security reasons. Downloaded official open sources releases are not affected.

sidepanel navigation; show only if user is signed in

This discussion is related to the Participated Discussions addon.
jackmaessenjackmaessen ✭✭✭
edited December 2014 in Feedback

I am using this plugin and i noticed that when no one is logged in, the Participated Discussion is also shown in the sidepanel. This seems not very logic to me.

In class.participated.plugin.php file there is this piece of code which displays the nav link in the sidebar. I put 2 lines to it so that it is only being diplayed when user is logged in (these lines are marked with --> ADDED

   /**
    * New navigation menu item.
    *
    * @since 2.1
    */
   public function Base_AfterDiscussionFilters_Handler($Sender) {
      if (Gdn::Session()->IsValid()) { // check if the user is signed in, otherwise do not show in side navigation  -->ADDED
      // Participated
      $CssClass = 'Participated';
      if (strtolower(Gdn::Controller()->ControllerName) == 'discussionscontroller' && strtolower(Gdn::Controller()->RequestMethod) == 'participated')
         $CssClass .= ' Active';
      echo '<li class="'.$CssClass.'">'.Anchor(Sprite('SpParticipated').T('Participated'), '/discussions/participated').'</li>';
   } // endif garden session -->ADDED
   } 

Comments

Sign In or Register to comment.