hello
using full cache-capabilities( e.g for Wayfinder) and webusers/webdocumentgroups at the same time is not possible.
- home(1) default
- only for customer(2) - docgroup(1)
- page
- page
- only for supplier(3) - docgroup(2)
- page
- page
1. A not logged in user create the "home" - cache-file, the nodes for 2 and 3 are not visible in the navigation.
2. Now a supplier log in, but the "only for supplier" node is still invisible btw. not shown by the cached wayfinder/cache-file.
3. clear cache and supplier refresh, the node is appear and the cache-file is written to the cache.
4. supplier log out and the node "only for supplier" is still visible for all users.
5. Now a customer log in and the node "only for customer" is not visible, the user see the "only for supplier" node instead.
The reason is the nameing of the cache-file "docid_1.pageCache.php". There is no discriminability concerning the user-rights.
A solution could be to create a "cache_id" which include the documentgroups on which the user have access eg. "docid_[docid]_[dgid].pageCache.php
Example:
1. All no logged in user read and write the default cache-file "docid_1.pageCache.php"
2. A user with rights for viewing docgroup 1 read and write the cache-file "docid_1_1.pageCache.php"
3. A user with rights for viewing docgroup 2 read and write the file "docid_1_2.pageCache.php"
4. A user with rights for viewing both, docgrp 1 and docgrp 2 read and write "docid_1_1_2.pageCache.php"
if iam right, the implementation is easy(at least as a quick hack)
to check it out... and please, do it, change the document.parser by this way
1. create a new function
function getCacheId()
{
if( $this->isFrontend()
&& isset( $_SESSION['webDocgroups'] )
&& isset( $_SESSION['webValidated'] ) )
{
sort( $_SESSION['webDocgroups'], SORT_NUMERIC );
return '_' . implode('_', $_SESSION['webDocgroups'] );
//$cache_id = '_' . implode('_', $_SESSION['webDocgroups'] );
//$this->cache_id = $cache_id
//return null;
}
return null;
}
change the checkCache function to get the file
function checkCache($id) {
// cache_id
// $this->cache_id;
$cache_id = $id . $this->getCacheId();
// new filename
$cacheFile= "assets/cache/docid_" . $cache_id . ".pageCache.php";
// $cacheFile= "assets/cache/docid_" . $id . ".pageCache.php";
change postProcess to write the file
$cache_id = $this->documentIdentifier . $this->getCacheId();
//if ($fp= @ fopen($basepath . "/docid_" . $this->documentIdentifier . ".pageCache.php", "w")) {
// $this->cache_id
if ($fp= @ fopen($basepath . "/docid_" . $cache_id . ".pageCache.php", "w")) {
Three small changes could be a huge improvement. The behavior of the cache is not disturbed by this changes
ciao, Stefan