Forums / Setup & design / Menu/permission problem

Menu/permission problem

Author Message

Øivind Gulbrandsen

Wednesday 03 November 2004 1:04:22 am

Based on the "Intranet" site I am building a solution for an organization.

Different user groups has got different access rules.

I have a problem with the menus (top menu).

When the site is opened menu items for "open" parts of the site is shown. OK.

If I then login I still get the same menu items - even if this user is allowed to access more menu items. (and it opens another page - not the home page!). If I open one of the restricted pages (through URL) it opens fine - and now with correct menu items! (But still the same problem if I go back to either the home page or the first page opened).

I have tried to delete "all cache" after I am logged in to the site. Then everything works excellent! (But if I delete cache before logging in the problem is there...). If I then log out and reopen the site without login the anonymous user sees all menu items! (another thing is that he can also see content from restricted sections that is shown on the home page through toolbars..., but he can not open the relevant menu items...).

Anyone that knows the problem - evt. solutions?

Øivind

Michael D.

Wednesday 03 November 2004 1:59:55 am

Which browser do you use?
Several browsers have too aggressive caching policies and are caching content even when they're not supposed to.

No real solution but at least worth trying is to add the following lines to the index.php, somewhere before ob_end_flush(); :

header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
header("Pragma: no-cache");

You could also try to set an expiry date which lies in the past, but I had no big success with this.

Testing showed the following:
IE 6: doing fine
Mozilla Browsers: login, logout, login, logout <- the last logout won't work
Opera: You have to use F5 to reload the page.

You could also try to use a different siteaccess for anonymous and registered users, if you don't mind the caching (which would be critical for eg. a shopping basket).

I would be very pleased to see a final solution as this is something bugging me a lot.

Btw, I disabled the cache of my Firefox 1.0PR to work properly and believe me it sucks. ;)

Øivind Gulbrandsen

Thursday 04 November 2004 9:17:46 am

I use IE 6.0.

Have tried to include the proposed code in index.php. No effect on my problems...

To set the expiry date to the past - where do I set this date?

I do not like the idea of several siteaccesses... (and not sure if I understand the consequenses).

Any others with ideas???

Øivind Gulbrandsen

Friday 05 November 2004 2:54:33 am

Have now solved this.

The cache-block key resulted in same cache for all users, but should be differentiated by role. Found this in another forum topic - and it worked (changed it in the relevant templates):

{cache-block keys=array('my_cache_block',$uri_string,$current_user.role_id_list|implode(',')) expiry=86400}

BUT STILL ONE PROBLEM:

After login it does not show the home page of my site, but one of the sub-pages. I do not understand why this happens. (When I open the site without login I come to the correct page).

Any ideas???

Michael D.

Friday 05 November 2004 7:16:28 am

I don't want to be bossy but you should post your new problem in a new thread. :)

(And no, I don't have an idea what the problem might be.. unless you are on a different url after the login.)