* Fixed bug #3862: Tools>User Admin allows switching to disabled user
authorSebastian Kurfürst <sebastian.kurfuerst@typo3.org>
Fri, 15 Sep 2006 13:23:56 +0000 (13:23 +0000)
committerSebastian Kurfürst <sebastian.kurfuerst@typo3.org>
Fri, 15 Sep 2006 13:23:56 +0000 (13:23 +0000)
        * Fixed bug #3863: Delete temp_CACHED_* files from "Edit files in typo3conf/:"

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

ChangeLog
typo3/sysext/beuser/mod/index.php
typo3/sysext/install/mod/class.tx_install.php

index 6850539..b7d5aff 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-09-15  Sebastian Kurfuerst  <sebastian@garbage-group.de>
+
+       * Fixed bug #3862: Tools>User Admin allows switching to disabled user
+       * Fixed bug #3863: Delete temp_CACHED_* files from "Edit files in typo3conf/:"
+
 2006-09-14  Michael Stucki  <michael@typo3.org>
 
        * Fixed bug #4219: := appendString() did not work because the check was made for "apppendString" (typo)
index 031f2bd..f2d35b3 100755 (executable)
@@ -1355,10 +1355,13 @@ class SC_mod_tools_be_user_index {
                                $uListArr=array();
                                reset($dat['users']);
                                while(list(,$uDat)=each($dat['users'])) {
-                                       $uListArr[] = '<tr><td width="130">'.t3lib_iconWorks::getIconImage('be_users',$uDat,$GLOBALS['BACK_PATH'],'align="top" title="'.$uDat['uid'].'"').$this->linkuser($uDat['username'],$uDat).'&nbsp;&nbsp;</td><td nowrap="nowrap">'.$this->elementLinks('be_users',$uDat).
-                                               '<a href="'.t3lib_div::linkThisScript(array('SwitchUser'=>$uDat['uid'])).'" target="_top"><img '.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/su.gif').' border="0" align="top" title="'.htmlspecialchars('Switch user to: '.$uDat['username']).' [change-to mode]" alt="" /></a>'.
-                                               '<a href="'.t3lib_div::linkThisScript(array('SwitchUser'=>$uDat['uid'], 'switchBackUser' => 1)).'" target="_top"><img '.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/su_back.gif').' border="0" align="top" title="'.htmlspecialchars('Switch user to: '.$uDat['username']).' [switch-back mode]" alt="" /></a>'.
-                                               '</td></tr>';
+                                       $uItem = '<tr><td width="130">'.t3lib_iconWorks::getIconImage('be_users',$uDat,$GLOBALS['BACK_PATH'],'align="top" title="'.$uDat['uid'].'"').$this->linkuser($uDat['username'],$uDat).'&nbsp;&nbsp;</td><td nowrap="nowrap">'.$this->elementLinks('be_users',$uDat);
+                                       if (!$uDat['disable'] && ($uDat['starttime'] == 0 || $uDat['starttime'] < time()) && ($uDat['endtime'] == 0 || $uDat['endtime'] > time()))      {
+                                               $uItem .= '<a href="'.t3lib_div::linkThisScript(array('SwitchUser'=>$uDat['uid'])).'" target="_top"><img '.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/su.gif').' border="0" align="top" title="'.htmlspecialchars('Switch user to: '.$uDat['username']).' [change-to mode]" alt="" /></a>'.
+                                                       '<a href="'.t3lib_div::linkThisScript(array('SwitchUser'=>$uDat['uid'], 'switchBackUser' => 1)).'" target="_top"><img '.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/su_back.gif').' border="0" align="top" title="'.htmlspecialchars('Switch user to: '.$uDat['username']).' [switch-back mode]" alt="" /></a>';
+                                       }
+                                       $uItem .= '</td></tr>';
+                                       $uListArr[] = $uItem;
                                }
                                $allCells['USERS'] = '<table border="0" cellspacing="0" cellpadding="0" width="100%">'.implode('',$uListArr).'</table>';
 
index b09724c..a987dff 100755 (executable)
@@ -909,13 +909,17 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                        }
                }
 
-
                        // Filelist:
                $typo3conf_files = t3lib_div::getFilesInDir($EDIT_path,'',1,1);
                reset($typo3conf_files);
                $lines=array();
                $fileFound = 0;
                while(list($k,$file)=each($typo3conf_files))    {
+                               // Delete temp_CACHED files if option is set
+                       if ( $this->INSTALL['delTempCached'] && preg_match('|/temp_CACHED_[a-z0-9_]+\.php|', $file))    {
+                               unlink($file);
+                               continue;
+                       }
                        if ($this->INSTALL['typo3conf_files'] && !strcmp($this->INSTALL['typo3conf_files'],$file))      {
                                $wrap=array('<strong><span style="color:navy;">','</span></strong>');
                                $fileFound = 1;
@@ -931,6 +935,9 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                        </form>';
                }
 
+                       // create link for deleting temp_CACHED files
+               $fileList .= '<br /><br /><a href="'.$this->action.'&TYPO3_INSTALL[delTempCached]=1">Delete temp_CACHED* files</a>';
+
                if ($fileFound && @is_file($this->INSTALL['typo3conf_files']))  {
                        $this->headerStyle = '
                        <style type="text/css"><!--