use wcf\data\user\User;
use wcf\system\exception\IllegalLinkException;
+use wcf\system\exception\PermissionDeniedException;
use wcf\system\session\SessionHandler;
use wcf\system\WCF;
*/
abstract class AbstractAuthedPage extends AbstractPage
{
+ /**
+ * If “Force login” is active, this page is faked as available during offline mode
+ * in order to bypass the CheckForForceLogin middleware.
+ */
+ public const AVAILABLE_DURING_OFFLINE_MODE = \FORCE_LOGIN;
+
/**
* @inheritDoc
*/
{
parent::readParameters();
+ if (\OFFLINE) {
+ throw new IllegalLinkException();
+ }
+
// check security token
$this->checkAccessToken();
+
+ if (\FORCE_LOGIN && !WCF::getUser()->userID) {
+ throw new PermissionDeniedException();
+ }
}
/**