Post by SamNabz » Tue Feb 28, 2012 6:10 am

Hi all,

Not sure if this is in the right area of the forum, so please feel free to move it if necessary.

What I am trying to do is have a link in the header menu of the administrator panel for various modules.

The reason for this is I don't want the other admins (with lower permissions) to be able to see ALL the modules. Currently I am using <?php if ($this->user->getId() == 1) { ?> to hide the 'Modules' page from the other admins, however I would like to isolate a few module links and place them in the top menu next to Dashboard, Catalog etc. for them to be able to see and use.

At the moment if I just place the link, I will constantly receive a token error and be logged off - see example below:

If I want to place a link to the 'Featured' module in my top menu and use this as the href value -- index.php?route=module/featured&token=b5c60e2a70b515e57c81dc8928e8d64a -- obviously this cannot work as the token must be generated each time you click on the Featured module link through the 'Modules' page.

Any information on how to do this is greatly appreciated.
Last edited by SamNabz on Tue Feb 28, 2012 5:22 pm, edited 1 time in total.

Cheers, Sam


Active Member

Posts

Joined
Wed Jul 06, 2011 7:32 am
Location - Sydney, Australia

Post by affect » Tue Feb 28, 2012 6:48 am

Token is stored in the session so you should be able to use $this->session->data['token'] in the admin templates to build the links correctly.

Also you might want to create a different group with less permissions for other admins instead of adding them to top administrators group. You should then be able to restrict their access/modification permissions to different administration areas. If you just hide the modules page, they'll still be able to access it by typing in the corresponding URL so that's definitely not the best way to do it.

MultiMerch Marketplace for OpenCart

Image


User avatar
Active Member

Posts

Joined
Sat Aug 13, 2011 5:04 pm


Post by SamNabz » Tue Feb 28, 2012 7:32 am

affect wrote:Token is stored in the session so you should be able to use $this->session->data['token'] in the admin templates to build the links correctly.
Hi affect,

Thank you for the prompt reply.

Could you please elaborate on that? If you could give me an example of what the link should look like that would be great.
affect wrote:Also you might want to create a different group with less permissions for other admins instead of adding them to top administrators group. You should then be able to restrict their access/modification permissions to different administration areas. If you just hide the modules page, they'll still be able to access it by typing in the corresponding URL so that's definitely not the best way to do it.
I do set the permissions via user groups to restrict access etc. but I also hide the modules page.

Cheers, Sam


Active Member

Posts

Joined
Wed Jul 06, 2011 7:32 am
Location - Sydney, Australia

Post by affect » Tue Feb 28, 2012 8:14 am

You admin template links will then look somewhat like this:
<a href="index.php?route=module/featured&token=<?php echo $this->session->data['token']; ?>">Featured</a>

MultiMerch Marketplace for OpenCart

Image


User avatar
Active Member

Posts

Joined
Sat Aug 13, 2011 5:04 pm


Post by SamNabz » Tue Feb 28, 2012 9:12 am

Thanks affect, that worked perfectly!

Much appreciated mate.

Cheers, Sam


Active Member

Posts

Joined
Wed Jul 06, 2011 7:32 am
Location - Sydney, Australia

Post by rmandiga » Fri Jan 29, 2016 11:33 pm

@affect: Thanks for your help. I was struggling long for this solution.

*******

Newbie

Posts

Joined
Fri Oct 16, 2015 9:43 pm
Who is online

Users browsing this forum: Bing [Bot] and 108 guests