Bug #18895

Admin tools -> User Admin -> List users online broken when [BE][lockIP] is set to < 4

Added by Peter Kraume over 11 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2008-06-02
Due date:
% Done:

0%

TYPO3 Version:
4.2
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I've set [BE][lockIP] to 0. Then Admin tools -> User Admin -> List users online is broken:

Warning: gethostbyaddr() [function.gethostbyaddr]: Address is not a valid IPv4 or IPv6 address in /typo3_src-4.2.0/typo3/sysext/beuser/mod/index.php on line 1558

In the column "host", the IP adress is shown truncated (see attached screenshot).

Furthermore the drop down list to get back to Compare User Settings is inaccessibile then.

A similar error occurs in TYPO 4.1.x
(issue imported from #M8588)

typo3_bug.png View (32.1 KB) Administrator Admin, 2008-06-02 15:08

8588.diff View (791 Bytes) Administrator Admin, 2008-07-04 16:17

8588_2.diff View (811 Bytes) Administrator Admin, 2008-07-04 18:10

History

#1 Updated by Steffen Kamper over 11 years ago

first:
[BE][lockIP] is per default 4. this means in usersession the ip is saved in 4 parts
aaa.bbb.ccc.ddd
you can reduce this info by [BE][lockIP] , but valid is only 1-4

Your setting 0 will be changed to 1 and saves only aaa

Ok, the error- here this only works with 4 parts, so it has to be fixed like

$hostByAddr = @gethostbyaddr($session['ses_iplock']) ? gethostbyaddr($session['ses_iplock']) : '';
$hostName = ($session['ses_iplock'] != '[DISABLED]' ? $hostByAddr : '[DISABLED]');

#2 Updated by Steffen Kamper over 11 years ago

i've changed minimal, as if gethostbyaddr fails, i show now $session['ses_iplock'] instead of empty (use other section if want to hide)

Also available in: Atom PDF