Logging user IP's

Looking for an Extension? Have an Extension request? Post your request here for help. (Note: This forum is community supported; while there is an Extensions Development Team, said team does not dedicate itself to handling requests in this forum)
Scam Warning
Post Reply
testingground
Registered User
Posts: 174
Joined: Thu Apr 21, 2016 10:59 am

Logging user IP's

Post by testingground » Tue Apr 30, 2019 10:29 am

I need to log user IP's when they login.
Im looking for a particular IP range.

Ive installed viewtopic.php?f=456&t=2407761&p=14646236#p14646236
but this doesnt appear to be logging all users and if a user has the 'remain logged in' ticked then it doesnt get recorded. Also it only lists the registered IP address and not he current one.

Is there a way of using the ip data from the 'who is online' link?
A way of recording the user and IP into a log file?
Dont need nothing flashy just a simple log file would do that I could pull of the server and check in notepad.

Thanks

User avatar
david63
Registered User
Posts: 16187
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Logging user IP's

Post by david63 » Tue Apr 30, 2019 10:50 am

testingground wrote:
Tue Apr 30, 2019 10:29 am
Also it only lists the registered IP address and not he current one.
That is not true - it uses the user's current IP address.
testingground wrote:
Tue Apr 30, 2019 10:29 am
but this doesnt appear to be logging all users and if a user has the 'remain logged in' ticked then it doesnt get recorded
How can it log the user when then are constantly logged it - there is nothing to log.
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

testingground
Registered User
Posts: 174
Joined: Thu Apr 21, 2016 10:59 am

Re: Logging user IP's

Post by testingground » Tue Apr 30, 2019 11:44 am

by default your extension only logs the original registration IP.
I wouldnt post that if I hadnt checked.

I looked at someone who was logged in via the 'who is online' link and the IP was different to the one shown by your extension. I checked your extensions reported IP address and it was the users original registration IP.

I made an edit to the listener.php file as suggested by someone on your extension thread and this made it report the current IP. however as you know it wont log users currently logged in.

The 'who is online' link displays the current IP address (not the registered IP) so it should be possible to pull that data from the database?

User avatar
paulie
Registered User
Posts: 90
Joined: Thu Mar 30, 2017 3:41 pm
Location: Hull, East Yorkshire.

Re: Logging user IP's

Post by paulie » Tue Apr 30, 2019 2:22 pm

testingground wrote:
Tue Apr 30, 2019 11:44 am
by default your extension only logs the original registration IP.
I wouldnt post that if I hadnt checked.

I looked at someone who was logged in via the 'who is online' link and the IP was different to the one shown by your extension. I checked your extensions reported IP address and it was the users original registration IP.

I made an edit to the listener.php file as suggested by someone on your extension thread and this made it report the current IP. however as you know it wont log users currently logged in.

The 'who is online' link displays the current IP address (not the registered IP) so it should be possible to pull that data from the database?
if you click on the 'information' link [ i ] on a Members post, it should take you to the MCP where it will show the list of IP's that particular Member has posted from. Is that the information you want?
'Life in the Air Age isn't all the brochures say ...'

testingground
Registered User
Posts: 174
Joined: Thu Apr 21, 2016 10:59 am

Re: Logging user IP's

Post by testingground » Tue Apr 30, 2019 2:34 pm

No because if a member hasnt made any posts their is no IP's logged.
I want to know the IP's of all members when they login.

User avatar
</Solidjeuh>
Registered User
Posts: 1615
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: Logging user IP's

Post by </Solidjeuh> » Tue Apr 30, 2019 3:10 pm

Register a free account & Play!!
~~~ https://www.solidjeuh.be ~~~
Have a secret? --> https://www.tellyoursecrets.eu

User avatar
EA117
Registered User
Posts: 644
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Logging user IP's

Post by EA117 » Tue Apr 30, 2019 3:36 pm

</Solidjeuh> wrote:
Tue Apr 30, 2019 3:10 pm
There is this: viewtopic.php?t=2419756
Looks like that extension sits on core.session_create_after in order to be able to capture the automatic login / re-use of a previous login, in addition to the "actual successful completion of a login form" (core.login_box_redirect) event. So that one may be logging what you're interested in, if OP was wanting more than just "completion of a login dialog" logged.

Ideally it seems like whatever phpBB says a user's "last visited" time was, there should be a logged event showing what IP they had connected from at that time.
david63 wrote:
Tue Apr 30, 2019 10:50 am
That is not true - it uses the user's current IP address.
Is this the difference between $this->user->data['user_ip'] and $this->user->ip? login_connect() appears to be logging the $this->user->data['user_ip'] data.

testingground
Registered User
Posts: 174
Joined: Thu Apr 21, 2016 10:59 am

Re: Logging user IP's

Post by testingground » Wed May 01, 2019 12:15 pm

Yes thanks that other extension does what Im after.
Got a better layout too being on a separate page.

I changed the files in the first one so it logged real time IP's (regardless to what David63 said, it does NOT do this out of the box)
However it doesnt log auto logins which the other one does.

So thanks again guys.

Post Reply

Return to “Extension Requests”