@@ -658,7 +658,7 @@ public function checkCache($id, $loading = false)
658
658
* @param bool $loading
659
659
* @return string
660
660
*/
661
- public function getDocumentObjectFromCache ($ id , $ loading = false )
661
+ public function getDocumentObjectFromCache ($ id , $ loading = false )
662
662
{
663
663
$ key = ($ this ->getConfig ('cache_type ' ) == 2 ) ? $ this ->makePageCacheKey ($ id ) : $ id ;
664
664
if ($ loading ) {
@@ -683,37 +683,39 @@ public function getDocumentObjectFromCache($id, $loading = false)
683
683
else {
684
684
$ docObj = unserialize ($ a [0 ]); // rebuild document object
685
685
// check page security
686
- if ($ docObj ['privatemgr ' ] && isset ($ docObj ['__MODxDocGroups__ ' ])) {
687
- $ pass = false ;
688
- $ usrGrps = $ this ->getUserDocGroups ();
689
- $ docGrps = explode (', ' , $ docObj ['__MODxDocGroups__ ' ]);
690
- // check is user has access to doc groups
691
- if (is_array ($ usrGrps )) {
692
- foreach ($ usrGrps as $ k => $ v ) {
693
- if (!in_array ($ v , $ docGrps )) {
694
- continue ;
686
+ if ((!isset ($ _SESSION ['mgrRole ' ]) || $ _SESSION ['mgrRole ' ] != 1 )) {
687
+ if ($ docObj ['privatemgr ' ] && isset ($ docObj ['__MODxDocGroups__ ' ])) {
688
+ $ pass = false ;
689
+ $ usrGrps = $ this ->getUserDocGroups ();
690
+ $ docGrps = explode (', ' , $ docObj ['__MODxDocGroups__ ' ]);
691
+ // check is user has access to doc groups
692
+ if (is_array ($ usrGrps )) {
693
+ foreach ($ usrGrps as $ k => $ v ) {
694
+ if (!in_array ($ v , $ docGrps )) {
695
+ continue ;
696
+ }
697
+ $ pass = true ;
698
+ break ;
695
699
}
696
- $ pass = true ;
697
- break ;
698
- }
699
- }
700
- // diplay error pages if user has no access to cached doc
701
- if (!$ pass ) {
702
- if ($ this ->getConfig ('unauthorized_page ' )) {
703
- // check if file is not public
704
- $ documentGroups = DocumentGroup::where ('document ' , $ id );
705
- $ total = $ documentGroups ->count ();
706
- } else {
707
- $ total = 0 ;
708
700
}
701
+ // diplay error pages if user has no access to cached doc
702
+ if (!$ pass ) {
703
+ if ($ this ->getConfig ('unauthorized_page ' )) {
704
+ // check if file is not public
705
+ $ documentGroups = DocumentGroup::where ('document ' , $ id );
706
+ $ total = $ documentGroups ->count ();
707
+ } else {
708
+ $ total = 0 ;
709
+ }
709
710
710
- if ($ total > 0 ) {
711
- $ this ->sendUnauthorizedPage ();
712
- } else {
713
- $ this ->sendErrorPage ();
714
- }
711
+ if ($ total > 0 ) {
712
+ $ this ->sendUnauthorizedPage ();
713
+ } else {
714
+ $ this ->sendErrorPage ();
715
+ }
715
716
716
- exit ; // stop here
717
+ exit ; // stop here
718
+ }
717
719
}
718
720
}
719
721
// Grab the Scripts
0 commit comments