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

sidepanel navigation; show only if user is signed in

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.