TEMPORARY (remove when solved): Disable output of deprecation messages until error...
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_befunc.php
index 839a104..d1bd194 100755 (executable)
@@ -78,7 +78,7 @@
  *
  *              SECTION: Caching related
  * 1105:     function storeHash($hash,$data,$ident)
- * 1125:     function getHash($hash,$expTime=0)
+ * 1125:     function getHash($hash)
  *
  *              SECTION: TypoScript related
  * 1161:     function getPagesTSconfig($id,$rootLine='',$returnPartArray=0)
@@ -341,7 +341,7 @@ final class t3lib_BEfunc {
         * @param       array           Array of fields
         * @param       string          Table in which we are searching (for DBAL detection of quoteStr() method)
         * @return      string          WHERE clause for search
-        * @deprecated          Use $GLOBALS['TYPO3_DB']->searchQuery() directly!
+        * @deprecated since TYPO3 3.6 - Use $GLOBALS['TYPO3_DB']->searchQuery() directly!
         */
        public static function searchQuery($searchWords, $fields, $table = '') {
                return $GLOBALS['TYPO3_DB']->searchQuery($searchWords, $fields, $table);
@@ -356,7 +356,7 @@ final class t3lib_BEfunc {
         * @param       string          Table field name
         * @param       string          Value to find in list
         * @return      string          WHERE clause for a query
-        * @deprecated          Use $GLOBALS['TYPO3_DB']->listQuery() directly!
+        * @deprecated since TYPO3 3.6 - Use $GLOBALS['TYPO3_DB']->listQuery() directly!
         */
        public static function listQuery($field, $value) {
                return $GLOBALS['TYPO3_DB']->listQuery($field, $value, '');
@@ -436,9 +436,9 @@ final class t3lib_BEfunc {
                                }
                        }
                }
-               $outQ = ' AND '.($inv ? '('.implode(' OR ', $invQuery).')' : implode(' AND ', $query));
+               $outQ = ($inv ? '(' . implode(' OR ', $invQuery) . ')' : implode(' AND ', $query));
 
-               return $outQ;
+               return $outQ ? ' AND ' . $outQ : '';
        }
 
        /**
@@ -489,7 +489,6 @@ final class t3lib_BEfunc {
         * $local_table and $mm_table is mandatory. $foreign_table is optional.
         * The JOIN is done with [$local_table].uid <--> [$mm_table].uid_local  / [$mm_table].uid_foreign <--> [$foreign_table].uid
         * The function is very useful for selecting MM-relations between tables adhering to the MM-format used by TCE (TYPO3 Core Engine). See the section on $TCA in Inside TYPO3 for more details.
-        * DEPRECATED - Use $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query() instead since that will return the result pointer while this returns the query. Using this function may make your application less fitted for DBAL later.
         *
         * @param       string          Field list for SELECT
         * @param       string          Tablename, local table
@@ -500,7 +499,7 @@ final class t3lib_BEfunc {
         * @param       string          Optional ORDER BY field(s), if none, supply blank string.
         * @param       string          Optional LIMIT value ([begin,]max), if none, supply blank string.
         * @return      string          Full SQL query
-        * @deprecated
+        * @deprecated since TYPO3 3.6 - Use $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query() instead since that will return the result pointer while this returns the query. Using this function may make your application less fitted for DBAL later.
         * @see t3lib_DB::exec_SELECT_mm_query()
         */
        public static function mm_query($select, $local_table, $mm_table, $foreign_table, $whereClause = '', $groupBy = '', $orderBy = '', $limit = '') {
@@ -523,7 +522,7 @@ final class t3lib_BEfunc {
         * @param       string          Table name
         * @param       array           Field values as key=>value pairs.
         * @return      string          Full SQL query for INSERT
-        * @deprecated
+        * @deprecated since TYPO3 3.6
         */
        public static function DBcompileInsert($table, $fields_values) {
                return $GLOBALS['TYPO3_DB']->INSERTquery($table, $fields_values);
@@ -537,7 +536,7 @@ final class t3lib_BEfunc {
         * @param       string          WHERE clause, eg. "uid=1"
         * @param       array           Field values as key=>value pairs.
         * @return      string          Full SQL query for UPDATE
-        * @deprecated
+        * @deprecated since TYPO3 3.6
         */
        public static function DBcompileUpdate($table, $where, $fields_values) {
                return $GLOBALS['TYPO3_DB']->UPDATEquery($table, $where, $fields_values);
@@ -599,6 +598,7 @@ final class t3lib_BEfunc {
                        } else {
                                break;
                        }
+                       $GLOBALS['TYPO3_DB']->sql_free_result($res);
                }
                if ($uid==0) {$theRowArray[] = Array('uid'=>0, 'title'=>'');}
                if (is_array($theRowArray)) {
@@ -706,6 +706,7 @@ final class t3lib_BEfunc {
                        } else {
                                break;
                        }
+                       $GLOBALS['TYPO3_DB']->sql_free_result($res);
                }
 
                if ($fullTitleLimit) {
@@ -834,6 +835,7 @@ final class t3lib_BEfunc {
                while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                        $sysLanguages[] = array($row['title'].' ['.$row['uid'].']', $row['uid'], ($row['flag'] ? 'flags/'.$row['flag'] : ''));
                }
+               $GLOBALS['TYPO3_DB']->sql_free_result($res);
 
                return $sysLanguages;
        }
@@ -866,8 +868,8 @@ final class t3lib_BEfunc {
                $localizationMode = false;
                if (is_array($fieldOrConfig) && count($fieldOrConfig)) {
                        $config = $fieldOrConfig;
-               } elseif (is_string($fieldOrConfig) && isset($GLOBALS['TCA'][$table]['columns'][$field]['config'])) {
-                       $config = $GLOBALS['TCA'][$table]['columns'][$field]['config'];
+               } elseif (is_string($fieldOrConfig) && isset($GLOBALS['TCA'][$table]['columns'][$fieldOrConfig]['config'])) {
+                       $config = $GLOBALS['TCA'][$table]['columns'][$fieldOrConfig]['config'];
                }
                if (is_array($config) && isset($config['type']) && $config['type']=='inline' && self::isTableLocalizable($table)) {
                        $localizationMode = (isset($config['behaviour']['localizationMode']) && $config['behaviour']['localizationMode'] ? $config['behaviour']['localizationMode'] : 'select');
@@ -1125,6 +1127,7 @@ final class t3lib_BEfunc {
                                                                );
                                        $newRecordPidValue = 0;
                                        $rr = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
+                                       $GLOBALS['TYPO3_DB']->sql_free_result($res);
 
                                                // break if no result from SQL db or if looping...
                                        if (!is_array($rr) || isset($uidAcc[$rr['uid']]))       break;
@@ -1195,47 +1198,45 @@ final class t3lib_BEfunc {
         *******************************************/
 
        /**
-        * Stores the string value $data in the 'cache_hash' table with the hash key, $hash, and visual/symbolic identification, $ident
+        * Stores the string value $data in the 'cache_hash' cache with the
+        * hash key, $hash, and visual/symbolic identification, $ident
         * IDENTICAL to the function by same name found in t3lib_page:
         * Usage: 2
         *
         * @param       string          32 bit hash string (eg. a md5 hash of a serialized array identifying the data being stored)
         * @param       string          The data string. If you want to store an array, then just serialize it first.
-        * @param       string          $ident is just a textual identification in order to inform about the content! May be 20 characters long.
+        * @param       string          $ident is just a textual identification in order to inform about the content!
         * @return      void
         */
        public static function storeHash($hash, $data, $ident) {
-               $insertFields = array(
-                       'hash' => $hash,
-                       'content' => $data,
-                       'ident' => $ident,
-                       'tstamp' => time()
+               $GLOBALS['typo3CacheManager']->getCache('cache_hash')->set(
+                       $hash,
+                       $data,
+                       array('ident_' . $ident),
+                       0 // unlimited lifetime
                );
-               $GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_hash', 'hash='.$GLOBALS['TYPO3_DB']->fullQuoteStr($hash, 'cache_hash'));
-               $GLOBALS['TYPO3_DB']->exec_INSERTquery('cache_hash', $insertFields);
        }
 
        /**
-        * Returns string value stored for the hash string in the table "cache_hash"
+        * Returns string value stored for the hash string in the cache "cache_hash"
         * Can be used to retrieved a cached value
+        *
         * IDENTICAL to the function by same name found in t3lib_page
-        * Usage: 2
         *
-        * @param       string          Hash key, 32 bytes hex
-        * @param       integer         $expTime represents the expire time in seconds. For instance a value of 3600 would allow cached content within the last hour, otherwise nothing is returned.
+        * @param       string          The hash-string which was used to store the data value
         * @return      string
         */
-       public static function getHash($hash, $expTime = 0) {
-                       // if expTime is not set, the hash will never expire
-               $expTime = intval($expTime);
-               if ($expTime) {
-                       $whereAdd = ' AND tstamp > '.(time()-$expTime);
+       public static function getHash($hash) {
+               $hashContent = null;
+
+               $contentHashCache = $GLOBALS['typo3CacheManager']->getCache('cache_hash');
+               $cacheEntry = $contentHashCache->get($hash);
+
+               if ($cacheEntry) {
+                       $hashContent = $cacheEntry;
                }
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('content', 'cache_hash', 'hash='.$GLOBALS['TYPO3_DB']->fullQuoteStr($hash, 'cache_hash').$whereAdd);
-               $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
-               $GLOBALS['TYPO3_DB']->sql_free_result($res);
 
-               return (is_array($row) ? $row['content'] : null);
+               return $hashContent;
        }
 
 
@@ -1281,7 +1282,7 @@ final class t3lib_BEfunc {
                        // Parsing the user TS (or getting from cache)
                $userTS = implode($TSdataArray, chr(10).'[GLOBAL]'.chr(10));
                $hash = md5('pageTS:'.$userTS);
-               $cachedContent = t3lib_BEfunc::getHash($hash, 0);
+               $cachedContent = t3lib_BEfunc::getHash($hash);
                $TSconfig = array();
                if (isset($cachedContent)) {
                        $TSconfig = unserialize($cachedContent);
@@ -1417,6 +1418,8 @@ final class t3lib_BEfunc {
                while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                        $be_user_Array[$row['uid']] = $row;
                }
+               $GLOBALS['TYPO3_DB']->sql_free_result($res);
+
                return $be_user_Array;
        }
 
@@ -1430,10 +1433,13 @@ final class t3lib_BEfunc {
         */
        public static function getGroupNames($fields = 'title,uid', $where = '') {
                $be_group_Array = Array();
+
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, 'be_groups', 'pid=0 '.$where.t3lib_BEfunc::deleteClause('be_groups'), '', 'title');
                while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                        $be_group_Array[$row['uid']] = $row;
                }
+               $GLOBALS['TYPO3_DB']->sql_free_result($res);
+
                return $be_group_Array;
        }
 
@@ -1635,7 +1641,7 @@ final class t3lib_BEfunc {
         * @param       string          String to set as title-attribute. If no $content is given only the attribute name is returned.
         * @param       boolean         If $hsc is set, then content of the attribute is htmlspecialchar()'ed (which is good for XHTML and other reasons...)
         * @return      string
-        * @deprecated          The idea made sense with older browsers, but now all browsers should support the "title" attribute - so just hardcode the title attribute instead!
+        * @deprecated since TYPO3 3.6 - The idea made sense with older browsers, but now all browsers should support the "title" attribute - so just hardcode the title attribute instead!
         */
        public static function titleAttrib($content = '', $hsc = 0) {
                global $CLIENT;
@@ -2062,6 +2068,11 @@ final class t3lib_BEfunc {
        public static function getProcessedValue($table, $col, $value, $fixed_lgd_chars = 0, $defaultPassthrough = 0, $noRecordLookup = FALSE, $uid = 0, $forceResult = TRUE) {
                global $TCA;
                global $TYPO3_CONF_VARS;
+               
+               if ($col == 'uid') {
+                               // no need to load TCA as uid is not in TCA-array
+                       return $value;
+               }
                        // Load full TCA for $table
                t3lib_div::loadTCA($table);
                        // Check if table and field is configured:
@@ -2110,6 +2121,8 @@ final class t3lib_BEfunc {
                                                        while($MMrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($MMres)) {
                                                                $mmlA[] = ($noRecordLookup?$MMrow['uid']:t3lib_BEfunc::getRecordTitle($theColConf['foreign_table'], $MMrow, FALSE, $forceResult));
                                                        }
+                                                       $GLOBALS['TYPO3_DB']->sql_free_result($MMres);
+
                                                        if (is_array($mmlA)) {
                                                                $l = implode('; ', $mmlA);
                                                        } else {
@@ -2151,7 +2164,7 @@ final class t3lib_BEfunc {
                                break;
                                case 'check':
                                        if (!is_array($theColConf['items']) || count($theColConf['items'])==1) {
-                                               $l = $value ? 'Yes' : '';
+                                               $l = $value ? $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:yes') : '';
                                        } else {
                                                reset($theColConf['items']);
                                                $lA = Array();
@@ -2519,8 +2532,10 @@ final class t3lib_BEfunc {
                if ($altUrl) {
                        $url = $altUrl;
                } else {
-                               // check where to render the page
-                       $viewScript = ($GLOBALS['BE_USER']->workspace!=0 && !$GLOBALS['BE_USER']->user['workspace_preview']) ? '/'.TYPO3_mainDir.'mod/user/ws/wsol_preview.php?id=' : '/index.php?id=';
+
+                       $viewScriptPreviewEnabled  = '/' . TYPO3_mainDir . 'mod/user/ws/wsol_preview.php?id=';
+                       $viewScriptPreviewDisabled = '/index.php?id=';
+
                                // check alternate Domains
                        if ($rootLine)  {
                                $parts = parse_url(t3lib_div::getIndpEnv('TYPO3_SITE_URL'));
@@ -2529,11 +2544,43 @@ final class t3lib_BEfunc {
                                }
                        }
                        $preUrl = $preUrl_temp ? (t3lib_div::getIndpEnv('TYPO3_SSL') ? 'https://' : 'http://').$preUrl_temp : $backPath.'..';
-                       $url = $preUrl.$viewScript.$id.$addGetVars.$anchor;
+                       
+                               // Look if a fixed preview language should be added:
+                       $viewLanguageOrder = $GLOBALS['BE_USER']->getTSConfigVal('options.view.languageOrder');
+                       if (strlen($viewLanguageOrder)) {
+                               $suffix = '';
+                       
+                                       // Find allowed languages (if none, all are allowed!)
+                               if (!$GLOBALS['BE_USER']->user['admin'] &&
+                                       strlen($GLOBALS['BE_USER']->groupData['allowed_languages'])) {
+                                       $allowed_languages = array_flip(explode(',', $GLOBALS['BE_USER']->groupData['allowed_languages']));
+                               }
+                       
+                                       // Traverse the view order, match first occurence:
+                               $lOrder = t3lib_div::intExplode(',',$viewLanguageOrder);
+                               foreach($lOrder as $langUid)    {
+                                       if (is_array($allowed_languages) && count($allowed_languages)) {
+                                               if (isset($allowed_languages[$langUid])) {      // Choose if set.
+                                                       $suffix = '&L='.$langUid;
+                                                       break;
+                                               }
+                                       } else {        // All allowed since no lang. are listed.
+                                               $suffix = '&L='.$langUid;
+                                               break;
+                                       }
+                               }
+                       
+                                       // Add it:
+                               $addGetVars.= $suffix;
+                       }
+                       
+                       $urlPreviewEnabled  = $preUrl . $viewScriptPreviewEnabled . $id . $addGetVars . $anchor;
+                       $urlPreviewDisabled = $preUrl . $viewScriptPreviewDisabled . $id . $addGetVars . $anchor;
                }
 
-               return "previewWin=window.open('".$url."','newTYPO3frontendWindow');".
-                               ($switchFocus ? 'previewWin.focus();' : '');
+               return "previewWin=window.open(top.WorkspaceFrontendPreviewEnabled?'" .
+                       $urlPreviewDisabled . "':'" . $urlPreviewEnabled .
+                       "','newTYPO3frontendWindow');" . ( $switchFocus ? 'previewWin.focus();' : '');
        }
 
        /**
@@ -2618,9 +2665,13 @@ final class t3lib_BEfunc {
                }
                $mainParams = t3lib_div::implodeArrayForUrl('', $mainParams);
 
-               if (!$script) {basename(PATH_thisScript);}
+               if (!$script) {
+                       $script = basename(PATH_thisScript);
+                       $mainParams.= (t3lib_div::_GET('M') ? '&M='.rawurlencode(t3lib_div::_GET('M')) : '');
+               }
+
                $onClick = 'jumpToUrl(\''.$script.'?'.$mainParams.$addparams.'&'.$elementName.'=\'+(this.checked?1:0),this);';
-               return '<input type="checkbox" name="'.$elementName.'"'.($currentValue?' checked="checked"':'').' onclick="'.htmlspecialchars($onClick).'"'.($tagParams?' '.$tagParams:'').' />';
+               return '<input type="checkbox" class="checkbox" name="'.$elementName.'"'.($currentValue?' checked="checked"':'').' onclick="'.htmlspecialchars($onClick).'"'.($tagParams?' '.$tagParams:'').' />';
        }
 
        /**
@@ -2643,7 +2694,11 @@ final class t3lib_BEfunc {
                }
                $mainParams = t3lib_div::implodeArrayForUrl('', $mainParams);
 
-               if (!$script) {basename(PATH_thisScript);}
+               if (!$script) {
+                       $script = basename(PATH_thisScript);
+                       $mainParams.= (t3lib_div::_GET('M') ? '&M='.rawurlencode(t3lib_div::_GET('M')) : '');
+               }
+
                $onChange = 'jumpToUrl(\''.$script.'?'.$mainParams.$addparams.'&'.$elementName.'=\'+escape(this.value),this);';
                return '<input type="text"'.$GLOBALS['TBE_TEMPLATE']->formWidth($size).' name="'.$elementName.'" value="'.htmlspecialchars($currentValue).'" onchange="'.htmlspecialchars($onChange).'" />';
        }
@@ -2887,6 +2942,7 @@ final class t3lib_BEfunc {
                if ($table && $uid) {
                        $fields_values = array(
                                'userid' => $user_id,
+                               'feuserid' => 0,
                                'tstamp' => $GLOBALS['EXEC_TIME'],
                                'record_table' => $table,
                                'record_uid' => $uid,
@@ -2921,20 +2977,39 @@ final class t3lib_BEfunc {
                                                                AND sys_lockedrecords.tstamp > '.($GLOBALS['EXEC_TIME']-2*3600)
                                                );
                        while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                                       // Get the type of the user that locked this record:
+                               if ($row['userid']) {
+                                       $userTypeLabel = 'beUser';
+                               } elseif ($row['feuserid']) {
+                                       $userTypeLabel = 'feUser';
+                               } else {
+                                       $userTypeLabel = 'user';
+                               }
+                               $userType = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.' . $userTypeLabel);
+                                       // Get the username (if available):
+                               if ($row['username']) {
+                                       $userName = $row['username'];
+                               } else {
+                                       $userName = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.unknownUser');
+                               }
+
                                $LOCKED_RECORDS[$row['record_table'].':'.$row['record_uid']] = $row;
                                $LOCKED_RECORDS[$row['record_table'].':'.$row['record_uid']]['msg'] = sprintf(
-                                       $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.lockedRecord'),
-                                       $row['username'],
+                                       $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.lockedRecordUser'),
+                                       $userType,
+                                       $userName,
                                        t3lib_BEfunc::calcAge($GLOBALS['EXEC_TIME']-$row['tstamp'], $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears'))
                                );
                                if ($row['record_pid'] && !isset($LOCKED_RECORDS[$row['record_table'].':'.$row['record_pid']])) {
                                        $LOCKED_RECORDS['pages:'.$row['record_pid']]['msg'] = sprintf(
-                                               $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.lockedRecord_content'),
-                                               $row['username'],
+                                               $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.lockedRecordUser_content'),
+                                               $userType,
+                                               $userName,
                                                t3lib_BEfunc::calcAge($GLOBALS['EXEC_TIME']-$row['tstamp'], $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears'))
                                        );
                                }
                        }
+                       $GLOBALS['TYPO3_DB']->sql_free_result($res);
                }
                return $LOCKED_RECORDS[$table.':'.$uid];
        }
@@ -3337,9 +3412,10 @@ final class t3lib_BEfunc {
        public static function isModuleSetInTBE_MODULES($modName) {
                reset($GLOBALS['TBE_MODULES']);
                $loaded = array();
+
                while(list($mkey, $list) = each($GLOBALS['TBE_MODULES'])) {
                        $loaded[$mkey] = 1;
-                       if (trim($list)) {
+                       if (!is_array($list) && trim($list)) {
                                $subList = t3lib_div::trimExplode(',', $list, 1);
                                while(list(,$skey) = each($subList)) {
                                        $loaded[$mkey.'_'.$skey] = 1;
@@ -3422,26 +3498,42 @@ final class t3lib_BEfunc {
 
                if ($TCA[$table] && $TCA[$table]['ctrl']['versioningWS'])       {
 
-                               // Select all versions of record:
+                       $realPid = 0;
+                       $outputRows = array();
+
+                               // Select UID version:
                        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
                                $fields,
                                $table,
-                               '((pid=-1 AND t3ver_oid='.intval($uid).($workspace!=0?' AND t3ver_wsid='.intval($workspace):'').') OR uid='.intval($uid).')'.
+                               'uid='.intval($uid).
+                                       ($includeDeletedRecords ? '' : t3lib_BEfunc::deleteClause($table)),
+                               '',
+                               't3ver_id DESC'
+                       );
+
+                                               // Add rows to output array:
+                       while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))       {
+                               $row['_CURRENT_VERSION'] = TRUE;
+                               $realPid = $row['pid'];
+                               $outputRows[] = $row;
+                       }
+
+                               // Select all offline versions of record:
+                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                               $fields,
+                               $table,
+                               'pid=-1 AND uid!='.intval($uid).' AND t3ver_oid='.intval($uid).($workspace!=0?' AND t3ver_wsid='.intval($workspace):'').
                                        ($includeDeletedRecords ? '' : t3lib_BEfunc::deleteClause($table)),
                                '',
                                't3ver_id DESC'
                        );
 
                                // Add rows to output array:
-                       $realPid = 0;
-                       $outputRows = array();
-                       while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                               if ($uid==$row['uid']) {
-                                       $row['_CURRENT_VERSION'] = TRUE;
-                                       $realPid = $row['pid'];
-                               }
+                       while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))       {
                                $outputRows[] = $row;
                        }
+                       
+                       $GLOBALS['TYPO3_DB']->sql_free_result($res);
 
                                // Set real-pid:
                        foreach($outputRows as $idx => $oRow) {
@@ -3909,6 +4001,7 @@ final class t3lib_BEfunc {
                                        '</a>');
 
                        }
+                       $GLOBALS['TYPO3_DB']->sql_free_result($res);
 
                        if (@is_file($enableInstallToolFile)) {
                                $url = t3lib_div::getIndpEnv('TYPO3_REQUEST_SCRIPT').'?adminWarning_cmd=remove_ENABLE_INSTALL_TOOL';
@@ -3927,6 +4020,18 @@ final class t3lib_BEfunc {
                                        '</a>');
                        }
 
+                               // Check if fileDenyPattern was changed which is dangerous on Apache
+                       if ($GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'] != FILE_DENY_PATTERN_DEFAULT ) {
+                               $warnings['file_deny_pattern'] = sprintf(
+                                       $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.file_deny_pattern'),
+                                       '<br /><pre>'.htmlspecialchars(FILE_DENY_PATTERN_DEFAULT).'</pre><br />');
+                       }
+
+                               // Check if fileDenyPattern allows to upload .htaccess files which is dangerous on Apache
+                       if ($GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'] != FILE_DENY_PATTERN_DEFAULT && t3lib_div::verifyFilenameAgainstDenyPattern(".htaccess"))      {
+                               $warnings['file_deny_htaccess'] = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.file_deny_htaccess');
+                       }
+
                                // Check if there are still updates to perform
                        if (!t3lib_div::compat_version(TYPO3_branch)) {
                                $url = 'install/index.php?redirect_url=index.php'.urlencode('?TYPO3_INSTALL[type]=update');
@@ -3958,9 +4063,11 @@ final class t3lib_BEfunc {
 
                        if (count($warnings)) {
                                $style = ' style="margin-bottom:10px;"';
-                               $content = '<table border="0" cellpadding="0" cellspacing="0" class="warningbox"><tr><td>'.
-                                       $GLOBALS['TBE_TEMPLATE']->icons(3).'Important notice!<br /><ul><li'.$style.'>'.
-                                       implode('</li><li'.$style.'>', $warnings).'</li></ul>'.
+                               $content = '<table border="0" cellpadding="0" cellspacing="0" class="warningbox"><tr><td>' .
+                                       $GLOBALS['TBE_TEMPLATE']->icons(3) . '<span class="warningboxheader">' .
+                                       $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.header') .
+                                       '</span><br /><ul><li' . $style.'>' .
+                                       implode('</li><li' . $style . '>', $warnings) . '</li></ul>' .
                                        '</td></tr></table>';
 
                                unset($warnings);
@@ -4026,7 +4133,7 @@ final class t3lib_BEfunc {
 
        /**
         * Returns "list of backend modules". Most likely this will be obsolete soon / removed. Don't use.
-        * Usage: 3
+        * Usage: 0
         *
         * @param       array           Module names in array. Must be "addslashes()"ed
         * @param       string          Perms clause for SQL query
@@ -4034,7 +4141,7 @@ final class t3lib_BEfunc {
         * @param       string          The URL/script to jump to (used in A tag)
         * @return      array           Two keys, rows and list
         * @internal
-        * @deprecated
+        * @deprecated since TYPO3 3.6
         * @obsolete
         */
        public static function getListOfBackendModules($name, $perms_clause, $backPath = '', $script = 'index.php') {
@@ -4050,6 +4157,8 @@ final class t3lib_BEfunc {
                                        htmlspecialchars($row['title']).
                                        '</a></span><br />';
                }
+               $GLOBALS['TYPO3_DB']->sql_free_result($res);
+
                return array('rows'=>$theRows, 'list'=>$out);
        }