Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Active users - by design?
 New Topic  Topic Locked
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 4

nickw
Junior Member

Ireland
193 Posts

Posted - 01 June 2003 :  16:15:45  Show Profile
Hi Jan,

No, not the timeout, for sure....

This has happened since the day I implemented it. Very weird, I know...

Nick
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 01 June 2003 :  17:47:52  Show Profile  Visit masterao's Homepage
I know a method which allows you to test this yourself. You need two different member-accounts and two different web-browsers. Sign on as "member1" in one browser, and go to any page in your forum. Then sign on as "member2" in the second browser. First check the active users statistics on default.asp, and then on the active users page. This allows you to re-create the login sequence and see if it removes all users or not.

Do this occur if you remove the reqire login to view forum?

If you could provide a link to a text-version of your inc_header.asp as well, I will take a look at it.

Jan
===========
FR Portal Forums | Active Users 4.0.20 Mod

Edited by - masterao on 01 June 2003 17:48:49
Go to Top of Page

nickw
Junior Member

Ireland
193 Posts

Posted - 02 June 2003 :  07:51:51  Show Profile
Hi Jan,

The funny thing is, that works, and users do show up some of the time. It seems to happen intermitantly.

Here is the inc_header file...
http://www.ifsd.ie/inc_header.txt

You can login to the forum using the username snitz, password snitz.

Thanks again!

Nick
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 02 June 2003 :  08:34:55  Show Profile  Visit masterao's Homepage
I think I know why some logins removes all members/guests from time to time.

Im not completely sure, but I believe that the problem occurs because of firewalls/security programs. When a member logins, the sub AUHandleLoging() deletes the member's guest status based upon an ip-address. If that ip-address is empty, it will delete all visitors (guests and members) who doesn't have an ip-address.

As I mentioned, Im not completely sure about this, but Im gonna see if I can recreate the problem on my test-forum.

Im at work now, so Im not able to do much more at the moment. I looked through your inc_header.asp, and it appeared to be ok.

Jan
===========
FR Portal Forums | Active Users 4.0.20 Mod

Edited by - masterao on 02 June 2003 08:38:00
Go to Top of Page

nickw
Junior Member

Ireland
193 Posts

Posted - 02 June 2003 :  10:57:08  Show Profile
Ahhh! That would explain a lot!

My site is running behind ISA Server, so everyone would be shown as my servers IP address.

It would be nice to see if that could be "got around" if someone has that type of setup..

I look forward to hearing from you.

Cheers,

Nick
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 02 June 2003 :  14:01:02  Show Profile  Visit masterao's Homepage
So everyone who logs in on your forum are given the same ip-address?

I did a few tests on my test-server, but Im not able to recreate the problem.

I've also been thinking on how to circumvent this problem codewise, and I can only think of either adding a cookie-variable or a session variable which keeps track of each user, and which is used by the active users code to update the database (which would replace the ip-string).


Jan
===========
FR Portal Forums | Active Users 4.0.20 Mod
Go to Top of Page

nickw
Junior Member

Ireland
193 Posts

Posted - 02 June 2003 :  14:39:35  Show Profile
Yep,

You see, everyone is seen as 10.10.10.1 which is my servers IP Address... That is the correct way for the firewall with a proper proxy to work.

So, the cookie idea sounds great! (I had to do the same for my Webtrends software).

Thanks for realising the issue!

Nick

Edited by - nickw on 02 June 2003 16:08:53
Go to Top of Page

nickw
Junior Member

Ireland
193 Posts

Posted - 02 June 2003 :  14:42:06  Show Profile
Actually, I think some other variable would be better... A lot of people block cookies nowadays... But hey, I don't really mind either way

Nick
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 02 June 2003 :  15:50:59  Show Profile  Visit masterao's Homepage
Im glad to have been of some help, even though it wasn't that much.

The other option would be a session variable, which could be resource taxing if you have a lot of concurrent visitors. Atleast you get to choose from two options.

BTW, you could post your solution here, in order to help others who has a similar server setup.

Jan
===========
FR Portal Forums | Active Users 4.0.20 Mod
Go to Top of Page

nickw
Junior Member

Ireland
193 Posts

Posted - 02 June 2003 :  15:57:08  Show Profile
Sorry Jan,

Confused.... I cannot solve this problem without someone changing the ActiveUsers Code.... I have no idea how to do this I would have, at the most 20 Active users at a time... So, how can it be done?

I can't modify my server setup (publish the server as opposed to the site) as it would really open my servers to attack.

The session variable sounds to me to be the best option, even for sites that have 100 - 200 online at a time..

Also, I am running on SQL, if that makes it any easier...


Cheers,

Nick

Edited by - nickw on 02 June 2003 16:10:43
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 03 June 2003 :  07:44:09  Show Profile  Visit masterao's Homepage
I'll look into this as soon as I get some spare time, although I cannot promise anything at the moment.

Jan
===========
FR Portal Forums | Active Users 4.0.20 Mod
Go to Top of Page

nickw
Junior Member

Ireland
193 Posts

Posted - 03 June 2003 :  07:46:37  Show Profile
Thanks Jan...

No problem. I am sorry that I can't so anything to help

Nick
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 14 June 2003 :  14:41:19  Show Profile  Visit masterao's Homepage
I think I might have a solution for you. I've tested it a bit on my own test-server, and it seems to work ok.

This requires a few changes to inc_header.asp and inc_func_common.asp.

In inc_header.asp, locate the following:


select case Request.Form("Method_Type")
	case "login"
		strEncodedPassword = sha256("" & Request.Form("Password"))
		select case chkUser(strDBNTFUserName, strEncodedPassword,-1)
			case 1, 2, 3, 4
				Call DoCookies(Request.Form("SavePassword"))
				strLoginStatus = 1
			case else
				strLoginStatus = 0
			end select
	case "logout"
		Call ClearCookies()
end select


Before those lines, paste the following:


if Request.Cookies("myUser")("fakeip") = "" then Response.Cookies("myUser")("fakeip") = DateToStr(Now)

strCheckSession = Request.Cookies("myUser")("fakeip")


Then, in inc_func_common.asp, locate the following:


'##############################################
'##              Active Users                ##
'##############################################

Sub ActiveUserTracker()
  'Ls3k- Declaire and assign variables.
  Dim strUserIP, strScriptName, strQueryString, strUserAgent, strCurrentTime, strTimedOut

  strUserIP = Request.ServerVariables("REMOTE_ADDR")


Replace those lines with the following:


'##############################################
'##              Active Users                ##
'##############################################

Sub ActiveUserTracker()
  'Ls3k- Declaire and assign variables.
  Dim strUserIP, strScriptName, strQueryString, strUserAgent, strCurrentTime, strTimedOut

'  strUserIP = Request.ServerVariables("REMOTE_ADDR")
  strUserIP = Request.Cookies("myUser")("fakeip")


Then locate the sub AUHandleLoging() in inc_func_common.asp:


sub AUHandleLoging()
  strSql = "DELETE FROM " & strTablePrefix & "ACTIVE_USERS WHERE AU_IP = '" & Chkstring(request.ServerVariables("REMOTE_ADDR"), "SQLString") & "'"
  my_conn.execute (strSql)
end sub


Replace that sub with the following:


sub AUHandleLoging()
  strSql = "DELETE FROM " & strTablePrefix & "ACTIVE_USERS WHERE AU_IP = '" & Chkstring(Request.Cookies("myUser")("fakeip"), "SQLString") & "'"
  my_conn.execute (strSql)
end sub


It worked on my test-server, so I hope that it will work for you too. Im using the date instead for an ip-address, so if two visitors arrive at the exact same time, they will remove each others as it does for everyone for you at the moment. However, given the slight possibility for this to occur, I suspect that it will be very rare.

Jan
===========
FR Portal Forums | Active Users 4.0.20 Mod
Go to Top of Page

nickw
Junior Member

Ireland
193 Posts

Posted - 15 June 2003 :  08:42:51  Show Profile
Again Jan,

I thank you for taking the time to look at this for me....

Sometime' it just amazes me as to how helpful people are on this forum.

I will report back to let you know the results.

Thanks,

Nick

Edited by - nickw on 15 June 2003 08:44:18
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 15 June 2003 :  09:08:40  Show Profile  Visit masterao's Homepage
Your welcome.

Im keeping my fingers crossed for you .

Jan
===========
FR Portal Forums | Active Users 4.0.20 Mod
Go to Top of Page
Page: of 4 Previous Topic Topic Next Topic  
Previous Page | Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.43 seconds. Powered By: Snitz Forums 2000 Version 3.4.07