[TASK] Streamline expressionLanguage usage in core
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Configuration / TypoScript / ConditionMatching / AbstractConditionMatcher.php
1 <?php
2 namespace TYPO3\CMS\Core\Configuration\TypoScript\ConditionMatching;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 use Psr\Log\LoggerAwareInterface;
18 use Psr\Log\LoggerAwareTrait;
19 use Symfony\Component\ExpressionLanguage\SyntaxError;
20 use TYPO3\CMS\Core\Configuration\Features;
21 use TYPO3\CMS\Core\Configuration\TypoScript\Exception\InvalidTypoScriptConditionException;
22 use TYPO3\CMS\Core\Error\Exception;
23 use TYPO3\CMS\Core\ExpressionLanguage\Resolver;
24 use TYPO3\CMS\Core\Log\LogLevel;
25 use TYPO3\CMS\Core\Utility\GeneralUtility;
26 use TYPO3\CMS\Core\Utility\StringUtility;
27 use TYPO3\CMS\Core\Utility\VersionNumberUtility;
28
29 /**
30 * Matching TypoScript conditions
31 *
32 * Used with the TypoScript parser.
33 * Matches IPnumbers etc. for use with templates
34 */
35 abstract class AbstractConditionMatcher implements LoggerAwareInterface
36 {
37 use LoggerAwareTrait;
38
39 /**
40 * Id of the current page.
41 *
42 * @var int
43 */
44 protected $pageId;
45
46 /**
47 * The rootline for the current page.
48 *
49 * @var array
50 */
51 protected $rootline;
52
53 /**
54 * Whether to simulate the behaviour and match all conditions
55 * (used in TypoScript object browser).
56 *
57 * @var bool
58 */
59 protected $simulateMatchResult = false;
60
61 /**
62 * Whether to simulat the behaviour and match specific conditions
63 * (used in TypoScript object browser).
64 *
65 * @var array
66 */
67 protected $simulateMatchConditions = [];
68
69 /**
70 * @var Resolver
71 */
72 protected $expressionLanguageResolver;
73
74 /**
75 * @return bool
76 */
77 protected function strictSyntaxEnabled(): bool
78 {
79 return GeneralUtility::makeInstance(Features::class)->isFeatureEnabled('TypoScript.strictSyntax');
80 }
81
82 /**
83 * Sets the id of the page to evaluate conditions for.
84 *
85 * @param int $pageId Id of the page (must be positive)
86 */
87 public function setPageId($pageId)
88 {
89 if (is_int($pageId) && $pageId > 0) {
90 $this->pageId = $pageId;
91 }
92 }
93
94 /**
95 * Gets the id of the page to evaluate conditions for.
96 *
97 * @return int Id of the page
98 */
99 public function getPageId()
100 {
101 return $this->pageId;
102 }
103
104 /**
105 * Sets the rootline.
106 *
107 * @param array $rootline The rootline to be used for matching (must have elements)
108 */
109 public function setRootline(array $rootline)
110 {
111 if (!empty($rootline)) {
112 $this->rootline = $rootline;
113 }
114 }
115
116 /**
117 * Gets the rootline.
118 *
119 * @return array The rootline to be used for matching
120 */
121 public function getRootline()
122 {
123 return $this->rootline;
124 }
125
126 /**
127 * Sets whether to simulate the behaviour and match all conditions.
128 *
129 * @param bool $simulateMatchResult Whether to simulate positive matches
130 */
131 public function setSimulateMatchResult($simulateMatchResult)
132 {
133 if (is_bool($simulateMatchResult)) {
134 $this->simulateMatchResult = $simulateMatchResult;
135 }
136 }
137
138 /**
139 * Sets whether to simulate the behaviour and match specific conditions.
140 *
141 * @param array $simulateMatchConditions Conditions to simulate a match for
142 */
143 public function setSimulateMatchConditions(array $simulateMatchConditions)
144 {
145 $this->simulateMatchConditions = $simulateMatchConditions;
146 }
147
148 /**
149 * Normalizes an expression and removes the first and last square bracket.
150 * + OR normalization: "...]OR[...", "...]||[...", "...][..." --> "...]||[..."
151 * + AND normalization: "...]AND[...", "...]&&[..." --> "...]&&[..."
152 *
153 * @param string $expression The expression to be normalized (e.g. "[A] && [B] OR [C]")
154 * @return string The normalized expression (e.g. "[A]&&[B]||[C]")
155 * @deprecated since TYPO3 v9.4, will be removed in TYPO3 v10.0.
156 */
157 protected function normalizeExpression($expression)
158 {
159 $normalizedExpression = preg_replace([
160 '/\\]\\s*(OR|\\|\\|)?\\s*\\[/i',
161 '/\\]\\s*(AND|&&)\\s*\\[/i'
162 ], [
163 ']||[',
164 ']&&['
165 ], trim($expression));
166 return $normalizedExpression;
167 }
168
169 /**
170 * Matches a TypoScript condition expression.
171 *
172 * @param string $expression The expression to match
173 * @return bool Whether the expression matched
174 */
175 public function match($expression)
176 {
177 // Return directly if result should be simulated:
178 if ($this->simulateMatchResult) {
179 return $this->simulateMatchResult;
180 }
181 // Return directly if matching for specific condition is simulated only:
182 if (!empty($this->simulateMatchConditions)) {
183 return in_array($expression, $this->simulateMatchConditions);
184 }
185 // Sets the current pageId if not defined yet:
186 if (!isset($this->pageId)) {
187 $this->pageId = $this->determinePageId();
188 }
189 // Sets the rootline if not defined yet:
190 if (!isset($this->rootline)) {
191 $this->rootline = $this->determineRootline();
192 }
193 $result = false;
194 $normalizedExpression = $this->normalizeExpression($expression);
195 // First and last character must be square brackets (e.g. "[A]&&[B]":
196 if ($normalizedExpression[0] === '[' && substr($normalizedExpression, -1) === ']') {
197 $innerExpression = substr($normalizedExpression, 1, -1);
198 $orParts = explode(']||[', $innerExpression);
199 if ($this->strictSyntaxEnabled() && count($orParts) > 1) {
200 trigger_error('Multiple conditions blocks combined with AND, OR, && or || have been deprecated and will be removed in TYPO3 CMS 10, use the new expression language.', E_USER_DEPRECATED);
201 }
202 foreach ($orParts as $orPart) {
203 $andParts = explode(']&&[', $orPart);
204 if ($this->strictSyntaxEnabled() && count($andParts) > 1) {
205 trigger_error('Multiple conditions blocks combined with AND, OR, && or || have been deprecated and will be removed in TYPO3 CMS 10, use the new expression language.', E_USER_DEPRECATED);
206 }
207 foreach ($andParts as $andPart) {
208 $result = $this->evaluateExpression($andPart);
209 if (!is_bool($result)) {
210 $result = $this->evaluateCondition($andPart);
211 }
212 // If condition in AND context fails, the whole block is FALSE:
213 if ($result === false) {
214 break;
215 }
216 }
217 // If condition in OR context succeeds, the whole expression is TRUE:
218 if ($result === true) {
219 break;
220 }
221 }
222 }
223 return $result;
224 }
225
226 /**
227 * @param string $expression
228 * @return bool|null
229 */
230 protected function evaluateExpression(string $expression): ?bool
231 {
232 try {
233 $result = $this->expressionLanguageResolver->evaluate($expression);
234 if ($result !== null) {
235 return $result;
236 }
237 } catch (SyntaxError $exception) {
238 // SyntaxException means no support, let's try the fallback
239 $message = 'Expression could not be parsed, fallback kicks in.';
240 if (strpos($exception->getMessage(), 'Unexpected character "="') !== false) {
241 $message .= ' It looks like an old condition with only one equal sign.';
242 }
243 $this->logger->log(
244 $this->strictSyntaxEnabled() ? LogLevel::WARNING : LogLevel::INFO,
245 $message,
246 ['expression' => $expression]
247 );
248 } catch (\Throwable $exception) {
249 // The following error handling is required to mitigate a missing type check
250 // in the Symfony Expression Language handling. In case a condition
251 // use "in" or "not in" check in combination with a non array a PHP Warning
252 // is thrown. Example: [1 in "foo"] or ["bar" in "foo,baz"]
253 // This conditions are wrong for sure, but they will break the complete installation
254 // including the backend. To mitigate the problem we do the following:
255 // 1) In FE an InvalidTypoScriptConditionException is thrown (if strictSyntax is enabled)
256 // 2) In FE silent catch this error and log it (if strictSyntax is disabled)
257 // 3) In BE silent catch this error and log it, but never break the backend.
258 $this->logger->error($exception->getMessage(), [
259 'expression' => $expression,
260 'exception' => $exception
261 ]);
262 if (TYPO3_MODE === 'FE'
263 && $exception instanceof Exception
264 && $this->strictSyntaxEnabled()
265 && strpos($exception->getMessage(), 'in_array() expects parameter 2 to be array') !== false
266 ) {
267 throw new InvalidTypoScriptConditionException('Invalid expression in condition: [' . $expression . ']', 1536950931);
268 }
269 }
270 return null;
271 }
272
273 /**
274 * Evaluates a TypoScript condition given as input, eg. "[applicationContext = Production][...(other condition)...]"
275 *
276 * @param string $key The condition to match against its criteria.
277 * @param string $value
278 * @return bool|null Result of the evaluation; NULL if condition could not be evaluated
279 * @deprecated since TYPO3 v9.4, will be removed in TYPO3 v10.0.
280 */
281 protected function evaluateConditionCommon($key, $value)
282 {
283 $keyParts = GeneralUtility::trimExplode('|', $key);
284 switch ($keyParts[0]) {
285 case 'applicationContext':
286 $values = GeneralUtility::trimExplode(',', $value, true);
287 $currentApplicationContext = GeneralUtility::getApplicationContext();
288 foreach ($values as $applicationContext) {
289 if ($this->searchStringWildcard($currentApplicationContext, $applicationContext)) {
290 return true;
291 }
292 }
293 return false;
294 case 'language':
295 if (GeneralUtility::getIndpEnv('HTTP_ACCEPT_LANGUAGE') === $value) {
296 return true;
297 }
298 $values = GeneralUtility::trimExplode(',', $value, true);
299 foreach ($values as $test) {
300 // matches a string with asterix in front and back. See https://docs.typo3.org/typo3cms/TyposcriptReference/Conditions/Reference.html#language for use case.
301 if (preg_match('/^\\*.+\\*$/', $test)) {
302 $allLanguages = preg_split('/[,;]/', GeneralUtility::getIndpEnv('HTTP_ACCEPT_LANGUAGE'));
303 if (in_array(substr($test, 1, -1), $allLanguages)) {
304 return true;
305 }
306 } elseif (GeneralUtility::getIndpEnv('HTTP_ACCEPT_LANGUAGE') == $test) {
307 return true;
308 }
309 }
310 return false;
311 case 'IP':
312 if ($value === 'devIP') {
313 $value = trim($GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask']);
314 }
315
316 return (bool)GeneralUtility::cmpIP(GeneralUtility::getIndpEnv('REMOTE_ADDR'), $value);
317 case 'hostname':
318 return (bool)GeneralUtility::cmpFQDN(GeneralUtility::getIndpEnv('REMOTE_ADDR'), $value);
319 case 'hour':
320 case 'minute':
321 case 'month':
322 case 'year':
323 case 'dayofweek':
324 case 'dayofmonth':
325 case 'dayofyear':
326 // In order to simulate time properly in templates.
327 $theEvalTime = $GLOBALS['SIM_EXEC_TIME'];
328 switch ($key) {
329 case 'hour':
330 $theTestValue = date('H', $theEvalTime);
331 break;
332 case 'minute':
333 $theTestValue = date('i', $theEvalTime);
334 break;
335 case 'month':
336 $theTestValue = date('m', $theEvalTime);
337 break;
338 case 'year':
339 $theTestValue = date('Y', $theEvalTime);
340 break;
341 case 'dayofweek':
342 $theTestValue = date('w', $theEvalTime);
343 break;
344 case 'dayofmonth':
345 $theTestValue = date('d', $theEvalTime);
346 break;
347 case 'dayofyear':
348 $theTestValue = date('z', $theEvalTime);
349 break;
350 default:
351 $theTestValue = 0;
352 break;
353 }
354 $theTestValue = (int)$theTestValue;
355 // comp
356 $values = GeneralUtility::trimExplode(',', $value, true);
357 foreach ($values as $test) {
358 if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($test)) {
359 $test = '=' . $test;
360 }
361 if ($this->compareNumber($test, $theTestValue)) {
362 return true;
363 }
364 }
365 return false;
366 case 'compatVersion':
367 return VersionNumberUtility::convertVersionNumberToInteger(TYPO3_branch) >= VersionNumberUtility::convertVersionNumberToInteger($value);
368 case 'loginUser':
369 if ($this->isUserLoggedIn()) {
370 $values = GeneralUtility::trimExplode(',', $value, true);
371 foreach ($values as $test) {
372 if ($test === '*' || (string)$this->getUserId() === (string)$test) {
373 return true;
374 }
375 }
376 } elseif ($value === '') {
377 return true;
378 }
379 return false;
380 case 'page':
381 if ($keyParts[1]) {
382 $page = $this->getPage();
383 $property = $keyParts[1];
384 if (!empty($page) && isset($page[$property]) && (string)$page[$property] === (string)$value) {
385 return true;
386 }
387 }
388 return false;
389 case 'globalVar':
390 $values = GeneralUtility::trimExplode(',', $value, true);
391 foreach ($values as $test) {
392 $point = strcspn($test, '!=<>');
393 $theVarName = substr($test, 0, $point);
394 $nv = $this->getVariable(trim($theVarName));
395 $testValue = substr($test, $point);
396 if ($this->compareNumber($testValue, $nv)) {
397 return true;
398 }
399 }
400 return false;
401 case 'globalString':
402 $values = GeneralUtility::trimExplode(',', $value, true);
403 foreach ($values as $test) {
404 $point = strcspn($test, '=');
405 $theVarName = substr($test, 0, $point);
406 $nv = (string)$this->getVariable(trim($theVarName));
407 $testValue = substr($test, $point + 1);
408 if ($this->searchStringWildcard($nv, trim($testValue))) {
409 return true;
410 }
411 }
412 return false;
413 case 'userFunc':
414 $matches = [];
415 preg_match_all('/^\s*([^\(\s]+)\s*(?:\((.*)\))?\s*$/', $value, $matches);
416 $funcName = $matches[1][0];
417 $funcValues = trim($matches[2][0]) !== '' ? $this->parseUserFuncArguments($matches[2][0]) : [];
418 if (is_callable($funcName) && call_user_func_array($funcName, $funcValues)) {
419 return true;
420 }
421 return false;
422 }
423 return null;
424 }
425
426 /**
427 * Evaluates a TypoScript condition given as input with a custom class name,
428 * e.g. "[MyCompany\MyPackage\ConditionMatcher\MyOwnConditionMatcher = myvalue]"
429 *
430 * @param string $condition The condition to match
431 * @return bool|null Result of the evaluation; NULL if condition could not be evaluated
432 * @throws \TYPO3\CMS\Core\Configuration\TypoScript\Exception\InvalidTypoScriptConditionException
433 * @deprecated since TYPO3 v9.4, will be removed in TYPO3 v10.0.
434 */
435 protected function evaluateCustomDefinedCondition($condition)
436 {
437 $conditionResult = null;
438
439 list($conditionClassName, $conditionParameters) = GeneralUtility::trimExplode(' ', $condition, false, 2);
440
441 // Check if the condition class name is a valid class
442 // This is necessary to not stop here for the conditions ELSE and GLOBAL
443 if (class_exists($conditionClassName)) {
444 // Use like this: [MyCompany\MyPackage\ConditionMatcher\MyOwnConditionMatcher = myvalue]
445 /** @var \TYPO3\CMS\Core\Configuration\TypoScript\ConditionMatching\AbstractCondition $conditionObject */
446 $conditionObject = GeneralUtility::makeInstance($conditionClassName);
447 if (($conditionObject instanceof \TYPO3\CMS\Core\Configuration\TypoScript\ConditionMatching\AbstractCondition) === false) {
448 throw new \TYPO3\CMS\Core\Configuration\TypoScript\Exception\InvalidTypoScriptConditionException(
449 '"' . $conditionClassName . '" is not a valid TypoScript Condition object.',
450 1410286153
451 );
452 }
453
454 $conditionParameters = $this->parseUserFuncArguments($conditionParameters);
455 $conditionObject->setConditionMatcherInstance($this);
456 $conditionResult = $conditionObject->matchCondition($conditionParameters);
457 }
458
459 return $conditionResult;
460 }
461
462 /**
463 * Parses arguments to the userFunc.
464 *
465 * @param string $arguments
466 * @return array
467 * @deprecated since TYPO3 v9.4, will be removed in TYPO3 v10.0.
468 */
469 protected function parseUserFuncArguments($arguments)
470 {
471 $result = [];
472 $arguments = trim($arguments);
473 while ($arguments !== '') {
474 if ($arguments[0] === ',') {
475 $result[] = '';
476 $arguments = substr($arguments, 1);
477 } else {
478 $pos = strcspn($arguments, ',\'"');
479 if ($pos == 0) {
480 // We hit a quote of some kind
481 $quote = $arguments[0];
482 $segment = preg_replace('/^(.*?[^\\\])' . $quote . '.*$/', '\1', substr($arguments, 1));
483 $segment = str_replace('\\' . $quote, $quote, $segment);
484 $result[] = $segment;
485 // shorten $arguments
486 $arguments = substr($arguments, strlen($segment) + 2);
487 $offset = strpos($arguments, ',');
488 if ($offset === false) {
489 $offset = strlen($arguments);
490 }
491 $arguments = substr($arguments, $offset + 1);
492 } else {
493 $result[] = trim(substr($arguments, 0, $pos));
494 $arguments = substr($arguments, $pos + 1);
495 }
496 }
497 $arguments = trim($arguments);
498 }
499 return $result;
500 }
501
502 /**
503 * Get variable common
504 *
505 * @param array $vars
506 * @return mixed Whatever value. If none, then NULL.
507 * @deprecated since TYPO3 v9.4, will be removed in TYPO3 v10.0.
508 */
509 protected function getVariableCommon(array $vars)
510 {
511 $value = null;
512 $namespace = trim($vars[0]);
513 if (count($vars) === 1) {
514 $value = $this->getGlobal($vars[0]);
515 } elseif ($namespace === 'LIT') {
516 $value = trim($vars[1]);
517 } else {
518 $splitAgain = explode('|', $vars[1], 2);
519 $k = trim($splitAgain[0]);
520 if ($k) {
521 switch ($namespace) {
522 case 'GP':
523 $value = GeneralUtility::_GP($k);
524 break;
525 case 'GPmerged':
526 $value = GeneralUtility::_GPmerged($k);
527 break;
528 case 'ENV':
529 $value = getenv($k);
530 break;
531 case 'IENV':
532 $value = GeneralUtility::getIndpEnv($k);
533 break;
534 default:
535 return null;
536 }
537 // If array:
538 if (count($splitAgain) > 1) {
539 if (is_array($value) && trim($splitAgain[1]) !== '') {
540 $value = $this->getGlobal($splitAgain[1], $value);
541 } else {
542 $value = '';
543 }
544 }
545 }
546 }
547 return $value;
548 }
549
550 /**
551 * Evaluates a $leftValue based on an operator: "<", ">", "<=", ">=", "!=" or "="
552 *
553 * @param string $test The value to compare with on the form [operator][number]. Eg. "< 123
554 * @param float $leftValue The value on the left side
555 * @return bool If $value is "50" and $test is "< 123" then it will return TRUE.
556 * @deprecated since TYPO3 v9.4, will be removed in TYPO3 v10.0.
557 */
558 protected function compareNumber($test, $leftValue)
559 {
560 if (preg_match('/^(!?=+|<=?|>=?)\\s*([^\\s]*)\\s*$/', $test, $matches)) {
561 $operator = $matches[1];
562 $rightValue = $matches[2];
563 switch ($operator) {
564 case '>=':
565 return $leftValue >= (float)$rightValue;
566 break;
567 case '<=':
568 return $leftValue <= (float)$rightValue;
569 break;
570 case '!=':
571 // multiple values may be split with '|'
572 // see if none matches ("not in list")
573 $found = false;
574 $rightValueParts = GeneralUtility::trimExplode('|', $rightValue);
575 foreach ($rightValueParts as $rightValueSingle) {
576 if ($leftValue == (float)$rightValueSingle) {
577 $found = true;
578 break;
579 }
580 }
581 return $found === false;
582 break;
583 case '<':
584 return $leftValue < (float)$rightValue;
585 break;
586 case '>':
587 return $leftValue > (float)$rightValue;
588 break;
589 default:
590 // nothing valid found except '=', use '='
591 // multiple values may be split with '|'
592 // see if one matches ("in list")
593 $found = false;
594 $rightValueParts = GeneralUtility::trimExplode('|', $rightValue);
595 foreach ($rightValueParts as $rightValueSingle) {
596 if ($leftValue == $rightValueSingle) {
597 $found = true;
598 break;
599 }
600 }
601 return $found;
602 }
603 }
604 return false;
605 }
606
607 /**
608 * Matching two strings against each other, supporting a "*" wildcard or (if wrapped in "/") PCRE regular expressions
609 *
610 * @param string $haystack The string in which to find $needle.
611 * @param string $needle The string to find in $haystack
612 * @return bool Returns TRUE if $needle matches or is found in (according to wildcards) in $haystack. Eg. if $haystack is "Netscape 6.5" and $needle is "Net*" or "Net*ape" then it returns TRUE.
613 * @deprecated since TYPO3 v9.4, will be removed in TYPO3 v10.0.
614 */
615 protected function searchStringWildcard($haystack, $needle)
616 {
617 return StringUtility::searchStringWildcard($haystack, $needle);
618 }
619
620 /**
621 * Return global variable where the input string $var defines array keys separated by "|"
622 * Example: $var = "HTTP_SERVER_VARS | something" will return the value $GLOBALS['HTTP_SERVER_VARS']['something'] value
623 *
624 * @param string $var Global var key, eg. "HTTP_GET_VAR" or "HTTP_GET_VARS|id" to get the GET parameter "id" back.
625 * @param array $source Alternative array than $GLOBAL to get variables from.
626 * @return mixed Whatever value. If none, then blank string.
627 * @deprecated since TYPO3 v9.4, will be removed in TYPO3 v10.0.
628 */
629 protected function getGlobal($var, $source = null)
630 {
631 $vars = explode('|', $var);
632 $c = count($vars);
633 $k = trim($vars[0]);
634 $theVar = isset($source) ? ($source[$k] ?? null) : ($GLOBALS[$k] ?? null);
635 for ($a = 1; $a < $c; $a++) {
636 if (!isset($theVar)) {
637 break;
638 }
639 $key = trim($vars[$a]);
640 if (is_object($theVar)) {
641 $theVar = $theVar->{$key};
642 } elseif (is_array($theVar)) {
643 $theVar = $theVar[$key];
644 } else {
645 return '';
646 }
647 }
648 if (!is_array($theVar) && !is_object($theVar)) {
649 return $theVar;
650 }
651 return '';
652 }
653
654 /**
655 * Evaluates a TypoScript condition given as input, eg. "[browser=net][...(other conditions)...]"
656 *
657 * @param string $string The condition to match against its criteria.
658 * @return bool Whether the condition matched
659 * @see \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser::parse()
660 * @deprecated since TYPO3 v9.4, will be removed in TYPO3 v10.0.
661 */
662 abstract protected function evaluateCondition($string);
663
664 /**
665 * Gets the value of a variable.
666 *
667 * Examples of names:
668 * + TSFE:id
669 * + GP:firstLevel|secondLevel
670 * + _GET|firstLevel|secondLevel
671 * + LIT:someLiteralValue
672 *
673 * @param string $name The name of the variable to fetch the value from
674 * @return mixed The value of the given variable (string) or NULL if variable did not exist
675 * @deprecated since TYPO3 v9.4, will be removed in TYPO3 v10.0.
676 */
677 abstract protected function getVariable($name);
678
679 /**
680 * Gets the usergroup list of the current user.
681 *
682 * @return string The usergroup list of the current user
683 * @deprecated since TYPO3 v9.4, will be removed in TYPO3 v10.0.
684 */
685 abstract protected function getGroupList();
686
687 /**
688 * Determines the current page Id.
689 *
690 * @return int The current page Id
691 * @deprecated since TYPO3 v9.4, will be removed in TYPO3 v10.0.
692 */
693 abstract protected function determinePageId();
694
695 /**
696 * Gets the properties for the current page.
697 *
698 * @return array The properties for the current page.
699 * @deprecated since TYPO3 v9.4, will be removed in TYPO3 v10.0.
700 */
701 abstract protected function getPage();
702
703 /**
704 * Determines the rootline for the current page.
705 *
706 * @return array The rootline for the current page.
707 * @deprecated since TYPO3 v9.4, will be removed in TYPO3 v10.0.
708 */
709 abstract protected function determineRootline();
710
711 /**
712 * Gets the id of the current user.
713 *
714 * @return int The id of the current user
715 * @deprecated since TYPO3 v9.4, will be removed in TYPO3 v10.0.
716 */
717 abstract protected function getUserId();
718
719 /**
720 * Determines if a user is logged in.
721 *
722 * @return bool Determines if a user is logged in
723 * @deprecated since TYPO3 v9.4, will be removed in TYPO3 v10.0.
724 */
725 abstract protected function isUserLoggedIn();
726 }