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

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Discussions (General)
 Registration Key in register.asp(actkey)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

luca.lamberti
Starting Member

Italy
2 Posts

Posted - 30 October 2009 :  08:35:59  Show Profile  Reply with Quote
Hi guys,
I had problems whit registration key (actkey) that sometime is the same for many users (this happen 2-3 times at year).
Perhaps the key that is in my setup is only 16 char then can happen that 2 users have the same key.
I solved the problem not making the key longer only but adding a timecode before the key (in this way is impossible to have 2 identical key)
In the file inc_func_posting.asp add the line marked(line 69):
...........
strKey = ""
for j = 0 to 15
strKey = strKey & keyArray(key(j))
next
'timecode
strKey=round(CDbl(Now())*10000)&strKey
'end timecode
GetKey = strKey
if action = "sendemail" then
..........
in that way the code is a sum of a number that change every 10sec plus the actkey calculated as before.

I don't know if the new version of the forum have an algoritm more efficient, I hope that can be helpfull for someone.

Luca

luca

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 30 October 2009 :  11:23:02  Show Profile  Visit HuwR's Homepage  Reply with Quote
the current version of the forum uses a 32 digit key so is less likely to get a duplicate (but it is still possible).
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 30 October 2009 :  20:43:17  Show Profile  Reply with Quote
You could use a simple date/time extraction like this:
	strKey = DatetoStr(strForumTimeAdjust) + strKey


That'll get you a leading string of the year/month/day/HH/MM/SS (followed by the initial key) - totaling 46 characters. Then, the odds against a duplicate registration key issued at the exact same second would be astronomical.

Edited by - Carefree on 30 October 2009 20:53:25
Go to Top of Page

luca.lamberti
Starting Member

Italy
2 Posts

Posted - 01 November 2009 :  12:30:20  Show Profile  Reply with Quote
Yes..I saw that is possible to use till 32 chars, and is quite difficult but still is possible to have the same key..for that reason I used this algorithm. Also whit this solution you can make shorter the key ( 5-6 chars plus the timecode(10 chars)=16 chars).
I think whit this solution you can have less char and real less probability to have the same key.

luca
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000 Version 3.4.07