[TASK] deprecate userAuthGroup:inList
authorBenjamin Mack <benni@typo3.org>
Tue, 18 Oct 2011 12:17:28 +0000 (14:17 +0200)
committerGeorg Ringer <mail@ringerge.org>
Thu, 3 Nov 2011 07:14:25 +0000 (08:14 +0100)
The class userAuthGroup has its own "inList"
functionality that is not really needed,
as there is an optimized version in t3lib_div

Thus, this function should be deprecated and
all occurences would be replaced with the
according calls to t3lib_div::inList.

Change-Id: Ica7566807112589c69d70f311a6ac84da280c0e2
Resolves: #31068
Releases: 4.7
Reviewed-on: http://review.typo3.org/5961
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
Reviewed-by: Oliver Klee
Reviewed-by: Benjamin Mack
Tested-by: Benjamin Mack
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
t3lib/class.t3lib_userauthgroup.php

index a978118..d552388 100644 (file)
@@ -114,7 +114,7 @@ abstract class t3lib_userAuthGroup extends t3lib_userAuth {
        function isMemberOfGroup($groupId) {
                $groupId = intval($groupId);
                if ($this->groupList && $groupId) {
-                       return $this->inList($this->groupList, $groupId);
+                       return t3lib_div::inList($this->groupList, $groupId);
                }
        }
 
@@ -355,7 +355,7 @@ abstract class t3lib_userAuthGroup extends t3lib_userAuth {
         */
        function check($type, $value) {
                if (isset($this->groupData[$type])) {
-                       if ($this->isAdmin() || $this->inList($this->groupData[$type], $value)) {
+                       if ($this->isAdmin() || t3lib_div::inList($this->groupData[$type], $value)) {
                                return TRUE;
                        }
                }
@@ -395,12 +395,12 @@ abstract class t3lib_userAuthGroup extends t3lib_userAuth {
                        // Checking value:
                switch ((string) $authMode) {
                        case 'explicitAllow':
-                               if (!$this->inList($this->groupData['explicit_allowdeny'], $testValue . ':ALLOW')) {
+                               if (!t3lib_div::inList($this->groupData['explicit_allowdeny'], $testValue . ':ALLOW')) {
                                        $out = FALSE;
                                }
                        break;
                        case 'explicitDeny':
-                               if ($this->inList($this->groupData['explicit_allowdeny'], $testValue . ':DENY')) {
+                               if (t3lib_div::inList($this->groupData['explicit_allowdeny'], $testValue . ':DENY')) {
                                        $out = FALSE;
                                }
                        break;
@@ -413,12 +413,12 @@ abstract class t3lib_userAuthGroup extends t3lib_userAuth {
                                                        if (!strcmp($iCfg[1], $value) && $iCfg[4]) {
                                                                switch ((string) $iCfg[4]) {
                                                                        case 'EXPL_ALLOW':
-                                                                               if (!$this->inList($this->groupData['explicit_allowdeny'], $testValue . ':ALLOW')) {
+                                                                               if (!t3lib_div::inList($this->groupData['explicit_allowdeny'], $testValue . ':ALLOW')) {
                                                                                        $out = FALSE;
                                                                                }
                                                                        break;
                                                                        case 'EXPL_DENY':
-                                                                               if ($this->inList($this->groupData['explicit_allowdeny'], $testValue . ':DENY')) {
+                                                                               if (t3lib_div::inList($this->groupData['explicit_allowdeny'], $testValue . ':DENY')) {
                                                                                        $out = FALSE;
                                                                                }
                                                                        break;
@@ -1035,9 +1035,11 @@ abstract class t3lib_userAuthGroup extends t3lib_userAuth {
         * @param       string          Comma list with items, no spaces between items!
         * @param       string          The string to find in the list of items
         * @return      string          Boolean
+        * @deprecated since TYPO3 4.7, should be removed in TYPO3 4.9, use equivalent function t3lib_div::inList()
         */
        function inList($in_list, $item) {
-               return strstr(',' . $in_list . ',', ',' . $item . ',');
+               t3lib_div::logDeprecatedFunction();
+               return t3lib_div::inList($in_list, $item);
        }
 
        /**