Etomite Community Forums: [Snippet] membership_validator - Etomite Community Forums

Jump to content

Read Me

This forum is posted in automatically when a snippet is added to the library, or updated. Please use the snippet topic to discuss that snippet.
  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

[Snippet] membership_validator

#16 User is offline   Opal 

  • Etomite Forum Newbie
  • Group: Member
  • Posts: 23
  • Joined: 16-January 09
  • Gender:Female

Posted 03 November 2009 - 02:59 PM

Yay! Thank you for the update, Cris!

#17 User is offline   Wiper2007 

  • Etomite Forum Fan
  • Pip
  • Group: Member
  • Posts: 76
  • Joined: 06-March 07

Posted 12 March 2010 - 10:12 PM

Hi

trying to implement the snippet...

step 1 and 2 are ok ...but when I click on the link in the email adress I'll getting the following:

There is a registration error...this could be because:
1) you have attempted hack the site,
2) you have tried to create another account,
Please register again or contact the webmaster for assistance.

It creates the user in the DB because when I try again - it states that the username and email are already used...

can someone "pinpoint" where I've done wrong?

This post has been edited by Wiper2007: 14 March 2010 - 12:11 AM


#18 User is offline   Cris D. 

  • Loves Etomite Forums!
  • PipPipPipPip
  • Group: Member
  • Posts: 1,076
  • Joined: 10-August 06
  • Gender:Not Telling

Posted 15 March 2010 - 06:22 AM

I have put a lot of anti-hacking code in. If you cleared your browser sessions and started from scratch with a new user id and unique email you should be OK, otherwise you will have to start commenting out all the security checks in the code to test it to allow duplicate email addresses and multiple confirmations in a single session. It's most likely working correctly, you just need to take a break and re-think your testing strategy.

#19 User is offline   Wiper2007 

  • Etomite Forum Fan
  • Pip
  • Group: Member
  • Posts: 76
  • Joined: 06-March 07

Posted 15 March 2010 - 09:53 PM

Hi Chris

Hmmm.. I have now completed step 1 and 2 from my home computer sending a mail to my computer at work ...

So I'll try to confirm the email link from my computer at work like a "normal" user that's trying to register...

View PostCris D., on 15 March 2010 - 06:22 AM, said:

I have put a lot of anti-hacking code in. If you cleared your browser sessions and started from scratch with a new user id and unique email you should be OK, otherwise you will have to start commenting out all the security checks in the code to test it to allow duplicate email addresses and multiple confirmations in a single session. It's most likely working correctly, you just need to take a break and re-think your testing strategy.

This post has been edited by Wiper2007: 15 March 2010 - 09:56 PM


#20 User is offline   Cris D. 

  • Loves Etomite Forums!
  • PipPipPipPip
  • Group: Member
  • Posts: 1,076
  • Joined: 10-August 06
  • Gender:Not Telling

Posted 16 March 2010 - 08:18 AM

View PostWiper2007, on 15 March 2010 - 09:53 PM, said:

Hi Chris

Hmmm.. I have now completed step 1 and 2 from my home computer sending a mail to my computer at work ...

So I'll try to confirm the email link from my computer at work like a "normal" user that's trying to register...



Let us know how you go...

#21 User is offline   Wiper2007 

  • Etomite Forum Fan
  • Pip
  • Group: Member
  • Posts: 76
  • Joined: 06-March 07

Posted 16 March 2010 - 12:30 PM

Didn't work...

still getting the error....

any suggestions ?

View PostCris D., on 16 March 2010 - 08:18 AM, said:

Let us know how you go...


#22 User is offline   Cris D. 

  • Loves Etomite Forums!
  • PipPipPipPip
  • Group: Member
  • Posts: 1,076
  • Joined: 10-August 06
  • Gender:Not Telling

Posted 16 March 2010 - 09:37 PM

View PostWiper2007, on 16 March 2010 - 12:30 PM, said:

Didn't work...

still getting the error....

any suggestions ?



1) Make sure you are using the latest version of this snippet, I posted one that did not validat the hash correctly. Make sure that the membership_validator snippet has these lines:

$hash=$_GET['hash'];
//stop hacking attempts
if(!preg_match('#^[a-f0-9]{32}$#i', $hash)) 
return $messages['error1'];


not this:
if(is_numeric($_GET['hash'])){
$hash=$_GET['hash'];
}else{ 
//someone is trying to inject GET values into the browser
return $messages['error1'];}

which is totaly wrong for an MD5 hash (beig letters and numbers).

ie make sure you are gettting the snippet from the "Download File"button, NOT the list of archive files listed below on the downoad page.

#23 User is offline   Wiper2007 

  • Etomite Forum Fan
  • Pip
  • Group: Member
  • Posts: 76
  • Joined: 06-March 07

Posted 17 March 2010 - 10:20 PM

Hi Chris

I've downloaded it by clicking the download button...

I've the:

$hash=$_GET['hash'];
//stop hacking attempts
if(!preg_match('#^[a-f0-9]{32}$#i', $hash)) 
return $messages['error1'];


in the membership_verifier snippet - and not in the membership_validator... are this correct?


View PostCris D., on 16 March 2010 - 09:37 PM, said:

1) Make sure you are using the latest version of this snippet, I posted one that did not validat the hash correctly. Make sure that the membership_validator snippet has these lines:

$hash=$_GET['hash'];
//stop hacking attempts
if(!preg_match('#^[a-f0-9]{32}$#i', $hash)) 
return $messages['error1'];


not this:
if(is_numeric($_GET['hash'])){
$hash=$_GET['hash'];
}else{ 
//someone is trying to inject GET values into the browser
return $messages['error1'];}

which is totaly wrong for an MD5 hash (beig letters and numbers).

ie make sure you are gettting the snippet from the "Download File"button, NOT the list of archive files listed below on the downoad page.


#24 User is offline   Cris D. 

  • Loves Etomite Forums!
  • PipPipPipPip
  • Group: Member
  • Posts: 1,076
  • Joined: 10-August 06
  • Gender:Not Telling

Posted 18 March 2010 - 09:49 AM

Yeah that's right. PM me if you want me to take a hands on look.

#25 User is offline   Wiper2007 

  • Etomite Forum Fan
  • Pip
  • Group: Member
  • Posts: 76
  • Joined: 06-March 07

Posted 20 March 2010 - 08:07 AM

Hi Chris

Thanks - but I'm uninstalling the snippets...


View PostCris D., on 18 March 2010 - 09:49 AM, said:

Yeah that's right. PM me if you want me to take a hands on look.


Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users