#8588: Admin tools -> User Admin -> List users online broken when [BE][lockIP] is...
authorMartin Kutschker <martin.t.kutschker@blackbox.net>
Thu, 18 Sep 2008 21:37:10 +0000 (21:37 +0000)
committerMartin Kutschker <martin.t.kutschker@blackbox.net>
Thu, 18 Sep 2008 21:37:10 +0000 (21:37 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@4149 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/beuser/mod/index.php

index c9678a6..9ea068e 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2008-09-18  Martin Kutschker  <masi@typo3.org>
 
        * Followup to bugfix #8950: clean up code
+       * Fix bug #8588: Admin tools -> User Admin -> List users online broken when [BE][lockIP] is set to < 4
 
 2008-09-18  Stanislas Rolland  <typo3@sjbr.ca>
 
index 762548b..10a1d6f 100755 (executable)
@@ -1565,14 +1565,22 @@ class SC_mod_tools_be_user_index {
                        // Process and visualized each active session as a table row:
                if (is_array($sessions)) {
                        foreach ($sessions as $session) {
-                               $hostName = ($session['ses_iplock'] != '[DISABLED]' ? gethostbyaddr($session['ses_iplock']) : '[DISABLED]');
+                               $ip = $session['ses_iplock'];
+                               $hostName = '';
+                               if ($session['ses_iplock'] == '[DISABLED]' || $GLOBALS['TYPO3_CONF_VARS']['BE']['lockIP'] == 0) {
+                                       $ip = '-';
+                               } elseif ($GLOBALS['TYPO3_CONF_VARS']['BE']['lockIP'] == 4) {
+                                       $hostName = ' title="' . @gethostbyaddr($session['ses_iplock']) . '"';
+                               } else {
+                                       $ip .= str_repeat('.*', 4-$GLOBALS['TYPO3_CONF_VARS']['BE']['lockIP']);
+                               }
                                $outTable .= '
                                        <tr class="bgColor4" height="17" valign="top">' .
                                                '<td nowrap="nowrap">' .
                                                        date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'].' '.$GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'], $session['ses_tstamp']) .
                                                '</td>' .
                                                '<td nowrap="nowrap">' .
-                                                       '<span title="'.$hostName.'">'.$session['ses_iplock'].'</span>' .
+                                                       '<span'.$hostName.'>'.$ip.'</span>' .
                                                '</td>' .
                                                '<td width="130">' .
                                                        t3lib_iconWorks::getIconImage('be_users',$session,$GLOBALS['BACK_PATH'],'align="top" title="'.$session['uid'].'"').htmlspecialchars($session['username']).'&nbsp;' .