* If the encryption key is not set, the warning in the backend now contains a link...
authorMichael Stucki <michael.stucki@typo3.org>
Sun, 18 Sep 2005 18:43:37 +0000 (18:43 +0000)
committerMichael Stucki <michael.stucki@typo3.org>
Sun, 18 Sep 2005 18:43:37 +0000 (18:43 +0000)
* be_group can no longer be selected as a subgroup of itself
* Merged fenestgrp extension into Core. This makes it possible to select subgroups for fe_groups. Thanks to Glen Gibb.
* Merged ingmar_accessctrl extension into Core. Content elements and pages can now have access for more than only one group. Thanks to Ingmar Schlecht for his nice extension.
* Fixed a bug in the object browser: Adding properties copied key + value into the key field. Notice: This requires an additional patch in the tstemplate_objbrowser extension!
* Some typo fixes
* New property for TYPO3_CONF_VARS[SYS][displayErrors]: If set to 2, display_errors will only be enabled if the devIPmask matches the current clients IP address.

git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@794 709f56b5-9817-0410-a4d7-c38de5d9e867

21 files changed:
ChangeLog
t3lib/class.t3lib_befunc.php
t3lib/class.t3lib_div.php
t3lib/class.t3lib_page.php
t3lib/class.t3lib_tsparser_ext.php
t3lib/class.t3lib_userauthgroup.php
t3lib/config_default.php
t3lib/stddb/tbl_be.php
typo3/index.php
typo3/sysext/cms/ext_tables.php
typo3/sysext/cms/ext_tables.sql
typo3/sysext/cms/locallang_tca.xml
typo3/sysext/cms/tbl_cms.php
typo3/sysext/cms/tbl_tt_content.php
typo3/sysext/cms/tslib/class.tslib_fe.php
typo3/sysext/cms/tslib/class.tslib_feuserauth.php
typo3/sysext/context_help/locallang_csh_fe_groups.xml
typo3/sysext/install/mod/class.tx_install.php
typo3/sysext/sv/class.tx_sv_auth.php
typo3/sysext/sv/class.tx_sv_authbase.php
typo3/wizard_tsconfig.php

index 60c2b08..99e53db 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-09-18 Michael Stucki <michael@typo3.org>
+
+       * If the encryption key is not set, the warning in the backend now contains a link to the according section.
+       * be_group can no longer be selected as a subgroup of itself
+       * Merged fenestgrp extension into Core. This makes it possible to select subgroups for fe_groups. Thanks to Glen Gibb.
+       * Merged ingmar_accessctrl extension into Core. Content elements and pages can now have access for more than only one group. Thanks to Ingmar Schlecht for his nice extension.
+       * Fixed a bug in the object browser: Adding properties copied key + value into the key field. Notice: This requires an additional patch in the tstemplate_objbrowser extension!
+       * Some typo fixes
+       * New property for TYPO3_CONF_VARS[SYS][displayErrors]: If set to 2, display_errors will only be enabled if the devIPmask matches the current clients IP address.
+
 2005-09-14 Karsten Dambekalns <karsten@typo3.org>
 
        * Fixed bug #214 (flexform default values), as it has been reported to work with the existing patch.
index 881c928..def246c 100755 (executable)
@@ -3088,7 +3088,8 @@ class t3lib_BEfunc        {
 
                                // Check if the encryption key is empty
                        if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] == '')  {
-                               $warnings[] = 'The encryption key is not set! Set it in $TYPO3_CONF_VARS[SYS][encryptionKey]';
+                               $url = 'install/index.php?redirect_url=index.php'.urlencode('?TYPO3_INSTALL[type]=config#set_encryptionKey');
+                               $warnings[] = 'The encryption key is not set! Set it in <a href="'.$url.'">$TYPO3_CONF_VARS[SYS][encryptionKey]</a>';
                        }
 
                        if(count($warnings))    {
index ecc25fb..b2a5464 100755 (executable)
@@ -780,7 +780,7 @@ class t3lib_div {
         * Usage: 16
         *
         * @param       string          Accept multiple parameters wich can be comma-separated lists of values and arrays.
-        * @param       mixed           $secondParameter: Dummy field, which is set will show a warning!
+        * @param       mixed           $secondParameter: Dummy field, which if set will show a warning!
         * @return      string          Returns the list without any duplicates of values, space around values are trimmed
         */
        function uniqueList($in_list, $secondParameter=NULL)    {
index f58a14f..dbe83fc 100755 (executable)
@@ -913,9 +913,7 @@ class t3lib_pageSelect {
                                }
                                if ($ctrl['enablecolumns']['fe_group'] && !$ignore_array['fe_group'])   {
                                        $field = $table.'.'.$ctrl['enablecolumns']['fe_group'];
-                                       $gr_list = $GLOBALS['TSFE']->gr_list;
-                                       if (!strcmp($gr_list,''))       $gr_list=0;
-                                       $query.=' AND '.$field.' IN ('.$gr_list.')';
+                                       $query.= $this->getMultipleGroupsWhereClause($field, $table);
                                }
 
                                        // Call hook functions for additional enableColumns
@@ -939,6 +937,21 @@ class t3lib_pageSelect {
                return $query;
        }
 
+       function getMultipleGroupsWhereClause($field, $table)   {
+               $memberGroups = t3lib_div::intExplode(',',$GLOBALS['TSFE']->gr_list);
+               $orChecks=array();
+               $orChecks[]=$field.'=""';       // If the field is empty, then OK
+               $orChecks[]=$field.'="0"';      // If the field contsains zero, then OK
+
+               foreach($memberGroups as $value)        {
+                       // if ($value > 0)      {       // outcommented by Ingmar Schlecht because we want those pseudo groups like "hide at login" etc. to work. Original comment from Kasper was: "If user is member of a real group, not zero or negative pseudo group"
+                               $orChecks[] = $GLOBALS['TYPO3_DB']->listQuery($field, $value, $table);
+                       // }
+               }
+
+               return ' AND ('.implode(' OR ',$orChecks).')';
+       }
+
 
 
 
index 0dc5114..aadc3d5 100755 (executable)
@@ -408,6 +408,8 @@ class t3lib_tsparser_ext extends t3lib_TStemplate   {
                                                } else {
                                                        $ln = '';
                                                }
+
+                                               if ($this->tsbrowser_searchKeys[$depth] & 4)    { $label = '<b><font color="red">'.$label.'</font></b>'; }      // The key has matched the search string
                                                $label = '<a href="'.htmlspecialchars($aHref).'" title="'.htmlspecialchars($ln).'">'.$label.'</a>';
                                        }
                                }
@@ -421,7 +423,7 @@ class t3lib_tsparser_ext extends t3lib_TStemplate   {
                                                $lgdChars = 68-ceil(strlen("[".$key."]")*0.8)-$imgBlocks*3;
                                                $theValue = $this->ext_fixed_lgd($theValue,$lgdChars);
                                        }
-                                       if ($this->tsbrowser_searchKeys[$depth])        {
+                                       if ($this->tsbrowser_searchKeys[$depth] & 2)    {       // The value has matched the search string
                                                $HTML.='=<b><font color="red">'.$this->makeHtmlspecialchars($theValue).'</font></b>';
                                        } else {
                                                $HTML.="=<b>".$this->makeHtmlspecialchars($theValue)."</b>";
@@ -491,28 +493,44 @@ class t3lib_tsparser_ext extends t3lib_TStemplate {
                reset($arr);
                $keyArr=array();
                while (list($key,)=each($arr))  {
-                       $key=ereg_replace("\.$","",$key);
-                       if (substr($key,-1)!=".")       {
+                       $key=ereg_replace('\.$','',$key);
+                       if (substr($key,-1)!='.')       {
                                $keyArr[$key]=1;
                        }
                }
                reset($keyArr);
 //             asort($keyArr);
                $c=count($keyArr);
-               if ($depth_in)  {$depth_in = $depth_in.".";}
+               if ($depth_in)  { $depth_in = $depth_in.'.'; }
                while (list($key,)=each($keyArr))       {
                        $depth=$depth_in.$key;
                        $deeper = is_array($arr[$key."."]);
 
                        if ($this->regexMode)   {
-                               if (ereg($searchString,$arr[$key]))     {       $this->tsbrowser_searchKeys[$depth]=1;  }
+                               if (ereg($searchString,$arr[$key]))     {       // The value has matched
+                                       $this->tsbrowser_searchKeys[$depth]+=2;
+                               }
+                               if (ereg($searchString,$key))   {               // The key has matched
+                                       $this->tsbrowser_searchKeys[$depth]+=4;
+                               }
+                               if (ereg($searchString,$depth_in))      {       // Just open this subtree if the parent key has matched the search
+                                       $this->tsbrowser_searchKeys[$depth]=1;
+                               }
                        } else {
-                               if (stristr($arr[$key],$searchString))  {       $this->tsbrowser_searchKeys[$depth]=1;  }
+                               if (stristr($arr[$key],$searchString))  {       // The value has matched
+                                       $this->tsbrowser_searchKeys[$depth]+=2;
+                               }
+                               if (stristr($key,$searchString))        {       // The key has matches
+                                       $this->tsbrowser_searchKeys[$depth]+=4;
+                               }
+                               if (stristr($depth_in,$searchString))   {       // Just open this subtree if the parent key has matched the search
+                                       $this->tsbrowser_searchKeys[$depth]=1;
+                               }
                        }
 
                        if ($deeper)    {
                                $cS = count($this->tsbrowser_searchKeys);
-                               $keyArray = $this->ext_getSearchKeys($arr[$key."."], $depth, $searchString, $keyArray);
+                               $keyArray = $this->ext_getSearchKeys($arr[$key.'.'], $depth, $searchString, $keyArray);
                                if ($cS != count($this->tsbrowser_searchKeys))  {
                                        $keyArray[$depth]=1;
                                }
index 852fa67..f381970 100755 (executable)
@@ -901,7 +901,6 @@ class t3lib_userAuthGroup extends t3lib_userAuth {
                                }
                        }
                }
-
        }
 
        /**
index b7a7c99..b728cdc 100755 (executable)
@@ -27,7 +27,7 @@ $TYPO3_CONF_VARS = Array(
 
                'gdlib' => 1,                                                   // Boolean. Enables the use of GD.
                'gdlib_png' => 0,                                               // Boolean. Enables the use of GD, with PNG only. This means that all items normally generated as gif-files will be png-files instead!
-               'gdlib_2' => 0,                                                 // String/Boolean. Set this if you are using the new GDlib 2.0.1+. If you don't set this flag and still uses GDlib2, you might encounter strange behaviours like black images etc. This feature might take effect only if ImageMagick is installed and working as well! You can also use the value "no_imagecopyresized_fix" - in that case it will NOT try to fix a known issue where "imagecopyresized" does not work correctly.
+               'gdlib_2' => 0,                                                 // String/Boolean. Set this if you are using the new GDlib 2.0.1+. If you don't set this flag and still use GDlib2, you might encounter strange behaviours like black images etc. This feature might take effect only if ImageMagick is installed and working as well! You can also use the value "no_imagecopyresized_fix" - in that case it will NOT try to fix a known issue where "imagecopyresized" does not work correctly.
 
                'im' => 1,                                                              // Boolean. Enables the use of IM.
                'im_path' => '/usr/X11R6/bin/',                 // Path to the IM tools 'convert', 'combine', 'identify'. Version 4.2.9 of ImageMagick is highly recommended due to features and speed!
@@ -75,7 +75,7 @@ $TYPO3_CONF_VARS = Array(
                'multiplyDBfieldSize' => 1,                             // Double: 1-5: Amount used to multiply the DB field size when the install tool is evaluating the database size (eg. "2.5"). This is useful if you want to expand the size of fields for utf-8 etc. For western european sites using utf-8 the need should not be for more than twice the normal single-byte size (2) and for chinese / asian languages 3 should suffice.
                'setMemoryLimit' => 0,                                  // Integer, memory_limit in MB: If more than 16, TYPO3 will try to use ini_set() to set the memory limit of PHP to the value. This works only if the function ini_set() is not disabled by your sysadmin.
                'forceReturnPath' => 0,                                 // Boolean: Force return path to be applied in mail() calls. If this is set, all calls to mail() done by t3lib_htmlmail will be called with '-f<return_path> as the 5th parameter. This will make the return path correct on almost all Unix systems. There is a known problem with Postfix below version 2: Mails are not sent if this option is set and Postfix is used. On Windows platforms, the return path is set via a call to ini_set. This has no effect if safe_mode in PHP is on.
-               'displayErrors' => -1,                                  // Integer, -1,0,1. 0=Do not display any PHP error messages. 1=Display error messages. -1=Default setting. With this option, you can override the PHP setting "display_errors". It is suggested that you set this to "0" and enable the "error_log" option in php.ini instead.
+               'displayErrors' => -1,                                  // Integer, -1,0,1,2. 0=Do not display any PHP error messages. 1=Display error messages. 2=Display only if client matches TYPO3_CONF_VARS[SYS][devIPmask]. -1=Default setting. With this option, you can override the PHP setting "display_errors". It is suggested that you set this to "0" and enable the "error_log" option in php.ini instead.
                'serverTimeZone' => 1                                   // Integer, GMT offset of servers time (from time()). Default is "1" which is "GMT+1" (central european time). This value can be used in extensions that are GMT aware and wants to convert times to/from other timezones.
        ),
        'EXT' => Array (        // Options related to the Extension Management
@@ -335,9 +335,16 @@ function debugEnd() {
 $T3_SERVICES = array();
 
 
-       // Turn error logging on/off
-if(intval($TYPO3_CONF_VARS['SYS']['displayErrors']!='-1')) {
-       @ini_set('display_errors', intval($TYPO3_CONF_VARS['SYS']['displayErrors']));
+       // Turn error logging on/off.
+if($displayErrors=intval($TYPO3_CONF_VARS['SYS']['displayErrors']!='-1'))      {
+       if($displayErrors==2)   {       // Special value "2" enables this feature only if $TYPO3_CONF_VARS[SYS][devIPmask] matches
+               if (t3lib_div::cmpIP(t3lib_div::getIndpEnv('REMOTE_ADDR'), $GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask']))    {
+                       $displayErrors=1;
+               } else {
+                       $displayErrors=0;
+               }
+       }
+       @ini_set('display_errors', $displayErrors);
 }
 
 
index bad1f7e..68ac4b4 100755 (executable)
@@ -598,7 +598,7 @@ $TCA['be_groups'] = Array (
                        'config' => Array (
                                'type' => 'select',
                                'foreign_table' => 'be_groups',
-                               'foreign_table_where' => 'ORDER BY be_groups.title',
+                               'foreign_table_where' => 'AND be_groups.uid != ###THIS_UID### AND NOT be_groups.hidden ORDER BY be_groups.title',
                                'size' => '5',
                                'autoSizeMax' => 50,
                                'maxitems' => 20,
index b4cd4c3..4417ab5 100755 (executable)
@@ -416,7 +416,7 @@ class SC_index {
                                        </table>
 
                                        <!--
-                                               Copy right notice:
+                                               Copyright notice:
                                        -->
                                        <div id="copyrightnotice">
                                                '.$this->makeCopyrightNotice().'
index e9b9ac2..5b51ef9 100755 (executable)
@@ -144,8 +144,9 @@ if (TYPO3_MODE=='BE')       {
                        'label' => 'LLL:EXT:lang/locallang_general.php:LGL.fe_group',
                        'config' => Array (
                                'type' => 'select',
+                               'size' => 5,
+                               'maxitems' => 20,
                                'items' => Array (
-                                       Array('', 0),
                                        Array('LLL:EXT:lang/locallang_general.php:LGL.hide_at_login', -1),
                                        Array('LLL:EXT:lang/locallang_general.php:LGL.any_login', -2),
                                        Array('LLL:EXT:lang/locallang_general.php:LGL.usergroups', '--div--')
index 0ddc343..e5e06dd 100755 (executable)
@@ -85,6 +85,7 @@ CREATE TABLE fe_groups (
   lockToDomain varchar(50) DEFAULT '' NOT NULL,
   deleted tinyint(3) unsigned DEFAULT '0' NOT NULL,
   description text NOT NULL,
+  subgroup tinyblob NOT NULL,
   TSconfig blob NOT NULL,
   PRIMARY KEY (uid),
   KEY parent (pid)
@@ -306,7 +307,7 @@ CREATE TABLE tt_content (
   subheader tinytext NOT NULL,
   spaceBefore tinyint(4) unsigned DEFAULT '0' NOT NULL,
   spaceAfter tinyint(4) unsigned DEFAULT '0' NOT NULL,
-  fe_group int(11) DEFAULT '0' NOT NULL,
+  fe_group varchar(100) DEFAULT '0' NOT NULL,
   header_link tinytext NOT NULL,
   imagecaption_position varchar(6) DEFAULT '' NOT NULL,
   image_link tinytext NOT NULL,
@@ -363,7 +364,7 @@ CREATE TABLE pages (
   shortcut int(10) unsigned DEFAULT '0' NOT NULL,
   shortcut_mode int(10) unsigned DEFAULT '0' NOT NULL,
   no_cache int(10) unsigned DEFAULT '0' NOT NULL,
-  fe_group int(11) DEFAULT '0' NOT NULL,
+  fe_group varchar(100) DEFAULT '0' NOT NULL,
   subtitle tinytext NOT NULL,
   layout tinyint(3) unsigned DEFAULT '0' NOT NULL,
   target varchar(20) DEFAULT '' NOT NULL,
index 454a45e..f5b52cb 100755 (executable)
@@ -74,6 +74,7 @@
                        <label index="fe_groups">Website usergroup</label>
                        <label index="fe_groups.title">Grouptitle:</label>
                        <label index="fe_groups.lockToDomain">Lock to domain:</label>
+                       <label index="fe_groups.subgroup">Subgroups:</label>
                        <label index="sys_domain">Domain</label>
                        <label index="sys_domain.domainName">Domain:</label>
                        <label index="sys_domain.redirectTo">Redirect to:</label>
index e754f0c..3f8b76f 100755 (executable)
@@ -288,7 +288,7 @@ $TCA['fe_users'] = Array (
 $TCA['fe_groups'] = Array (
        'ctrl' => $TCA['fe_groups']['ctrl'],
        'interface' => Array (
-               'showRecordFieldList' => 'title,hidden,lockToDomain,description'
+               'showRecordFieldList' => 'title,hidden,subgroup,lockToDomain,description'
        ),
        'columns' => Array (
                'hidden' => Array (
@@ -308,6 +308,19 @@ $TCA['fe_groups'] = Array (
                                'eval' => 'trim,required'
                        )
                ),
+               'subgroup' => Array (
+                       'exclude' => 1,
+                       'label' => 'LLL:EXT:cms/locallang_tca.php:fe_groups.subgroup',
+                       'config' => Array (
+                               'type' => 'select',
+                               'foreign_table' => 'fe_groups',
+                               'foreign_table_where' => 'AND fe_groups.uid != ###THIS_UID### AND NOT fe_groups.hidden ORDER BY fe_groups.title',
+                               'size' => 4,
+                               'autoSizeMax' => 10,
+                               'minitems' => 0,
+                               'maxitems' => 20
+                       )
+               ),
                'lockToDomain' => Array (
                        'exclude' => 1,
                        'label' => 'LLL:EXT:cms/locallang_tca.php:fe_groups.lockToDomain',
@@ -349,7 +362,7 @@ $TCA['fe_groups'] = Array (
                )
        ),
        'types' => Array (
-               '0' => Array('showitem' => 'hidden;;;;1-1-1,title;;;;2-2-2,lockToDomain,description;;;;3-3-3, --div--, TSconfig;;;;5-5-5')
+               '0' => Array('showitem' => 'hidden;;;;1-1-1,title;;;;2-2-2,lockToDomain,description;;;;3-3-3, --div--, TSconfig;;;;5-5-5, subgroup;;;;6-6-6')
        )
 );
 
index 383f2f3..bacf1f3 100755 (executable)
@@ -110,8 +110,9 @@ $TCA['tt_content'] = Array (
                        'label' => 'LLL:EXT:lang/locallang_general.php:LGL.fe_group',
                        'config' => Array (
                                'type' => 'select',
+                               'size' => 5,
+                               'maxitems' => 20,
                                'items' => Array (
-                                       Array('', 0),
                                        Array('LLL:EXT:lang/locallang_general.php:LGL.hide_at_login', -1),
                                        Array('LLL:EXT:lang/locallang_general.php:LGL.any_login', -2),
                                        Array('LLL:EXT:lang/locallang_general.php:LGL.usergroups', '--div--')
index 0bd32d8..f5b2eb7 100755 (executable)
@@ -65,7 +65,6 @@
  * 1091:     function setIDfromArgV()
  * 1107:     function getPageAndRootlineWithDomain($domainStartPage)
  * 1134:     function setSysPageWhereClause()
- * 1144:     function getPagesGroupClause()
  * 1155:     function findDomainRecord($recursive=0)
  * 1174:     function pageNotFoundAndExit($reason='')
  * 1188:     function pageNotFoundHandler($code, $header='', $reason='')
                if(!is_array($groupList)) {
                        $groupList = explode(',', $groupList);
                }
-               $pageGroupList = explode(',', $row['fe_group']);
+               $pageGroupList = explode(',', $row['fe_group'] ? $row['fe_group'] : 0);
                return count(array_intersect($groupList, $pageGroupList)) > 0;
        }
 
         * @return      void
         * @access private
         */
-       function setSysPageWhereClause() {
-               $this->sys_page->where_hid_del.=' AND doktype<200';
-               $this->sys_page->where_groupAccess = $this->getPagesGroupClause();
-       }
-
-       /**
-        * Return where-clause for group access
-        *
-        * @return      string          Group where clause part
-        * @access private
-        */
-       function getPagesGroupClause() {
-               return ' AND fe_group IN ('.$this->gr_list.')';
+       function setSysPageWhereClause()        {
+               $this->sys_page->where_hid_del.=' AND pages.doktype<200';
+               $this->sys_page->where_groupAccess = $this->sys_page->getMultipleGroupsWhereClause('pages.fe_group', 'pages');
        }
 
        /**
@@ -2912,7 +2901,7 @@ if (version == "n3") {
 
                                                $GLOBALS['TT']->setTSlogMessage('Writing to logfile: OK',0);
                                        } else {
-                                               $GLOBALS['TT']->setTSlogMessage('Writing to logfile: Error - logFile did not exist or OS is Windows!',3);
+                                               $GLOBALS['TT']->setTSlogMessage('Writing to logfile: Error - logFile did not exist!',3);
                                        }
                                }
                        $GLOBALS['TT']->pull();
@@ -3282,7 +3271,7 @@ if (version == "n3") {
        function tidyHTML($content)             {
                if ($this->TYPO3_CONF_VARS['FE']['tidy'] && $this->TYPO3_CONF_VARS['FE']['tidy_path'])  {
                        $oldContent = $content;
-                       $fname = t3lib_div::tempnam('Typo3_Tidydoc_');          // Create temporary name
+                       $fname = t3lib_div::tempnam('typo3_tidydoc_');          // Create temporary name
                        @unlink ($fname);       // Delete if exists, just to be safe.
                        $fp = fopen ($fname,'wb');      // Open for writing
                        fputs ($fp, $content);  // Put $content
@@ -3511,7 +3500,7 @@ if (version == "n3") {
                        $message,
                        $headers,
                        $this->config['config']['notification_email_encoding'],
-                       $this->config['config']['notification_email_charset']?$this->config['config']['notification_email_charset']:'ISO-8859-1'
+                       $this->config['config']['notification_email_charset'] ? $this->config['config']['notification_email_charset'] : 'ISO-8859-1'
                );
        }
 
@@ -3604,7 +3593,7 @@ if (version == "n3") {
                }
 
                        // Setting charsets:
-               $this->renderCharset = $this->csConvObj->parse_charset($this->config['config']['renderCharset'] ? $this->config['config']['renderCharset'] : ($this->TYPO3_CONF_VARS['BE']['forceCharset'] ? $this->TYPO3_CONF_VARS['BE']['forceCharset'] : $this->defaultCharSet));    // REndering charset of HTML page.
+               $this->renderCharset = $this->csConvObj->parse_charset($this->config['config']['renderCharset'] ? $this->config['config']['renderCharset'] : ($this->TYPO3_CONF_VARS['BE']['forceCharset'] ? $this->TYPO3_CONF_VARS['BE']['forceCharset'] : $this->defaultCharSet));    // Rendering charset of HTML page.
                $this->metaCharset = $this->csConvObj->parse_charset($this->config['config']['metaCharset'] ? $this->config['config']['metaCharset'] : $this->renderCharset);   // Output charset of HTML page.
                $this->labelsCharset = $this->csConvObj->parse_charset($this->csConvObj->charSetArray[$this->lang] ? $this->csConvObj->charSetArray[$this->lang] : 'iso-8859-1');
                if ($this->renderCharset != $this->labelsCharset)       {
index c690abe..077e3a7 100644 (file)
@@ -163,12 +163,12 @@ class tslib_feUserAuth extends t3lib_userAuth {
                        // use 'auth' service to find the groups for the user
                $serviceChain='';
                $subType = 'getGroups'.$this->loginType;
-               while (is_object($serviceObj = t3lib_div::makeInstanceService('auth', $subType, $serviceChain))) {
+               while (is_object($serviceObj = t3lib_div::makeInstanceService('auth', $subType, $serviceChain)))        {
                        $serviceChain.=','.$serviceObj->getServiceKey();
                        $serviceObj->initAuth($subType, array(), $authInfo, $this);
 
                        $groupData = $serviceObj->getGroups($this->user, $groupDataArr);
-                       if(is_array($groupData) && count($groupData)) {
+                       if(is_array($groupData) && count($groupData))   {
                                $groupDataArr = t3lib_div::array_merge($groupDataArr, $groupData);      // Keys in $groupData should be unique ids of the groups (like "uid") so this function will override groups.
                        }
                        unset($serviceObj);
@@ -179,7 +179,7 @@ class tslib_feUserAuth extends t3lib_userAuth {
 
 
                        // use 'auth' service to check the usergroups if they are really valid
-               foreach($groupDataArr as $groupData) {
+               foreach($groupDataArr as $groupData)    {
                                // by default a group is valid
                        $validGroup = TRUE;
 
index d309b22..5210879 100755 (executable)
@@ -23,6 +23,8 @@ For instance if a page or content element was assigned access only by this group
 
 &lt;b&gt;Notice:&lt;/b&gt; The use for this option is not critical if you have multiple Website user storages, namely one for each site.</label>
                        <label index="_lockToDomain.seeAlso">fe_users:lockToDomain</label>
+                       <label index="subgroup.description">Member of other groups.</label>
+                       <label index="subgroup.details">List of other groups that this group is a member of.</label>
                        <label index="description.description">Enter a description of the group.</label>
                        <label index="description.details">This is for internal use and is just a way to put a note on what the group is for, why you created it and who should be members.
 Use it as you like.</label>
index fbe9344..a7596ab 100755 (executable)
@@ -240,13 +240,17 @@ class tx_install extends t3lib_install {
                        // ****************************
                        // Initializing incoming vars.
                        // ****************************
-               $this->INSTALL = t3lib_div::_GP("TYPO3_INSTALL");
-               $this->mode = t3lib_div::_GP("mode");
-               $this->step = t3lib_div::_GP("step");
-               if ($_GET["TYPO3_INSTALL"]["type"])     $this->INSTALL["type"] = $_GET["TYPO3_INSTALL"]["type"];
+               $this->INSTALL = t3lib_div::_GP('TYPO3_INSTALL');
+               $this->mode = t3lib_div::_GP('mode');
+               $this->step = t3lib_div::_GP('step');
+               $this->redirect_url = t3lib_div::_GP('redirect_url');
+
+               if ($_GET['TYPO3_INSTALL']['type'])     {
+                       $this->INSTALL['type'] = $_GET['TYPO3_INSTALL']['type'];
+               }
 
                if ($this->step==3)     {
-                       $this->INSTALL["type"]="database";
+                       $this->INSTALL['type']='database';
                }
 
                if ($this->mode=="123") {
@@ -259,8 +263,8 @@ class tx_install extends t3lib_install {
                        if (!$this->INSTALL["type"] || !isset($this->menuitems[$this->INSTALL["type"]]))        $this->INSTALL["type"] = "about";
                }
 
-               $this->action = $this->scriptSelf."?TYPO3_INSTALL[type]=".$this->INSTALL["type"].($this->mode?"&mode=".rawurlencode($this->mode):"").($this->step?"&step=".rawurlencode($this->step):"");
-               $this->typo3temp_path = PATH_site."typo3temp/";
+               $this->action = $this->scriptSelf.'?TYPO3_INSTALL[type]='.$this->INSTALL['type'].($this->mode?'&mode='.rawurlencode($this->mode):'').($this->step?'&step='.rawurlencode($this->step):'');
+               $this->typo3temp_path = PATH_site.'typo3temp/';
 
 
                        // ****************
@@ -288,8 +292,13 @@ BTW: This Install Tool will only work if cookies are accepted by your web browse
                        // Check if the password from TYPO3_CONF_VARS combined with uKey matches the sKey cookie. If not, ask for password.
                $sKey = $_COOKIE[$this->cookie_name];
 
-               if (md5($GLOBALS["TYPO3_CONF_VARS"]["BE"]["installToolPassword"]."|".$uKey) == $sKey || $this->checkPassword($uKey))    {
+               if (md5($GLOBALS['TYPO3_CONF_VARS']['BE']['installToolPassword'].'|'.$uKey) == $sKey || $this->checkPassword($uKey))    {
                        $this->passwordOK=1;
+                       if($this->redirect_url) {
+                               header('Location: '.$this->redirect_url);
+                       }
+               } else {
+                       $this->loginForm();
                }
 
                if ($GLOBALS["CLIENT"]["SYSTEM"]=="unix" && $GLOBALS["CLIENT"]["BROWSER"]=="konqu")     {
@@ -305,7 +314,7 @@ BTW: This Install Tool will only work if cookies are accepted by your web browse
         * @return      [type]          ...
         */
        function checkPassword($uKey)   {
-               $p = t3lib_div::_GP("password");
+               $p = t3lib_div::_GP('password');
 
                if ($p && md5($p)==$GLOBALS["TYPO3_CONF_VARS"]["BE"]["installToolPassword"])    {
                        $sKey = md5($GLOBALS["TYPO3_CONF_VARS"]["BE"]["installToolPassword"]."|".$uKey);
@@ -324,21 +333,6 @@ BTW: This Install Tool will only work if cookies are accepted by your web browse
                        }
                        return true;
                } else {
-                       $this->messageFunc_nl2br=0;
-                       $this->silent=0;
-                       $content = '<form action="'.$this->action.'" method="POST">
-                       <input type="password" name="password"><BR>
-                       <input type="submit" value="Log in"><br>
-                       <br>
-
-                       '.$this->fw('The Install Tool Password is <i>not</i> the admin password of TYPO3.<BR>
-                               If you don\'t know the current password, you can set a new one by setting the value of $TYPO3_CONF_VARS["BE"]["installToolPassword"] in typo3conf/localconf.php to the md5() hash value of the password you desire.'.
-                               ($p?"<BR><BR>The password you just tried has this md5-value: <BR><BR>".md5($p):"")
-                               ).'
-                       </form>';
-
-                       $this->message("Password", "Enter the Install Tool Password", $content,3);
-                       echo $this->outputWrapper($this->printAll());
                                // Bad password, send warning:
                        if ($p) {
                                $wEmail = $GLOBALS["TYPO3_CONF_VARS"]["BE"]["warning_email_addr"];
@@ -354,11 +348,33 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv("REMOTE_ADDR")."' (".t3lib_div::getIndp
                                        );
                                }
                        }
-
                        return false;
                }
        }
 
+       function loginForm()    {
+               $p = t3lib_div::_GP('password');
+               $redirect_url = $this->redirect_url ? $this->redirect_url : $this->action;
+
+               $this->messageFunc_nl2br=0;
+               $this->silent=0;
+
+               $content = '<form action="index.php" method="POST">
+                       <input type="password" name="password"><BR>
+                       <input type="hidden" name="redirect_url" value="'.$redirect_url.'">
+                       <input type="submit" value="Log in"><br>
+                       <br>
+
+                       '.$this->fw('The Install Tool Password is <i>not</i> the admin password of TYPO3.<BR>
+                               If you don\'t know the current password, you can set a new one by setting the value of $TYPO3_CONF_VARS["BE"]["installToolPassword"] in typo3conf/localconf.php to the md5() hash value of the password you desire.'.
+                               ($p ? '<BR><BR>The password you just tried has this md5-value: <BR><BR>'.md5($p) : '')
+                               ).'
+                       </form>';
+
+               $this->message('Password', 'Enter the Install Tool Password', $content,3);
+               echo $this->outputWrapper($this->printAll());
+       }
+
        /**
         * Calling function that checks system, IM, GD, dirs, database and lets you alter localconf.php
         * This method is called from init.php to start the install Tool.
@@ -1684,43 +1700,46 @@ From sub-directory:
                        //  2 = required, has to be writable
 
                $checkWrite=array(
-                       "typo3temp/" => array("The folder is used by both the frontend (FE) and backend interface (TBE) for image manipulated files.",2,"dir_typo3temp"),
-#                      TYPO3_mainDir."temp/" => array("The folder is used by the backend interface only (TBE) for icons, pane tabs and click-menu items. The directory is usually not empty in the distribution, but you should be able to clear it out and TYPO3 should generate new files automatically.",1,"dir_temp"),
-                       "typo3conf/" => array("This directory contains the local configuration files of your website. TYPO3 must be able to write to these configuration files during setup and when the Extension Manager (EM) installs extensions.",2),
-                       "typo3conf/ext/" => array("Location for local extensions. Must be writable if the Extension Manager is supposed to install extensions for this website.",0),
-                       TYPO3_mainDir."ext/" => array("Location for global extensions. Must be writable if the Extension Manager is supposed to install extensions globally in the source.",-1),
-                       "uploads/" => array("Location for uploaded files from RTE + in the subdirs for tables.",2),
-                       "uploads/pics/" => array("Typical location for uploaded files (images especially).",0),
-                       "uploads/media/" => array("Typical location for uploaded files (non-images especially).",0),
-                       "uploads/tf/" => array("Typical location for uploaded files (TS template resources).",0),
-                       "fileadmin/" => array("Location for local files such as templates, independent uploads etc.",-1),
-                       "fileadmin/_temp_/" => array("Typical temporary location for default upload of files by administrators.",0),
+                       'typo3temp/' => array('This folder is used by both the frontend (FE) and backend (BE) interface for image manipulated files.',2,'dir_typo3temp'),
+                       'typo3temp/pics/' => array('This folder is part of the typo3temp/ section. It needs to be writable, too.',2,'dir_typo3temp'),
+                       'typo3temp/temp/' => array('This folder is part of the typo3temp/ section. It needs to be writable, too.',2,'dir_typo3temp'),
+                       'typo3temp/llxml/' => array('This folder is part of the typo3temp/ section. It needs to be writable, too.',2,'dir_typo3temp'),
+                       'typo3temp/cs/' => array('This folder is part of the typo3temp/ section. It needs to be writable, too.',2,'dir_typo3temp'),
+                       'typo3temp/GB/' => array('This folder is part of the typo3temp/ section. It needs to be writable, too.',2,'dir_typo3temp'),
+                       'typo3conf/' => array('This directory contains the local configuration files of your website. TYPO3 must be able to write to these configuration files during setup and when the Extension Manager (EM) installs extensions.',2),
+                       'typo3conf/ext/' => array('Location for local extensions. Must be writable if the Extension Manager is supposed to install extensions for this website.',0),
+                       TYPO3_mainDir.'ext/' => array('Location for global extensions. Must be writable if the Extension Manager is supposed to install extensions globally in the source.',-1),
+                       'uploads/' => array('Location for uploaded files from RTE + in the subdirs for tables.',2),
+                       'uploads/pics/' => array('Typical location for uploaded files (images especially).',0),
+                       'uploads/media/' => array('Typical location for uploaded files (non-images especially).',0),
+                       'uploads/tf/' => array('Typical location for uploaded files (TS template resources).',0),
+                       'fileadmin/' => array('Location for local files such as templates, independent uploads etc.',-1),
+                       'fileadmin/_temp_/' => array('Typical temporary location for default upload of files by administrators.',0),
                );
 
-               reset($checkWrite);
-               while(list($relpath,$descr)=each($checkWrite))  {
+               foreach($checkWrite as $relpath => $descr)      {
                        // Check typo3temp/
                        $general_message = $descr[0];
                        if (!@is_dir(PATH_site.$relpath))       {
                                if ($descr[1])  {       // required...
-                                       $this->message($ext, $relpath." directory does not exist","
-                                       <em>Full path: ".PATH_site.$relpath."</em>
-                                       ".$general_message."
+                                       $this->message($ext, $relpath.' directory does not exist','
+                                       <em>Full path: '.PATH_site.$relpath.'</em>
+                                       '.$general_message.'
 
-                                       This error should not occur as ".$relpath." must always be accessible in the root of a TYPO3 website.
-                                       ",3);
+                                       This error should not occur as '.$relpath.' must always be accessible in the root of a TYPO3 website.
+                                       ',3);
                                } else {
-                                       if ($descr[1] == 0) {
+                                       if ($descr[1] == 0)     {
                                                $msg = 'This directory does not necessarily have to exist but if it does it must be writable.';
                                        } else {
                                                $msg = 'This directory does not necessarily have to exist and if it does it can be writable or not.';
                                        }
-                                       $this->message($ext, $relpath." directory does not exist","
-                                       <em>Full path: ".PATH_site.$relpath."</em>
-                                       ".$general_message."
+                                       $this->message($ext, $relpath.' directory does not exist','
+                                       <em>Full path: '.PATH_site.$relpath.'</em>
+                                       '.$general_message.'
 
-                                       ".$msg."
-                                       ",2);
+                                       '.$msg.'
+                                       ',2);
                                }
                        } else {
                                $file = PATH_site.$relpath.$uniqueName;
@@ -1728,21 +1747,21 @@ From sub-directory:
                                if (@is_file($file))    {
                                        unlink($file);
                                        if ($descr[2])  { $this->config_array[$descr[2]]=1; }
-                                       $this->message($ext, $relpath." writable","",-1);
+                                       $this->message($ext, $relpath.' writable','',-1);
                                } else {
                                        $severity = ($descr[1]==2 || $descr[1]==0) ? 3 : 2;
                                        if ($descr[1] == 0 || $descr[1] == 2) {
-                                               $msg = "The directory ".$relpath." must be writable!";
+                                               $msg = 'The directory '.$relpath.' must be writable!';
                                        } elseif ($descr[1] == -1 || $descr[1] == 1) {
-                                               $msg = "The directory ".$relpath." does not neccesarily have to be writable.";
+                                               $msg = 'The directory '.$relpath.' does not neccesarily have to be writable.';
                                        }
-                                       $this->message($ext, $relpath." directory not writable","
-                                       <em>Full path: ".$file."</em>
-                                       ".$general_message."
+                                       $this->message($ext, $relpath.' directory not writable','
+                                       <em>Full path: '.$file.'</em>
+                                       '.$general_message.'
 
-                                       Tried to write this file (with touch()) but didn't succeed.
-                                       ".$msg."
-                                       ",$severity);
+                                       Tried to write this file (with touch()) but didn\'t succeed.
+                                       '.$msg.'
+                                       ',$severity);
                                }
                        }
                }
@@ -2004,7 +2023,7 @@ From sub-directory:
                                        $out.=$this->wrapInCells("Site name:", '<input type="text" name="TYPO3_INSTALL[localconf.php][sitename]" value="'.htmlspecialchars($GLOBALS["TYPO3_CONF_VARS"]["SYS"]["sitename"]).'">');
                                        $out.=$this->wrapInCells("", "<BR>");
                                        $out.='<script type="text/javascript" src="../md5.js"></script><script type="text/javascript">function generateEncryptionKey(key) {time=new Date(); key=MD5(key)+MD5(time.getMilliseconds().toString());while(key.length<66){key=key+MD5(key)};return key;}</script>';
-                                       $out.=$this->wrapInCells("Encryption key:", '<input type="text" name="TYPO3_INSTALL[localconf.php][encryptionKey]" value="'.htmlspecialchars($GLOBALS["TYPO3_CONF_VARS"]["SYS"]["encryptionKey"]).'"><br /><input type="button" onclick="document.forms[\'setupGeneral\'].elements[\'TYPO3_INSTALL[localconf.php][encryptionKey]\'].value=generateEncryptionKey(document.forms[\'setupGeneral\'].elements[\'TYPO3_INSTALL[localconf.php][encryptionKey]\'].value);" value="Generate random key">');
+                                       $out.=$this->wrapInCells("Encryption key:", '<a name="set_encryptionKey" /><input type="text" name="TYPO3_INSTALL[localconf.php][encryptionKey]" value="'.htmlspecialchars($GLOBALS["TYPO3_CONF_VARS"]["SYS"]["encryptionKey"]).'"><br /><input type="button" onclick="document.forms[\'setupGeneral\'].elements[\'TYPO3_INSTALL[localconf.php][encryptionKey]\'].value=generateEncryptionKey(document.forms[\'setupGeneral\'].elements[\'TYPO3_INSTALL[localconf.php][encryptionKey]\'].value);" value="Generate random key">');
                                        $out.=$this->wrapInCells("", "<BR>");
 
                                                // Other
@@ -4375,11 +4394,18 @@ $out='
 
        /**
         * Setting a message in the message-log and sets the fatalError flag if error type is 3.
+        *
+        * @param       string          Section header
+        * @param       string          A short description
+        * @param       string          A long (more detailed) description
+        * @param       integer         -1=OK sign, 0=message, 1=notification, 2=warning , 3=error
+        * @param       boolean         Print message also in "Advanced" mode (not only in 1-2-3 mode)
+        * @return      void
         */
-       function message($head, $short_string="", $long_string="", $type=0, $force=0)   {               // type: -1=OK sign, 0=message, 1=notification, 2=warning , 3=error
-               if (!$force && $this->mode=="123" && $type<2)   {return;}       // Return directly if mode-123 is enabled.
+       function message($head, $short_string='', $long_string='', $type=0, $force=0)   {
+               if (!$force && $this->mode=='123' && $type<2)   { return; }     // Return directly if mode-123 is enabled.
 
-               if ($type==3)   {$this->fatalError=1;}
+               if ($type==3)   { $this->fatalError=1; }
                if ($this->messageFunc_nl2br)   {
                        $long_string = nl2br(trim($long_string));
                } else {
@@ -4391,43 +4417,43 @@ $out='
        /**
         * This "prints" a section with a message to the ->sections array
         *
-        * @param       [type]          $head: ...
-        * @param       [type]          $short_string: ...
-        * @param       [type]          $long_string: ...
-        * @param       [type]          $type: ...
-        * @return      [type]          ...
+        * @param       string          Section header
+        * @param       string          A short description
+        * @param       string          A long (more detailed) description
+        * @param       integer         -1=OK sign, 0=message, 1=notification, 2=warning , 3=error
+        * @return      void
         */
        function printSection($head, $short_string, $long_string, $type)        {
-               $icon="";
+               $icon='';
 
-               $bgCol =' bgcolor=#D9D5C9';
+               $bgCol =' bgcolor="#D9D5C9"';   // The default color
                switch($type)   {
-                       case "3":
-                               $bgCol =' bgcolor=red';
+                       case '3':
+                               $bgCol =' bgcolor="red"';
                                $icon = 't3lib/gfx/icon_fatalerror.gif';
                        break;
-                       case "2":
-//                             $bgCol =' bgcolor=#9BA1A8';
+                       case '2':
+                               $bgCol =' bgcolor="#9BA1A8"';
                                $icon = 't3lib/gfx/icon_warning.gif';
                        break;
-                       case "1":
-//                             $bgCol =' bgcolor=#ABBBB4';
+                       case '1':
+                               // $bgCol =' bgcolor="#ABBBB4"';
                                $icon = 't3lib/gfx/icon_note.gif';
                        break;
-                       case "-1":
-//                             $bgCol =' bgcolor=yellow';
+                       case '-1':
+                               // $bgCol =' bgcolor="yellow"';
                                $icon = 't3lib/gfx/icon_ok.gif';
                        break;
                        default:
-                               $bgCol =' bgcolor='.t3lib_div::modifyHTMLcolor("#ABBBB4",+40,+30,+40);
+                               $bgCol =' bgcolor="#D3D9DC"';
                        break;
                }
                if (!trim($short_string))       {
-                       $this->sections[$head][]="";
+                       $this->sections[$head][]='';
                } else {
                        $this->sections[$head][]='
-                       <tr><td'.$bgCol.' nowrap>'.($icon?'<img src="'.$this->backPath.$icon.'" width=18 height=16 align=top>':'').'<strong>'.$this->fw($short_string).'</strong></td></tr>'.(trim($long_string)?'
-                       <tr><td>'.$this->fw($long_string).'<BR><BR></td></tr>' : '');
+                       <tr><td'.$bgCol.' nowrap>'.($icon?'<img src="'.$this->backPath.$icon.'" width="18" height="16" align="top">':'').'<strong>'.$this->fw($short_string).'</strong></td></tr>'.(trim($long_string)?'
+                       <tr><td>'.$this->fw($long_string).'<br><br></td></tr>' : '');
                }
        }
 
index ae46901..abeebb8 100644 (file)
@@ -131,12 +131,13 @@ class tx_sv_auth extends tx_sv_authbase   {
 
                $groupDataArr = array();
 
-               if($this->mode=='getGroupsFE')  {
+               if($this->mode=='getGroupsFE')  {
 
                        $groups = array();
-
                        if (is_array($user) && $user[$this->db_user['usergroup_column']])       {
-                               $groups = t3lib_div::intExplode(',',$user[$this->db_user['usergroup_column']]);
+                               $groupList = $user[$this->db_user['usergroup_column']];
+                               $groups = array();
+                               $this->getSubGroups($groupList,'',$groups);
                        }
 
                                // ADD group-numbers if the IPmask matches.
@@ -172,6 +173,47 @@ class tx_sv_auth extends tx_sv_authbase    {
 
                return $groupDataArr;
        }
+
+       /**
+        * Fetches subgroups of groups. Function is called recursively for each subgroup.
+        * Function was previously copied from t3lib_userAuthGroup->fetchGroups and has been slightly modified.
+        *
+        * @param       string          Commalist of fe_groups uid numbers
+        * @param       string          List of already processed fe_groups-uids so the function will not fall into a eternal recursion.
+        * @return      array
+        * @access private
+        */
+       function getSubGroups($grList, $idList='', &$groups)    {
+
+                       // Fetching records of the groups in $grList (which are not blocked by lockedToDomain either):
+               $lockToDomain_SQL = ' AND (lockToDomain=\'\' OR lockToDomain=\''.$this->authInfo['HTTP_HOST'].'\')';
+               if (!$this->authInfo['showHiddenRecords'])      $hiddenP = 'AND hidden=0 ';
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,subgroup', 'fe_groups', 'deleted=0 '.$hiddenP.' AND uid IN ('.$grList.')'.$lockToDomain_SQL);
+
+               $groupRows = array();   // Internal group record storage
+
+                       // The groups array is filled
+               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))      {
+                       if(!in_array($row['uid'], $groups))     { $groups[] = $row['uid']; }
+                       $groupRows[$row['uid']] = $row;
+               }
+
+                       // Traversing records in the correct order
+               $include_staticArr = t3lib_div::intExplode(',', $grList);
+               foreach($include_staticArr as $uid)     {       // traversing list
+
+                               // Get row:
+                       $row=$groupRows[$uid];
+                       if (is_array($row) && !t3lib_div::inList($idList,$uid)) {       // Must be an array and $uid should not be in the idList, because then it is somewhere previously in the grouplist
+
+                                       // Include sub groups
+                               if (trim($row['subgroup']))     {
+                                       $theList = implode(',',t3lib_div::intExplode(',',$row['subgroup']));    // Make integer list
+                                       $this->getSubGroups($theList, $idList.','.$uid, $groups);               // Call recursively, pass along list of already processed groups so they are not recursed again.
+                               }
+                       }
+               }
+       }
 }
 
 
index 7327ce2..4050bfd 100644 (file)
@@ -61,18 +61,18 @@ require_once(PATH_t3lib.'class.t3lib_svbase.php');
  */
 class tx_sv_authbase extends t3lib_svbase      {
 
-       var $pObj;                                              // Parent object
+       var $pObj;                      // Parent object
 
-       var $mode;                                              // Subtype of the service which is used to call the service.
+       var $mode;                      // Subtype of the service which is used to call the service.
 
-       var $login = array();                           // Submitted login form data
-       var $authInfo = array();                                // Various data
+       var $login = array();           // Submitted login form data
+       var $authInfo = array();        // Various data
 
-       var $db_user = array();                 // User db table definition
-       var $db_groups = array();                       // Usergroups db table definition
+       var $db_user = array();         // User db table definition
+       var $db_groups = array();       // Usergroups db table definition
 
        var $writeAttemptLog = false;   // If the writelog() functions is called if a login-attempt has be tried without success
-       var $writeDevLog = false;               // If the t3lib_div::devLog() function should be used
+       var $writeDevLog = false;       // If the t3lib_div::devLog() function should be used
 
 
        /**
index 6076364..f6a3194 100755 (executable)
@@ -56,7 +56,7 @@
  *  452:     function removePointerObjects($objArray)
  *  471:     function linkToObj($str,$uid,$objString='')
  *  484:     function printTable($table,$objString,$objTree)
- *  565:     function linkProperty($str,$propertyVal,$prefix,$datatype)
+ *  565:     function linkProperty($str,$propertyName,$prefix,$datatype)
  *
  * TOTAL FUNCTIONS: 13
  * (This index is automatically created/updated by the extension "extdeveval")
@@ -154,13 +154,11 @@ class SC_wizard_tsconfig {
                $this->show = t3lib_div::_GP('show');
                $this->objString = t3lib_div::_GP('objString');
                $this->onlyProperty = t3lib_div::_GP('onlyProperty');
-
                        // Preparing some JavaScript code:
                if (!is_array($this->P['fieldChangeFunc']))     $this->P['fieldChangeFunc']=array();
                unset($this->P['fieldChangeFunc']['alert']);
-               reset($this->P['fieldChangeFunc']);
                $update='';
-               while(list($k,$v)=each($this->P['fieldChangeFunc']))    {
+               foreach($this->P['fieldChangeFunc'] as $k=>$v)  {
                        $update.= '
                        window.opener.'.$v;
                }
@@ -180,27 +178,40 @@ class SC_wizard_tsconfig {
                ';
 
                $this->doc->JScode.=$this->doc->wrapScriptTags('
-                       function checkReference()       {       //
+                       function checkReference_name()  {       // Checks if the input field containing the name exists in the document
                                if (window.opener && window.opener.document && window.opener.document.'.$this->P['formName'].' && window.opener.document.'.$this->P['formName'].'["'.$this->P['itemName'].'"] ) {
                                        return window.opener.document.'.$this->P['formName'].'["'.$this->P['itemName'].'"];
-                               } else {
-                                       close();
                                }
                        }
-                       function setValue(input)        {       //
-                               var field = checkReference();
-                               if (field)      {
-                                       field.value=input+"\n"+field.value;
+                       function checkReference_value() {       // Checks if the input field containing the value exists in the document
+                               if (window.opener && window.opener.document && window.opener.document.'.$this->P['formName'].' && window.opener.document.'.$this->P['formName'].'["'.$this->P['itemValue'].'"] )        {
+                                       return window.opener.document.'.$this->P['formName'].'["'.$this->P['itemValue'].'"];
+                               }
+                       }
+                       function setValue(field,value)  {
+                               var nameField = checkReference_name();
+                               var valueField = checkReference_value();
+                               if (nameField)  {
+                                       if (valueField) {       // This applies to the TS Object Browser module
+                                               nameField.value=field;
+                                               valueField.value=value;
+                                       } else {                // This applies to the Info/Modify module
+                                               nameField.value=field+"="+value+"\n"+nameField.value;
+                                       }
                                        '.$update.'
                                        window.opener.focus();
                                }
                                close();
                        }
-                       function getValue()     {       //
-                               var field = checkReference();
-                               if (field)      return field.value;
+                       function getValue()     {       // This is never used. Remove it?
+                               var field = checkReference_name();
+                               if (field)      {
+                                       return field.value;
+                               } else {
+                                       close();
+                               }
                        }
-                       function mixerField(cmd,objString)      {       //
+                       function mixerField(cmd,objString)      {
                                var temp;
                                switch(cmd)     {
                                        case "Indent":
@@ -219,7 +230,7 @@ class SC_wizard_tsconfig {
                                        break;
                                }
                        }
-                       function str_replace(match,replace,string)      {       //
+                       function str_replace(match,replace,string)      {
                                var input = ""+string;
                                var matchStr = ""+match;
                                if (!matchStr)  {return string;}
@@ -234,7 +245,7 @@ class SC_wizard_tsconfig {
                                output+=""+input.substr(pointer);
                                return output;
                        }
-                       function jump(show,objString)   {       //
+                       function jump(show,objString)   {
                                document.location = "'.t3lib_div::linkThisScript(array('show'=>'','objString'=>'')).'&show="+show+"&objString="+objString;
                        }
                ');
@@ -562,27 +573,25 @@ class SC_wizard_tsconfig {
         * @param       string          Data type
         * @return      string          Linked $str
         */
-       function linkProperty($str,$propertyVal,$prefix,$datatype)      {
+       function linkProperty($str,$propertyName,$prefix,$datatype)     {
                $out='';
 
                        // Setting preset value:
                if (strstr($datatype,'boolean'))        {
-                       $propertyVal.='=1';     // add preset "=1" to boolean values.
-               } else {
-                       $propertyVal.='=';      // add preset "="
+                       $propertyVal='1';       // preset "1" to boolean values.
                }
 
                        // Adding mixer features; The plus icon:
                if(!$this->onlyProperty)        {
-                       $aOnClick = 'document.editform.mixer.value=unescape(\'  '.rawurlencode($propertyVal).'\')+\'\n\'+document.editform.mixer.value; return false;';
+                       $aOnClick = 'document.editform.mixer.value=unescape(\'  '.rawurlencode($propertyName.'='.$propertyVal).'\')+\'\n\'+document.editform.mixer.value; return false;';
                        $out.= '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.
                                        '<img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/plusbullet2.gif','width="18" height="16"').' title="'.$GLOBALS['LANG']->getLL('tsprop_addToList',1).'" align="top" alt="" />'.
                                        '</a>';
-                       $propertyVal = $prefix.'.'.$propertyVal;
+                       $propertyName = $prefix.'.'.$propertyName;
                }
 
                        // Wrap string:
-               $aOnClick = 'setValue(unescape(\''.rawurlencode($propertyVal).'\')); return false;';
+               $aOnClick = 'setValue(unescape(\''.rawurlencode($propertyName).'\'),unescape(\''.rawurlencode($propertyVal).'\')); return false;';
                $out.= '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.$str.'</a>';
 
                        // Return link: