Jump to content

Welcome, Guest!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

  • 0
Script-Fu

How hard is it to back port a TB module to PS 1.6.1x

Question

So i have a very old PS site that started around version 1.2.x that's been upgraded since 2011 to many times to count. In it's present form i'm on version PS 1.6.1.10 and i'm stuck. You see i have (ghosts in the machine) so to speak. Being that this is my oldest PS site i have given up trying to update it to any newer versions of PS or TB as it just wont do it without complete failure. I have changed so much over the years with this site. Anyway I am content where i am right now as i found a post on PS to update my site to PHP 7.2 which i did and its now working very well.

 So moving forward I have the notarobot module installed because of all the bots creating spam. Well as this saga is never over lol i now have bots attacking my registration/authentication section. So yea it looks like the Bots are back. Except this time they are using the Register Now / Auth page to send porn links. ( They enter the email account they want to spam & hit the button. The website creates a new account then pops over so you may enter your first & last name etc etc. What they are doing is in the first name field is they put something like "Ada And Amy Are Waiting" then in the last name field "They put a Porn Site Link with a tracking code behind the url aka .com/fke6u". Go figure!

Well i have been digging around trying to find a solution and i found Lesley's  No Captcha reCAPTCHA Module in the TB Store. Of course i have given it a shot on one of my clone sites and i keep getting this error.

[PrestaShop] Fatal error in module file :/home/xxxxxxxx/website/classes/module/Module.php(1361) : eval()'d code:
syntax error, unexpected 'use' (T_USE)

Well at least i am one up from others that try to install un-compatible modules. As i know which module is causing the issue. However the fatal error does not help a bit on trying to solve the first step. I have nothing to work with because of that error above.

So i am gonna ask but i don't want to offend anyone at all. I think TB is the Bees Knees and all the hard work you ladies and gents have pulled off. All my new sites are based on TB and i'm impressed. With how clean it is in the module section with out all the BS like inside PS.

However this leads me back to the question...

I only need a few snippets to get the No Captcha reCAPTCHA Module to produce meaningful errors. I can handle all the back port code from their. Where do i start???

In the main nocaptcharecaptcha.php so far i have changed the...

if (!defined('_TB_VERSION_')) {
    exit;
}

to

if (!defined('_TB_VERSION_')
    && !defined('_PS_VERSION_')) {
    exit;
}

Which looks correct to me but i'm still stuck after that. I have nothing in my error logs and nothing with dev mode turned on. 

Again i'm not trying to make anyone mad i'm just stuck with a very old site with ghosts in the machine which leave me no choice. A lot of people would have give up by now. I can't and wont let this old site win!

Thanks _Billy

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

The thirty bees solution for this kind of spam is here:

https://github.com/thirtybees/thirtybees/commit/c733d5360d5292c12bb6a899748d9094bc608e05

https://github.com/thirtybees/thirtybees/commit/7ad147d991861e498e586f4dfc8ad1ff3cc114c0

https://github.com/thirtybees/thirtybees/commit/f04f1ded917b702465b2da6adfb7d573fdb974ad

Three commits, because it's based on this solution in the PS forum, but also more complete. For example, it also updates JavaScript validation to avoid fields turning red on valid names.

  • Like 3

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...