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.

how to recognize users role ?

edited September 2009 in Vanilla 2.0 - 2.8
hello !

I have add a page with the extension PageManager, on this page, I need to know the role of the user to display a message, but I´m a php newbie !

I´ve tried with this :

$this->Context->Session->Check($Context); if (($this->Context->Session->User->RoleID == 3) || ($this->Context->Session->User->RoleID == 4) || ($this->Context->Session->User->RoleID == 5)) { echo "Pour modifier vos informations, <a href=\"?Page=upload-modif\">cliquez ici</a><br /><br />"; }

the rest of the page _must_ be displayed whatever the role or the user

it works fine if you have a roleId 3, 4 or 5... just, when the user have another RoleId, he is automatically redirected to the homepage !

help please !!


  • Options
    nobody ?
  • Options
    up !!
  • Options
    edited September 2009
    I ve tried many many things, and nothing works... I´m desperate !!

    I think PageManagement doesn´t allow to use the UserId or RoleID

    Maybe can I create 2 pages, one for the users with RoleID 3, 4 or 5, and one for the others, I need to recognize the RoleID before being of the page that I´ve add with PageManagement

    I would like to see the link on the PanelFooter, how can I do that ?

    case 1, the RoleID is 3, 4 or 5 : display the link for page 1 with my echo "pour modifier[...]"; and the rest of the content

    case 2, others RoleID : display the link for page 2 with just the content
Sign In or Register to comment.