@@ -220,7 +220,7 @@ public function __construct()
220
220
public function initialize ()
221
221
{
222
222
223
- if ($ this ->isLoggedIn ()) {
223
+ if ($ this ->isLoggedIn (' mgr ' )) {
224
224
ini_set ('display_errors ' , 1 );
225
225
}
226
226
// events
@@ -556,13 +556,18 @@ public function getDocumentIdentifier($method)
556
556
/**
557
557
* Check for manager or webuser login session since v1.2
558
558
*
559
- * @param string $context
559
+ * @param string $context 'mgr' or 'web'
560
560
* @return bool
561
561
*/
562
- public function isLoggedIn ($ context = 'mgr ' )
562
+ public function isLoggedIn (string $ context = '' ): bool
563
563
{
564
- $ _ = 'mgrValidated ' ;
564
+ if (empty ($ context )) {
565
+ $ mgr = 'mgrValidated ' ;
566
+ $ web = 'webValidated ' ;
567
+ return is_cli () || (isset ($ _SESSION [$ mgr ]) && !empty ($ _SESSION [$ mgr ])) || (isset ($ _SESSION [$ web ]) && !empty ($ _SESSION [$ web ]));
568
+ }
565
569
570
+ $ _ = $ context .'Validated ' ;
566
571
return is_cli () || (isset ($ _SESSION [$ _ ]) && !empty ($ _SESSION [$ _ ]));
567
572
}
568
573
@@ -597,7 +602,7 @@ public function checkSiteStatus()
597
602
return true ;
598
603
}
599
604
600
- if ($ this ->isLoggedin ()) {
605
+ if ($ this ->isLoggedin (' mgr ' )) {
601
606
return true ;
602
607
} // site online
603
608
// site offline but launched via the manager
@@ -2874,7 +2879,7 @@ public function prepareResponse()
2874
2879
{
2875
2880
// we now know the method and identifier, let's check the cache
2876
2881
2877
- if ($ this ->getConfig ('enable_cache ' ) == 2 && $ this ->isLoggedIn ()) {
2882
+ if ($ this ->getConfig ('enable_cache ' ) == 2 && $ this ->isLoggedIn (' mgr ' )) {
2878
2883
$ this ->setConfig ('enable_cache ' , 0 );
2879
2884
}
2880
2885
0 commit comments