DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • March 22, 2019, 07:19:20 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1] 2 3   Go Down
  Print  
Author Topic: reCAPTCHA anti-spam for petition.php  (Read 10113 times)
0 Members and 1 Guest are viewing this topic.
Danodemano
Militia
**
Offline Offline

Posts: 50


View Profile
« on: January 16, 2011, 12:53:15 PM »

My first released module to DragonPrime (though I have written quite a few).  The concept is fairly simple, it uses reCAPTCHA to all but eliminate SPAM from your petitions.  You will have to register (free) at http://www.google.com/recaptcha/whyrecaptcha to get your public and private keys.  The settings should be fairly straightforward.  Please let me know if you have questions/comments or find any bugs!
« Last Edit: January 17, 2011, 10:29:02 AM by Danodemano » Logged

Code:
SELECT * FROM `signatures` WHERE `username`='Danodemano';
#1146 - Table 'signatures' doesn't exist
Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5483



View Profile WWW
« Reply #1 on: January 16, 2011, 02:35:41 PM »

Thanks for sharing the module with us.

Please note, however, that the only license under which the module can be released is the CCL license.  I noticed in your file notes that you state you're releasing it under the GNU license.
Logged

Play the latest beta version here on DragonPrime
Danodemano
Militia
**
Offline Offline

Posts: 50


View Profile
« Reply #2 on: January 16, 2011, 04:01:27 PM »

Thanks for sharing the module with us.

Please note, however, that the only license under which the module can be released is the CCL license.  I noticed in your file notes that you state you're releasing it under the GNU license.

Oops, I don't know what I was smoking there.  I updated the file in the OP, sorry about that.
Logged

Code:
SELECT * FROM `signatures` WHERE `username`='Danodemano';
#1146 - Table 'signatures' doesn't exist
Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5483



View Profile WWW
« Reply #3 on: January 16, 2011, 05:56:47 PM »

Thanks for sharing the module with us.

Please note, however, that the only license under which the module can be released is the CCL license.  I noticed in your file notes that you state you're releasing it under the GNU license.

Oops, I don't know what I was smoking there.  I updated the file in the OP, sorry about that.

Much appreciated!
Logged

Play the latest beta version here on DragonPrime
backflip
Codemeister
****
Offline Offline

Posts: 278


om nom nom


View Profile WWW
« Reply #4 on: January 17, 2011, 09:47:06 AM »

Hi, and thanks for sharing! I already thought about adding reCAPTCHA, but then decided it wasn't worth the hassle and went with a normal blocker instead (that also features the "hidden" fields). Just a few things:
Code:
$info = array(
"name"=>"Spam blocker - petition.php",
"version"=>"1.0",
"author"=>"Eric Stevens",
"category"=>"Administrative",
"download"=>"core_module",
"settings"=>array(
'hidden_reqname'=>"Name of hidden field which must be populated,|".md5(getmicrotime(true).e_rand()),
'hidden_reqvalue'=>"Value of hidden field which must be populated,|".md5(getmicrotime(true).e_rand()),
'hidden_noname'=>"Name of hidden field which must NOT be populated,|".md5(getmicrotime(true).e_rand()),
'hidden_novalue'=>"Value of hidden field which must NOT be populated,|".md5(getmicrotime(true).e_rand()),
'spambottext'=>'Text to be displayed for potential spam bots:,textarea|'.$message,
)
);
I'm pretty sure you're not MightyE, and your module's also not a core module Wink Also, it's probably not necessary to call getmicrotime(), e_rand() and md5() five times for every time the module is queried - maybe add them once in the install function.
Code:
rawoutput("<p style='display: none;'><b>Please note, do not change these fields</b>, they are an anti-spam measure.  " .
"Most users will not see them; if you are seeing them though, then you're using a browser that doesn't recognize " .
"the attributes we use to hide them.  That's ok, just don't change their values!<br>" .
$input1 .
$input2 .
"</p>");
Maybe make it translation ready? Also, I can't seem to find where you actually insert the reCAPTCHA part, but maybe I missed that.
Logged

Bruce Schneier's functions don't have parameters. They have arguments, and they always win them.
Frodolin LoGD
Danodemano
Militia
**
Offline Offline

Posts: 50


View Profile
« Reply #5 on: January 17, 2011, 10:30:08 AM »

GOOD GOD I REALLY AM SMOKING SOMETHING!  I grabbed the wrong module from my modules directory.  I'm so sorry about that.  I replaced the file in the OP with the correct one this time, I think.  :/
Logged

Code:
SELECT * FROM `signatures` WHERE `username`='Danodemano';
#1146 - Table 'signatures' doesn't exist
Megan|SaraBeth
Mod God
*****
Offline Offline

Posts: 1065



View Profile WWW
« Reply #6 on: April 18, 2015, 04:17:07 PM »

Sorry to bring up an old thread but it doesnt submit petitions on 1.1.1...I know I should upgrade and support for 1.1.1 is optional but I just think it would be cool if this worked for all 1.x.x versions.
Logged

Aeolus
Mod God
*****
Online Online

Posts: 1923


You're welcome.


View Profile WWW
« Reply #7 on: April 18, 2015, 04:22:46 PM »

Sorry to bring up an old thread but it doesnt submit petitions on 1.1.1...I know I should upgrade and support for 1.1.1 is optional but I just think it would be cool if this worked for all 1.x.x versions.

1.1.1 and 1.1.2 only have minimal differences, there's a change log somewhere on DP showing this. I'm guessing there's an error with your implementation of it.
Logged

Megan|SaraBeth
Mod God
*****
Offline Offline

Posts: 1065



View Profile WWW
« Reply #8 on: April 18, 2015, 08:33:47 PM »

Yea. After I got home from my errands and my backup downloaded and I looked over the file of what I took out for the string creator and the file that had it I saw and if statement I missed on taking out. I took it out and the closing bracket and now its all fine and dandy.
Logged

Megan|SaraBeth
Mod God
*****
Offline Offline

Posts: 1065



View Profile WWW
« Reply #9 on: April 19, 2015, 05:21:24 PM »

I have a new question now. How do I stop the [recaptcha_challenge_field]= and the [recaptcha_response_field]= from displaying in the petitions? It serves no purpose to me. Its just a string of numbers. They can display in the database when the row for the petition is viewed. I just dont want it on site in the petitions. Thanks.
Logged

Nightborn
Captain of the Guard
***
Offline Offline

Posts: 218


View Profile WWW
« Reply #10 on: April 25, 2015, 07:22:12 AM »

You can't suppress them without a core edit sadly, had the same issue with my captcha stuff =/
Logged
Sunday
Codemeister
****
Offline Offline

Posts: 404


So meme'd up.


View Profile
« Reply #11 on: April 28, 2015, 11:05:31 AM »

I have a new question now. How do I stop the [recaptcha_challenge_field]= and the [recaptcha_response_field]= from displaying in the petitions? It serves no purpose to me. Its just a string of numbers. They can display in the database when the row for the petition is viewed. I just dont want it on site in the petitions. Thanks.
Is this the body of the petition, where the player's message goes? Could you provide an example row of the issue? There should be a way of doing it without a core edit.
Logged

Slowly progressing fork with PHP 7 support: https://github.com/stephenKise/Legend-of-the-Green-Dragon
Cheap VPS Hosting (10$ credit!): https://m.do.co/c/acde75b086c5

A new server in the making...
Aeolus
Mod God
*****
Online Online

Posts: 1923


You're welcome.


View Profile WWW
« Reply #12 on: April 28, 2015, 03:35:31 PM »

Is this the body of the petition, where the player's message goes? Could you provide an example row of the issue? There should be a way of doing it without a core edit.

By her last post, I'd assume that it's the body of the petition, that's being displayed in the Petition Viewer.

She could easily unset the keys 'recaptcha_challenge_fiel d' and 'recaptcha_response_field' in $_POST (which would require a core edit of petitions, and would completely remove it), but given that she wants it to stay in the database but not display in the body, she'd need regex to remove it from the body of the PV (which would require a core edit of viewpetition.php).
Logged

Sunday
Codemeister
****
Offline Offline

Posts: 404


So meme'd up.


View Profile
« Reply #13 on: April 30, 2015, 05:11:11 PM »

Is this the body of the petition, where the player's message goes? Could you provide an example row of the issue? There should be a way of doing it without a core edit.

[...]
but given that she wants it to stay in the database but not display in the body [...]

Did not read that bit. There is a very obfuscated way of getting around this, involving the everyhit-loggedin hook, a check of $session['user']['restorepage'], and a set of preferences (one to save the $session['user']['restorepage'], and one to save the original content of the petition being viewed), mixed with a few httpget() checks. But, I am not going to get into this one, since apparently, a core edit is needed. (/s Tongue) Have fun figuring that out, Megan!
Logged

Slowly progressing fork with PHP 7 support: https://github.com/stephenKise/Legend-of-the-Green-Dragon
Cheap VPS Hosting (10$ credit!): https://m.do.co/c/acde75b086c5

A new server in the making...
Megan|SaraBeth
Mod God
*****
Offline Offline

Posts: 1065



View Profile WWW
« Reply #14 on: April 30, 2015, 06:52:16 PM »

I guess since I have to at least edit the viewpetitions or some part of the core to get rid of it all together, I think I'll deal with it being there. I did when I had the copy/paste string of text. But I never knew thats what that was until I put this module in. Something to think on in the future I guess.
Logged

Pages: [1] 2 3   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Version 1.1.2 is the current supported version and is available for download.

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
27 Guests, 1 User
Aeolus
Home Forums News Downloads Login Register Advanced Search