[pmwiki-users] Working solution for CMS style interface with IMS caching

Henrik Bechmann henrik at bechmannsoftware.com
Sat Aug 12 00:37:13 CDT 2006


This is to confirm that I find the behaviour of login/logout is exactly 
the same (in farmconfig.php) with

include_once('local/config.php'); # required in farmconfig.php to initialize
$pagename = ResolvePageName($pagename);
$isEditAuthorized = CondAuth($pagename, 'edit');

instead of

$pagename = ResolvePageName($pagename);
$isEditAuthorized = (boolean)RetrieveAuthPage($pagename, 'edit', false, 

and without

$HandleActions['logout'] = 'CacheLogoutHandler';
function CacheLogoutHandler($pagename, $auth = 'read') {
 global $EnableIMSCaching;
 $EnableIMSCaching = 0;
 HandleLogoutA($pagename, $auth); # call the legit handler

(That is to say IE responds to login/logout with immediate fetch of 
revised page layouts; FF requires a Shift/Refresh-button after 
login/logout to effect the fetch.)

Good. Simpler.

It would be *very* nice if you could find a way to solve this FF 
problem, as you have indicated!

Thanks as always for your attentiveness.


- Henrik

Henrik Bechmann
Webmaster, www.dufferinpark.ca

Patrick R. Michaud wrote:
> On Sun, Aug 06, 2006 at 06:08:08PM -0400, Henrik Bechmann wrote:
>> Patrick,
>> I have implemented a working solution for differentiation of page layout 
>> based on native PmWiki password protection state, in the presence of IMS 
>> caching, as follows:
>> In my farmconfig.php I have:
>> $HandleActions['logout'] = 'CacheLogoutHandler';
>> function CacheLogoutHandler($pagename, $auth = 'read') {
>> global $EnableIMSCaching;
>> $EnableIMSCaching = 0;
>> HandleLogoutA($pagename, $auth); # call the legit handler
>> }
> I don't think this function really does anything, because
> $EnableIMSCaching only has an effect for the actions given
> by $CacheActions (which defaults to 'browse', 'diff', and 'print').
> So, ?action=logout *already* acts as if $EnableIMSCaching is set to zero,
> even without the above function.
>> include_once('local/config.php');
>> $pagename = ResolvePageName($pagename);
>> $isEditAuthorized = (boolean)RetrieveAuthPage($pagename, 'edit', false, 
> Having looked at the pmwiki code a bit more, it occurs to me
> that a far better way to get $isEditAuthorized is to use 
> PmWiki's built-in function for it (which I had forgotten about):
>     $pagename = ResolvePageName($pagename);
>     $isEditAuthorized = CondAuth($pagename, 'edit');
> I'd also like to go through the pmwiki.org pages and replace
> any recommendations we've made to use RetrieveAuthPage() to
> instead use CondAuth (which is more robust).
>> All of this works as expected in Internet Explorer. The Firefox cache is 
>> not as responsive however, and requires special procedures. Also, it 
>> turns out that PmWiki deletes the Author Name cookie with the logout 
>> operation (which I do not think is desirable in most situations).
> I'll answer the author name cookie issue in my next message.
> However, for now I'll just note that as currently written, IMS
> caching simply won't work with login/logout, but I'll fix that
> for 2.1.13.  This should eliminate the need to put any special
> notices for authors, or require authors to manually refresh
> pages.
> Thanks,
> Pm

More information about the pmwiki-users mailing list