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