[TASK] Cleanup BackendUserAuthentication->unpack_uc() 95/50595/3
authorBenni Mack <benni@typo3.org>
Fri, 11 Nov 2016 14:25:18 +0000 (15:25 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Sat, 12 Nov 2016 14:49:31 +0000 (15:49 +0100)
The backendUser->uc() call is called with a default value,
which is unnecessary and "looks ugly" ;).

Additionally $BE_USER calls unpack_uc() itself, basically doing
a unserialize() before, even though unpack_uc() does the same
thing.

Resolves: #78658
Releases: master
Change-Id: I492326373b61dba5cba61f24e64b31fddf9a2142
Reviewed-on: https://review.typo3.org/50595
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
typo3/sysext/workspaces/Classes/Hook/PreviewHook.php

index 89d959a..64f4d26 100644 (file)
@@ -2530,10 +2530,7 @@ This is a dump of the failures:
     {
         // UC - user configuration is a serialized array inside the user object
         // If there is a saved uc we implement that instead of the default one.
-        $temp_theSavedUC = unserialize($this->user['uc']);
-        if (is_array($temp_theSavedUC)) {
-            $this->unpack_uc($temp_theSavedUC);
-        }
+        $this->unpack_uc();
         // Setting defaults if uc is empty
         $updated = false;
         $originalUc = [];
index f9d8650..d4b1585 100644 (file)
@@ -1015,7 +1015,7 @@ class TypoScriptFrontendController
             }
         }
         $this->fe_user->start();
-        $this->fe_user->unpack_uc('');
+        $this->fe_user->unpack_uc();
         // Gets session data
         $this->fe_user->fetchSessionData();
         $recs = GeneralUtility::_GP('recs');
@@ -1178,7 +1178,7 @@ class TypoScriptFrontendController
             $BE_USER->lockIP = $GLOBALS['TYPO3_CONF_VARS']['BE']['lockIP'];
             // Object is initialized
             $BE_USER->start();
-            $BE_USER->unpack_uc('');
+            $BE_USER->unpack_uc();
             if (!empty($BE_USER->user['uid'])) {
                 $BE_USER->fetchGroupData();
                 $this->beUserLogin = true;
index 4028ebe..2a12e79 100644 (file)
@@ -116,7 +116,7 @@ class PreviewHook implements \TYPO3\CMS\Core\SingletonInterface
             $tempBackendUser->userTS_dontGetCached = 1;
             $tempBackendUser->setBeUserByUid($this->previewConfiguration['BEUSER_uid']);
             if ($tempBackendUser->user['uid']) {
-                $tempBackendUser->unpack_uc('');
+                $tempBackendUser->unpack_uc();
                 $tempBackendUser->fetchGroupData();
                 // Handle degradation of admin users
                 if ($tempBackendUser->isAdmin()) {