[BUGFIX] Password is not stored encrypted but expected to be on invoking client
authorOliver Hader <oliver@typo3.org>
Wed, 20 Jun 2012 17:02:52 +0000 (19:02 +0200)
committerOliver Hader <oliver@typo3.org>
Wed, 20 Jun 2012 17:02:52 +0000 (19:02 +0200)
Due to a bug in the TceMainHook the password is not stored
encrypted. However on invoking the WebDavClient the plain
password is "decrypted" which leads to a wrong authentication
request at the WebDav server.

Classes/Backend/TceMainHook.php
ext_localconf.php

index f12aeba..17319de 100644 (file)
@@ -6,12 +6,18 @@
  * @author Andreas Wolf <andreas.wolf@ikt-werk.de>
  */
 class Tx_FalWebdav_Backend_TceMainHook {
-
-       public function processDatamap_preProcessFieldArray(&$incomingFieldArray, $table, $id, $tceMainObject) {
-               if ($table != 'sys_file_storage') {
+       /**
+        * @param array $incomingFieldArray
+        * @param string $table
+        * @param integer|string $id
+        * @param t3lib_TCEmain $tceMainObject
+        * @return mixed
+        */
+       public function processDatamap_preProcessFieldArray(&$incomingFieldArray, $table, $id, t3lib_TCEmain $tceMainObject) {
+               if ($table !== 'sys_file_storage') {
                        return;
                }
-               if ($incomingFieldArray['configuration']['data']['sDEF']['lDEF']['driver']['vDEF'] != 'WebDav') {
+               if ($incomingFieldArray['driver'] !== 'WebDav') {
                        return;
                }
 
@@ -24,15 +30,16 @@ class Tx_FalWebdav_Backend_TceMainHook {
                        $url = $cleanedUrl;
                }
                        // if we found authentication information in the URL, use it instead of the information currently stored
-               if ($extractedUsername != '') {
+               if ($extractedUsername !== '') {
                        $username = $extractedUsername;
                        $password = $extractedPassword;
                }
 
                        // skip encryption if we have no password set or the password is already encrypted
-               if ($password == '' || substr($password, 0, 1) == '$') {
+               if ($password === '' || substr($password, 0, 1) === '$') {
                        return;
                }
+
                $password = Tx_FalWebdav_Utility_Encryption::encryptPassword($password);
        }
 
index 0ea899b..8010f24 100644 (file)
@@ -13,4 +13,4 @@ set_include_path($newPath . PATH_SEPARATOR . get_include_path());
 $registry = t3lib_div::makeInstance('t3lib_file_Driver_DriverRegistry');
 $registry->registerDriverClass('Tx_FalWebdav_Driver_WebDavDriver', 'WebDav', 'WebDAV', 'FILE:EXT:fal_webdav/Configuration/FlexForm/WebDavDriverFlexForm.xml');
 
-$TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = 'EXT:fal_webdav/Classes/Backend/TceMainHook.php:&Tx_FalWebdav_Backend_TceMainHook';
+$TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['fal_webdav'] = 'EXT:fal_webdav/Classes/Backend/TceMainHook.php:&Tx_FalWebdav_Backend_TceMainHook';