Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Template Shares (http://www.bvlist.com/forumdisplay.php?f=26)
-   -   reCAPTCHA for tsue 2.2 (http://www.bvlist.com/showthread.php?t=11654)

TraceR 16th June 2018 14:42

reCAPTCHA for tsue 2.2
 
any one tried to upgrade from v1 reCAPTCHA to v2 reCAPTCHA in tsue 2.2 as old one is dead by google shutdown


Botanicar 16th June 2018 16:42

http://www.bvlist.com/showpost.php?p=51659&postcount=63

TraceR 16th June 2018 20:07

Quote:

Originally Posted by Botanicar (Post 52049)


i had a bit more good and better one but iam faild to validate to login system
https://i.gyazo.com/9125d45ad22288de...1e8bcbd263.png

Botanicar 16th June 2018 20:34

@TraceR


I have tested this option my self, and it works, without problems


Test it yourself and come back with resultate


Or disable reCaptcha

joeroberts 16th June 2018 22:10

did you update the conformation part?
this wont work for you but it well give you an idea
Code:

            $ip = $_SERVER['REMOTE_ADDR'];
            $response=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$recap_private_key."&response=".$recaptcha_response_field."&remoteip=".$ip);
            $responseKeys = json_decode($response,true);       
            $recap_pass = intval($responseKeys["success"]) !== 1 ? false : true;


TraceR 17th June 2018 07:27

this is tsue captcha class


Code:




class TSUE_captcha
{
    private $apiURL = "https://www.google.com/recaptcha/api/verify";
    private $privatekey = "6LfHFTQUAAAARFGHTDGGOyBEj7S";
    public $status = false;
    public $error = "";

    public function verifyCaptcha($recaptcha_challenge_field = "", $recaptcha_response_field = "")
    {
        $Query = http_build_query(array( "privatekey" => $this->privatekey, "remoteip" => MEMBER_IP, "challenge" => $recaptcha_challenge_field, "response" => $recaptcha_response_field ));
        if( function_exists("curl_init") && ($ch = curl_init()) )
        {
            curl_setopt($ch, CURLOPT_URL, $this->apiURL);
            curl_setopt($ch, CURLOPT_TIMEOUT, 15);
            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $Query);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_USERAGENT, "TSUE via cURL/PHP");
            $result = curl_exec($ch);
            curl_close($ch);
            if( $result )
            {
                $result = preg_split("/\\r\\n|\\r|\\n/", $result);
                if( trim($result["0"]) == "true" )
                {
                    $this->status = true;
                }
                else
                {
                    $this->error = trim($result["1"]);
                }

            }

        }

        return $this->status;
    }

}


bigjohn 17th June 2018 12:24

Quote:

Originally Posted by TraceR (Post 52054)
this is tsue captcha class


Code:




class TSUE_captcha
{
    private $apiURL = "https://www.google.com/recaptcha/api/verify";
    private $privatekey = "6LfHFTQUAAAARFGHTDGGOyBEj7S";
    public $status = false;
    public $error = "";

    public function verifyCaptcha($recaptcha_challenge_field = "", $recaptcha_response_field = "")
    {
        $Query = http_build_query(array( "privatekey" => $this->privatekey, "remoteip" => MEMBER_IP, "challenge" => $recaptcha_challenge_field, "response" => $recaptcha_response_field ));
        if( function_exists("curl_init") && ($ch = curl_init()) )
        {
            curl_setopt($ch, CURLOPT_URL, $this->apiURL);
            curl_setopt($ch, CURLOPT_TIMEOUT, 15);
            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $Query);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_USERAGENT, "TSUE via cURL/PHP");
            $result = curl_exec($ch);
            curl_close($ch);
            if( $result )
            {
                $result = preg_split("/\\r\\n|\\r|\\n/", $result);
                if( trim($result["0"]) == "true" )
                {
                    $this->status = true;
                }
                else
                {
                    $this->error = trim($result["1"]);
                }

            }

        }

        return $this->status;
    }

}


If you update this file it will not work at all for you as joe as said you need to mod the code given you can try to update the class but it not get you anywhere at all as it will kick you on login still it needs a overhall new code full stop all you can do is swith it off in tools till there is a full fix for this im working on now code for this as it is noone will get it to work ....as joe as said need new

Botanicar 17th June 2018 18:44

Like a say to you, my option working fine





https://s8.postimg.cc/ddtylpq45/Screenshot_3.jpg




https://s8.postimg.cc/tc2obuzrp/Screenshot_4.jpg

https://s8.postimg.cc/jerniskg5/Screenshot_5.jpg

joeroberts 17th June 2018 19:41

Quote:

Originally Posted by Botanicar (Post 52057)
Like a say to you, my option working fine

then please post your
Code:

class TSUE_captcha
so that we can move on with this
getting the First screen to show the confirmation box is fine but with out the part that checks it it is work less.

Botanicar 17th June 2018 20:03

Hi Joe,


like I write on this post, temporary solution:

http://www.bvlist.com/showpost.php?p=51659&postcount=63



Quote:

Appearance --> Themes --> Manage Templates: YOU_TEMPLATE --> signup
Code:








   

       

            {$signup_through_facebook}
            {$TSUE['TSUE_Language']->phrase['signup_form']}
       

   





   

       

       

   


   

       

           
       

       

           
       

   


   

       

       

   


   

       

           
       

       

           
       

   


   

       

       

   

   
   

       

           

               

               
           

       

       

           
       

   


   

       
{$TSUE['TSUE_Language']->phrase['memberinfo_gender']}

       

   


   

       

           
           
           
       

       
{$get_timezones}

   





   

       


YOU_SITE_KEY_HERE">

       

   




   

       

               
               
       

   





joeroberts 17th June 2018 21:56

Yes I know that but what about the part that takes place after you hit submit?
You know that part of the code that checks to make sure that you used the recaptcha check box and are confirmed?
the part your showing is only the part that displays the check box.

Botanicar 17th June 2018 22:06

Unfortunately, I do not know, because I completely disconnected this TSUE class_captcha from registration and use my own way of solving, because this key was linked to you know who ....

joeroberts 17th June 2018 23:04

try this
make sure you edit the Privatekey and it needs to be for v-2
Code:


class TSUE_captcha
{
    private $apiURL = "https://www.google.com/recaptcha/api/siteverify?secret=";
    private $privatekey = "6LfHFTQUAAAARFGHTDGGOyBEj7S";
    public $status = false;
    public $error = "";

    public function verifyCaptcha($recaptcha_challenge_field = "", $recaptcha_response_field = "")
    {
                $ip = $_SERVER['REMOTE_ADDR'];
                $response=file_get_contents($this->apiURL.$this->privatekey."&response=".$recaptcha_response_field."&remoteip=".$ip);
                $responseKeys = json_decode($response,true);       
                $this->status = intval($responseKeys["success"]) !== 1 ? false : true;
                if(!$this->status)
                {
                    $this->error = $responseKeys['error-codes'][0];
                }

        return $this->status;
    }

}


Botanicar 18th June 2018 09:53

Quote:

Originally Posted by joeroberts (Post 52062)
try this
make sure you edit the Privatekey and it needs to be for v-2




Not work, I don't use TSUE enymore I just try to help another people to make it to works

DjBlack 20th June 2018 01:29

reCAPTCHA for tsue 2.2
 
https://screenshotscdn.firefoxuserco...6bf7e25f77.png

Bump: Hi go to Dashboard then options - security and find CAPTCHA

Botanicar 20th June 2018 18:42

Quote:

Originally Posted by DjBlack (Post 52073)
Hi go to Dashboard then options - security and find CAPTCHA


all of us who use TSUE 2.2 know where to turn off or turn on reCaptcha, the masterpiece is how to fix reCaptcha from V1 to V2

Napon 20th June 2018 21:20

Thax for info mate looking into it now as we speak

joeroberts 21st June 2018 00:44

so Has it been confirmed what I posted did not work? I know Botanicar said that he was not able to test it.
here this one is updated and should work
Code:


class TSUE_captcha
{
    private $apiURL = "https://www.google.com/recaptcha/api/siteverify?secret=";
    private $privatekey = "6LfHFTQUAAAARFGHTDGGOyBEj7S";
    public $status = false;
    public $error = "";

    public function verifyCaptcha($recaptcha_challenge_field = "", $recaptcha_response_field = "")
    {
        global $_SERVER, $_POST;
                $ip = $_SERVER['REMOTE_ADDR'];
                $response=file_get_contents($this->apiURL.$this->privatekey."&response=".$_POST["g-recaptcha-response"]."&remoteip=".$ip);
                $responseKeys = json_decode($response,true);       
                $this->status = intval($responseKeys["success"]) !== 1 ? false : true;
                if(!$this->status)
                {
                    $this->error = $responseKeys['error-codes'][0];
                }

        return $this->status;
    }

}
?>


Napon 21st June 2018 09:14

Quote:

Originally Posted by joeroberts (Post 52078)
so Has it been confirmed what I posted did not work? I know Botanicar said that he was not able to test it.
here this one is updated and should work
Code:


class TSUE_captcha
{
    private $apiURL = "https://www.google.com/recaptcha/api/siteverify?secret=";
    private $privatekey = "6LfHFTQUAAAARFGHTDGGOyBEj7S";
    public $status = false;
    public $error = "";

    public function verifyCaptcha($recaptcha_challenge_field = "", $recaptcha_response_field = "")
    {
        global $_SERVER, $_POST;
                $ip = $_SERVER['REMOTE_ADDR'];
                $response=file_get_contents($this->apiURL.$this->privatekey."&response=".$_POST["g-recaptcha-response"]."&remoteip=".$ip);
                $responseKeys = json_decode($response,true);       
                $this->status = intval($responseKeys["success"]) !== 1 ? false : true;
                if(!$this->status)
                {
                    $this->error = $responseKeys['error-codes'][0];
                }

        return $this->status;
    }

}
?>


Joe it not working at all mate just done test on it on live host

Botanicar 21st June 2018 11:18

TSUE reCaptcha
 
I do not know why you ignore this solution, if it works for guys I help too then it should work for everyone:

http://www.bvlist.com/showpost.php?p=51659&postcount=63


https://s8.postimg.cc/kpuehgwg5/Screenshot_1.jpg


https://s8.postimg.cc/pbqiptpp1/Screenshot_2.jpg



https://s8.postimg.cc/i8ina7rz9/Screenshot_3.jpg


and damn the shit is ready, move on to the next problem

joeroberts 21st June 2018 11:40

dudes this is the confermation code it works with the first half that Botanicar posted http://www.bvlist.com/showpost.php?p=51659&postcount=63 he posted the theme part that you half to edit the templates the part I posted works after you hit login

Napon 21st June 2018 19:21

Ill do more test as im doing the repo very too for all to download for free mate
I hope everyone can wait for my new repo

Bump: http://fmdition.net/?p=home&pid=1

The above link is to show you all the new repack only up for a day or so then on i go to do a code for a mate

Botanicar 21st June 2018 23:02

Code:

You did not complete the CAPTCHA verification properly. Please try again.

thartley55 21st June 2018 23:57

Get the following message...EVERY time.

attention

Attention

You did not complete the CAPTCHA verification properly. Please try again.




joeroberts 22nd June 2018 02:50

ok lets start all this from the begining
#1 you must have a V2 puplic and private key!!!!!!!!
#2 the site you are testing this on MUST be setup in
Your reCAPTCHA sites

open
ajax/forgot_password.php and find
Code:

if( !$verifyCaptcha->verifyCaptcha($recaptcha_challenge_field, $recaptcha_response_field) )
and make it
Code:

        if( !$verifyCaptcha->verifyCaptcha($recaptcha_challenge_field, $_POST["g-recaptcha-response"]) )
now open ajax/signup.php and do the same find
Code:

if( !$verifyCaptcha->verifyCaptcha($recaptcha_challenge_field, $recaptcha_response_field) )
and make it
Code:

        if( !$verifyCaptcha->verifyCaptcha($recaptcha_challenge_field, $_POST["g-recaptcha-response"]) )
open library/classes/class_captcha.php
and replace the content with
Code:


class TSUE_captcha
{
    private $apiURL = "https://www.google.com/recaptcha/api/siteverify?secret=";
    private $privatekey = "";//PUT YOUR PRIVATE KEY HERE
    public $status = false;
    public $error = "";

    public function verifyCaptcha($recaptcha_challenge_field = "", $recaptcha_response_field = "")
    {
        global $_POST;
                $ip = $_SERVER['REMOTE_ADDR'];
                $response=file_get_contents($this->apiURL.$this->privatekey."&response=".$recaptcha_response_field."&remoteip=".$ip);
                $responseKeys = json_decode($response,true);       
                $this->status = intval($responseKeys["success"]) !== 1 ? false : true;
                if(!$this->status)
                {
                    $this->error = $responseKeys['error-codes'][0];
                }

        return $this->status;
    }

}
?>


Botanicar 22nd June 2018 10:10

something missing in the code


https://s8.postimg.cc/6xq3fvfp1/Screenshot_1.jpg

joeroberts 22nd June 2018 12:02

You have made the edit in the templates?
Paste this snippet before the closing
Code:


tag on your HTML template:
Code:


Paste this snippet at the end of the
Code:


where you want the reCAPTCHA widget to appear:
Code:



Napon 22nd June 2018 15:25

http://fmdition.net/index.php?p=home&pid=1

Ok testing signups on demo site

hart 22nd June 2018 16:30

Quote:

Originally Posted by Napon (Post 52089)
http://fmdition.net/index.php?p=home&pid=1

Ok testing signups on demo site

Napon your site not working :wallbash:

maybe you could run your own website like that:lol:

Napon 22nd June 2018 17:03

It was not lol as i was editing files on signup ok try now to signup all good to go

Botanicar 22nd June 2018 19:38

@joeroberts this fix not working for me

@napon you site not workin at all

joeroberts 23rd June 2018 01:26

any one got this source code setup that well give me access to do some testing?
ok I see the problem you well need to change
Code:


to
Code:


Who on earth don't add a method to a form?

Napon 23rd June 2018 10:00

Ok today ill put the test site back up
Then joe can set up ill give you admincp

TraceR 23rd June 2018 10:35

Quote:

Originally Posted by Napon (Post 52101)
Ok today ill put the test site back up
Then joe can set up ill give you admincp


i already sent ftp details to jeo to my demo server

joeroberts 23rd June 2018 12:09

please try the last edit I posted with out the method="post" it well not work

TraceR 23rd June 2018 12:27

Quote:

Originally Posted by joeroberts (Post 52104)
please try the last edit I posted with out the method="post" it well not work


its not working after your latest updates too

Napon 23rd June 2018 16:08

Joe i tryed it and it said ( please wait loading) but it would not take on signup

joeroberts 24th June 2018 02:14

OK I know that you well need to change js/tsue/signup.js
Code:

    if(TSUESettings['security_enable_captcha'] == "1")
    {
        buildQuery += '&recaptcha_challenge_field='+$.TSUE.urlEncode($('#recaptcha_challenge_field').val())+'&recaptcha_response_field='+$.TSUE.urlEncode($('#recaptcha_response_field').val());
    }

to
Code:

    if(TSUESettings['security_enable_captcha'] == "1")
    {
        buildQuery += '&recaptcha_challenge_field='+$.TSUE.urlEncode($('#recaptcha_challenge_field').val())+'&recaptcha_response_field='+$.TSUE.urlEncode($('#g-recaptcha-response').attr("value"));
    }


Napon 24th June 2018 10:34

Yes joe like i put in my dowmload of FMDEition in the read me files mate it as to be done there ok what ill do is add your edits and test it.... it also in pages/signup too. And ill do a new imdb mod too

Ok working demo site here
http://fmdition.net/?p=home&pid=1

Just a few more edits then filly done

TraceR 16th July 2018 00:21

i request users not to use this on live server,just found few bugs on this fix ,, its not working on CF enabled and few browsers and another one is if your password is changed you cont login

Bump: after scanning with pentesting tool found few XSS vulnerabilities on this addon created by bvlist admin jeo


All times are GMT +2. The time now is 18:25.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.