Author |
Topic |
GauravBhabu
Advanced Member
4288 Posts |
Posted - 08 December 2001 : 14:21:59
|
USER LOG
- This will record Date and time,UserIP,PageVisited,UserName.
- This can only be used on a server with the Scripting.FileSystemObject fully enabled.
Active Users Mod Installed:
Find the following statements in inc_activeusers.asp
'CHECK IF USER NAME AND IP ADDRESS MATCH set rsWho = Server.CreateObject("ADODB.Recordset")
Add the following statements Just before the above statements in inc_activeusers.asp
dim iplg, logFile8 set iplg=server.createObject("scripting.FileSystemObject") set logFile8=iplg.openTextFile(server.mappath("/forum/FOLDERNAME/IPLOG.txt"),8) logFile8.write strOnlineCheckInTime & Chr(9) & strOnlineUserIP & CHR(9) & strScriptName & CHR(9) & strOnlineUser & vbCrLf logFile8.close set logFile8=nothing set iplg=nothing
ActiveUsers Mod not installed
Add the following statements at the end of inc_top.asp
<%strOnLineCheckInTime = DateToStr(strForumTimeAdjust) strOnlineUserIP = Request.ServerVariables("REMOTE_ADDR") strScriptName = Request.servervariables("script_name") if strDBNTUserName = "" then strOnlineUser = "Guest" else strOnlineUser = strDBNTUserName end if
dim iplg, logFile8 set iplg=server.createObject("scripting.FileSystemObject") set logFile8=iplg.openTextFile(server.mappath("/forum/FOLDERNAME/IPLOG.txt"),8) logFile8.write strOnlineCheckInTime & Chr(9) & strOnlineUserIP & CHR(9) & strScriptName & CHR(9) & strOnlineUser & vbCrLf logFile8.close set logFile8=nothing set iplg=nothing%>
Create a text file and name it IPLOG.txt and place it in a folder where you have read/write permissions enabled.
Replace FOLDERNAME with the folder name where you have placed your IPLOG.txt file.
That is it.
GauravBhabu - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.
Edited by - GauravBhabu on 17 February 2002 20:49:20 |
|
Extra Sports
Average Member
USA
644 Posts |
Posted - 08 December 2001 : 14:49:58
|
do we have to add this anywhere??
'CHECK IF USER NAME AND IP ADDRESS MATCH set rsWho = Server.CreateObject("ADODB.Recordset")
Like sports? Register at extrasports!!! www.extrasports.2ya.com |
|
|
Extra Sports
Average Member
USA
644 Posts |
Posted - 08 December 2001 : 14:51:12
|
oh, nevermind. I haven't read the directions. LOL. I really need this for sure. thanks!!
Like sports? Register at extrasports!!! www.extrasports.2ya.com |
|
|
Extra Sports
Average Member
USA
644 Posts |
Posted - 08 December 2001 : 16:09:45
|
ok, it works great. This is useful!!!
Like sports? Register at extrasports!!! www.extrasports.2ya.com |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 08 December 2001 : 16:26:03
|
The information can be used to track someone abusing your forums using different usernames.
GauravBhabu - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying. |
|
|
Extra Sports
Average Member
USA
644 Posts |
Posted - 15 December 2001 : 23:18:54
|
yea, and if somebody hacks my site again, I will call cops on them. LOL. Thanks alot for this!!!
Like sports? Register at extrasports!!! www.extrasports.2ya.com |
|
|
bjlt
Senior Member
1144 Posts |
Posted - 16 December 2001 : 03:00:02
|
this is really useful.
I have a question on permissions:
here's what I have in my control pannel ----------------- Permissions for: xxxxxx log.txt
USERNAME READ WRITE ownername ENABLED ENABLED _DISABLED_GUEST ENABLED ENABLED _DISABLED_GUEST ENABLED ENABLED ANONYMOUS ENABLED ENABLED -----------------
I have to set anonymous to write enabled will this cause any trouble? does it mean others are possible to write to log.txt?
btw, what does _DISABLED_GUEST mean here? (i'll ask the system admin for this if this is not a global setting for win2000 servers)
thanks.
|
|
|
fpgal
New Member
93 Posts |
Posted - 01 February 2002 : 02:48:38
|
Thank you!!!!
This is an awesome script - exactly what I need!
Only one question: Is there a simple way to make it track and record the forum/topic ID or Name also?
fpgal
Edited by - fpgal on 01 February 2002 02:55:51 |
|
|
suhern
Junior Member
186 Posts |
Posted - 01 February 2002 : 05:05:01
|
It works very nicely but when I look into the log it shows date, ip address, and name but not pagevisited. I am behind a firewall when I tested this. Is this the cause of it?
|
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 01 February 2002 : 05:53:25
|
Make sure you have strScriptName variable defined and is being populated.
Look for this statement in inc_top.asp
strScriptName = Request.servervariables("script_name")
www.forumSquare.com - GauravBhabu - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying. |
|
|
suhern
Junior Member
186 Posts |
Posted - 01 February 2002 : 11:06:31
|
quote:
Make sure you have strScriptName variable defined and is being populated.
Look for this statement in inc_top.asp
strScriptName = Request.servervariables("script_name")
www.forumSquare.com - GauravBhabu - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.
I checked and do have that statement in my inc_top. Any idea why the pagename is not showing up in the log?
|
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 01 February 2002 : 14:00:32
|
Add the statement in red as shown in inc_top.asp and see if the variable is getting populated.
strScriptName = Request.servervariables("script_name") Response.write "Scriptname:" & strScriptName
www.forumSquare.com - GauravBhabu - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying. |
|
|
Kong
Junior Member
100 Posts |
Posted - 03 February 2002 : 05:39:12
|
quote:
Make sure you have strScriptName variable defined and is being populated.
Look for this statement in inc_top.asp
strScriptName = Request.servervariables("script_name")
I'm interested in this but have a slight problem.
I looked inside of inc_top.asp to make sure I had that set but couldn't find that line anywhere.
What is that line for? Is there something I'm missing that I comes with?
_________________________ Come on by and visit Deth Incarnate. Growing slowly, but growing none the less. |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 03 February 2002 : 07:47:40
|
Do you have active users Mod installed? If not then use the code for Active uses Mod not installed.
www.forumSquare.com - GauravBhabu - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying. |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 03 February 2002 : 12:00:50
|
here's an idea to a really good logging mod G. I was thinking of checking the date and creating new logs for every month of the year which will slim down the size of the log file and conveniently would offer separate files for reviewing by month. my log file is already 5 megs in a matter of 2 weeks.
oh yeah, as a side note, I review this log quite frequently and actually found someone trying to get to my admin areas several times which allowed me to eventually ban them by ip.
____________ dayve@burningsouls.com
http://www.nineinchnailz.com - your source for everything nine inch nails !
Edited by - dayve on 03 February 2002 12:02:19 |
|
|
SimonT
Junior Member
United Kingdom
202 Posts |
Posted - 03 February 2002 : 12:07:58
|
I also have the same problem I have the latest version of the active users build (I think rewritten by nathan not your build) I have looked in to the log file and I do not see where the user is. I have looked in the inc_top.asp file but I do not have the line
strScriptName = Request.servervariables("script_name")
Let me know if you would like to see any of my files
|
|
|
Topic |
|