[pmwiki-users] identify current authorization level

Patrick R. Michaud pmichaud at pobox.com
Fri Aug 4 08:57:32 CDT 2006

On Thu, Aug 03, 2006 at 02:43:02PM -0400, Henrik Bechmann wrote:
>    Patrick,
>    >>Try turning $EnableIMSCaching off and see if the $isEditAuthorized
>    appears correctly.
>    Yes that works.
>    [...]
>    But is there some way of
>    determining that the redirect came from a logout, and forcing a refresh?

There's really two ways to do it:  1. We can include some information in the
redirect url, or 2. we can include a session variable that makes things work
properly with EnableIMSCaching.  

The first approach isn't pretty, and doesn't really solve the problem anyway
because it's not just the current page we want to expire from cache but
all of the pages that the browser may have cached.  So, that really argues
for the second approach, and it probably needs to be available for both
login and logout, since both cases will affect the cache.

And it probably belongs in the core somehow.

As a temporary workaround, you could either run with $EnableIMSCaching
disabled, or you could try:

    if ($action == 'logout') @touch("$WorkDir/.lastmod");

This will invalidate the cache on any logout.  Unfortunately, it
does so by invaliding the caches of all browsers, not just the one of
the person who logged out, so it's a bit of an overshoot.

>    Also, for future reference, a side effect of something
>    (include_once('local/config.php')??) is that the author name is being lost
>    between edit states, so the user has to re-enter it all the time -- not
>    true before (I have $EnablePostAuthorRequired = 1;) .

Well, ?action=logout causes the browser to forget the author name.  But 
if you mean the author name is being lost even for someone who remains
logged in, I'm not sure why that would be happening.  You might try
explicitly doing  include_once("$FarmD/scripts/author.php");  .

More later,


More information about the pmwiki-users mailing list