[2.0.15] View User Agent

The cleanup is complete. This forum is now read only.

Rating:

Excellent!
0
No votes
Very Good
2
50%
Good
1
25%
Fair
0
No votes
Poor
1
25%
 
Total votes: 4

Extensions Robot
Extensions Robot
Extensions Robot
Posts: 28022
Joined: Sat Aug 16, 2003 7:36 am

[2.0.15] View User Agent

Post by Extensions Robot » Fri Jun 10, 2005 11:33 am

MOD Name: View User Agent
Author: tomythius
MOD Description: Displays the user agent of a session on the admin page


MOD Version: 1.0.4 (Updated 06/26/05)

Download File: useragent_v1.0.4.mod
mods overview page: View
File Size: 8200 Bytes

Security Score: 0
Last edited by Extensions Robot on Mon Apr 30, 2007 12:27 am, edited 1 time in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)

ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 » Fri Jun 17, 2005 11:55 am

MOD Validated/Released

Notes:
Users' Agent info are displayed in admin control panel with this MOD.

tomythius
Registered User
Posts: 74
Joined: Sat May 28, 2005 3:05 pm
Location: Queniborough - Leicester - UK
Contact:

Wow

Post by tomythius » Fri Jun 17, 2005 12:06 pm

Thanks guys.
:D
Tom says so, QED.

bonzi
Registered User
Posts: 10
Joined: Thu May 26, 2005 6:36 am

Post by bonzi » Fri Jun 17, 2005 12:14 pm

I didnt quite understand what is it.

tomythius
Registered User
Posts: 74
Joined: Sat May 28, 2005 3:05 pm
Location: Queniborough - Leicester - UK
Contact:

Screenshot

Post by tomythius » Fri Jun 17, 2005 12:22 pm

Screenshot:
Image
Note the extra column in the who is online table, this displays what is being used to view the pages in that session.
Works for guests too, useful for tracking googlebot and RSS grabbers.
Tom says so, QED.

markus_petrux
Former Team Member
Posts: 1887
Joined: Wed Apr 23, 2003 7:11 am
Location: Girona, Catalunya (Spain)
Contact:

Re: Screenshot

Post by markus_petrux » Fri Jun 17, 2005 12:41 pm

tomythius wrote: Note the extra column in the who is online table...

Could you please consider showing the useragent as another table row (using colspan="4" and gensmall)?

I have PM'd you regarding a security issue. :?
EasyMOD Standards | MOD Template Actions | MODs in Development Rules
Useful information for MOD Authors | MOD Queue Stats | Search MODs
Write SQL/DDL portable to all SQL servers supported by phpBB!
Get EasyMOD 0.3.0! | Suport al phpBB en Català!
8)

tomythius
Registered User
Posts: 74
Joined: Sat May 28, 2005 3:05 pm
Location: Queniborough - Leicester - UK
Contact:

Security

Post by tomythius » Fri Jun 17, 2005 1:06 pm

Markus has alerted me to the possibility that users could incorporate html into their user agent string.
To correct this line 225 of the mod file:

Code: Select all

"USER_AGENT" => $guest_agent,
should be changed to:

Code: Select all

"USER_AGENT" => htmlspecialchars($guest_agent),
and line 209 of the mod file:

Code: Select all

"USER_AGENT" => $reg_agent,
should be changed to:

Code: Select all

"USER_AGENT" => htmlspecialchars($reg_agent),
This has been fixed in v1.0.4
markus_petrux wrote: Could you please consider showing the useragent as another table row (using colspan="4" and gensmall)?

I'm not quite sure why you'd want to do this? Surely it's better to have the agent displayed inline with the session it refers to...
:?
Tom says so, QED.

kulinar
Registered User
Posts: 651
Joined: Thu Feb 17, 2005 7:31 pm
Contact:

Post by kulinar » Fri Jun 17, 2005 8:30 pm

Code: Select all

#
#-----[ FIND ]------------------------------------------
#
               $sql = "UPDATE " . SESSIONS_TABLE . "
                  SET session_time
#
#-----[ IN-LINE FIND ]------------------------------------------
#
   $thispage_id
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, session_agent = $agent
in my sessions.php file the code is

Code: Select all

$sql = "UPDATE " . SESSIONS_TABLE . " 
						SET session_time = $current_time, session_page = $thispage_id$update_admin
which means the new code will look like that

Code: Select all

$sql = "UPDATE " . SESSIONS_TABLE . " 
						SET session_time = $current_time, session_page = $thispage_id, session_agent = $agent$update_admin
which looks strange to me :roll:

tomythius
Registered User
Posts: 74
Joined: Sat May 28, 2005 3:05 pm
Location: Queniborough - Leicester - UK
Contact:

Post by tomythius » Fri Jun 17, 2005 8:43 pm

kulinar wrote: in my sessions.php file the code is

Code: Select all

$sql = "UPDATE " . SESSIONS_TABLE . " 
						SET session_time = $current_time, session_page = $thispage_id$update_admin

I don't see this in my source, and it looks badly formed. Have you already modded sessions.php?
kulinar wrote: which means the new code will look like that

Code: Select all

$sql = "UPDATE " . SESSIONS_TABLE . " 
						SET session_time = $current_time, session_page = $thispage_id, session_agent = $agent$update_admin
which looks strange to me :roll:

How is one more strange than the other? Both end with two variables next to each other.
Tom says so, QED.

kulinar
Registered User
Posts: 651
Joined: Thu Feb 17, 2005 7:31 pm
Contact:

Post by kulinar » Sat Jun 18, 2005 6:36 pm

tomythius wrote: I don't see this in my source, and it looks badly formed. Have you already modded sessions.php?
Yes, I have modded sessions.php many times. I run heavily modded board.
Instead of this

Code: Select all

$sql = "UPDATE " . SESSIONS_TABLE . " 
						SET session_time = $current_time, session_page = $thispage_id, session_agent = $agent$update_admin
I used this

Code: Select all

$sql = "UPDATE " . SESSIONS_TABLE . " 
						SET session_time = $current_time, session_page = $thispage_id$update_admin, session_agent = $agent
and it works for me so far.
tomythius wrote: ...and it looks badly formed
I don't know which mod transformed my session.php file. What is so bad with it?

Saoshyant
Registered User
Posts: 77
Joined: Thu Feb 03, 2005 3:35 pm
Location: Portugal

Post by Saoshyant » Sat Jun 18, 2005 9:24 pm

This MOD sounds very interesting and actually very useful to identify real users from bots (and vice versa), however I will not install it until version 1.0.4 is out :S

MakePB
Registered User
Posts: 67
Joined: Sat May 21, 2005 3:21 pm
Contact:

Post by MakePB » Sun Jun 19, 2005 9:47 am

It is interesting and useful.Indeed.
Could we maybe get a alternative link where your newest version is released (1.0.4) because it seems that they are some bugs fixed?

Thanks

skuld the great
Registered User
Posts: 379
Joined: Mon Aug 02, 2004 4:08 pm

Post by skuld the great » Sun Jun 19, 2005 10:18 am

Thats cool!

Is there anything like this for showing it stamped on each post?
Skuld

tomythius
Registered User
Posts: 74
Joined: Sat May 28, 2005 3:05 pm
Location: Queniborough - Leicester - UK
Contact:

Post by tomythius » Sun Jun 19, 2005 10:25 am

MakePB wrote: It is interesting and useful.Indeed.
Could we maybe get a alternative link where your newest version is released (1.0.4) because it seems that they are some bugs fixed?

Thanks


Here y'go: http://tom.whaletattoo.com/useragent_v1.0.4.mod
It's not been validated officially, but there are only two minor changes.
Tom says so, QED.

tomythius
Registered User
Posts: 74
Joined: Sat May 28, 2005 3:05 pm
Location: Queniborough - Leicester - UK
Contact:

Post by tomythius » Sun Jun 19, 2005 10:33 am

skuld the great wrote: Thats cool!

Is there anything like this for showing it stamped on each post?

I guess you could apply a similar modification to posting.php, making it insert the user agent of the poster into the posts table like it does with IP addresses, then making it display a clickable icon.
Tom says so, QED.

Post Reply

Return to “[2.0.x] MOD Database Cleanup”

cron