[FEATURE] Add devIP as keyword for IP condition 54/24754/5
authorIngo Renner <ingo@typo3.org>
Mon, 14 Oct 2013 21:41:12 +0000 (14:41 -0700)
committerOliver Hader <oliver.hader@typo3.org>
Tue, 15 Oct 2013 15:58:03 +0000 (17:58 +0200)
When using an IP condition, support using keyword "devIP" to compare
the current Request IP against the devIpMask setting.

Usage:
[IP = devIP]
page.20 = TEXT
page.20.value = Hello Developer!
[end]

Fixes: #50092
Documentation: #52827
Releases: 6.2
Change-Id: I6b9128a9ac23b8d24ec1874dbe477503b20b58b8
Reviewed-on: https://review.typo3.org/24754
Reviewed-by: Ernesto Baschny
Reviewed-by: Gaëtan MARMASSE
Tested-by: Gaëtan MARMASSE
Reviewed-by: Paul Rohrbeck
Tested-by: Paul Rohrbeck
Reviewed-by: Dmitry Dulepov
Tested-by: Dmitry Dulepov
Reviewed-by: Oliver Hader
typo3/sysext/core/Classes/Configuration/TypoScript/ConditionMatching/AbstractConditionMatcher.php

index 32f0a4c..425b485 100644 (file)
@@ -305,6 +305,10 @@ abstract class AbstractConditionMatcher {
                                }
                                break;
                        case 'IP':
+                               if ($value === 'devIP') {
+                                       $value = trim($GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask']);
+                               }
+
                                if (GeneralUtility::cmpIP(GeneralUtility::getIndpEnv('REMOTE_ADDR'), $value)) {
                                        return TRUE;
                                }