Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
Captcha TTv3
Nothing found.
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Mods in Progress

2021-01-17 18:37:35
little class i made using this https://torrenttrader.uk/topic?topicid=9935#post67759

first in config the keys you get from here https://www.google.com/recaptcha/about/


// Captcha use google api
$site_config['CAPTCHA_ON'] =true;
$site_config['CAPTCHA_KEY'] = 'googlecaptchakey';
$site_config['CAPTCHA_SECRET'] = 'googlecaptchasecret';


in account login find
if ($_POST["username"] && $_POST["password"]) {


add below
(new Captcha)->response($_POST['g-recaptcha-response']);


find
<tr><td align="center"><b><?php echo T_("PASSWORD"); ?>:</b> <input type="password" size="40" name="password" /></td></tr>


below add
<?php  (new Captcha)->html(); ?>


find in backend / function.php
require_once(BACKEND."/languages.php");


add under
require_once(BACKEND."/Captcha.php");


make file called Captcha.php add in backend folder
<?php

class Captcha
{
  private $key;
  private $secret;

  public function __construct()
  {
      global $site_config;
  $this->key = $site_config['CAPTCHA_KEY'];
      $this->secret = $site_config['CAPTCHA_SECRET'];
  }

  public function response($captcha)
  {
      global $site_config;
  if ($site_config['CAPTCHA_ON']) {
          if (!$captcha) {
              autolink(T_('<b>Please check the the captcha form.</b>'), "account-login.php");
          }
          $secret = $site_config['CAPTCHA_SECRET'];
          $verifyResponse = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=' . $this->secret . '&response=' . $captcha);
          $responseData = json_decode($verifyResponse);
          if ($responseData->success) {
              // its successfull so let it go
      } else {
              autolink(T_('<b>Please check the the captcha form.</b>'), "account-login.php");
  }
       }
  }

  public function html()
  {
      global $site_config;
  if ($site_config['CAPTCHA_ON']) {
          return print("<div class='g-recaptcha' data-theme='light' data-sitekey='" . $this->key . "'></div>");
      }
  }

}
Last edited by M-jay warn on 2021-09-08 17:39:27
2021-09-08 15:02:32
for signup

account-signup find
if ($_GET["takesignup"] == "1") {


below add

(new Captcha)->response($_POST['g-recaptcha-response']);


find
<tr>
<td align="center" colspan="2">
    <input type="submit" value="<?php echo T_("SIGNUP"); ?>" />
</td>
</tr>


add above
<tr>
 <td align="center" colspan="2">
 <?php (new Captcha)->html(); ?>
</td>
</tr>
Last edited by M-jay warn on 2021-09-08 17:40:03
2021-09-08 23:27:25
I will try this and see how it works on my version
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Last edited by MicroMonkey on 2021-09-09 10:46:34
2021-09-09 22:39:59
COOL! #1 m8 Bad Boys M-jay  :fire  :love
Last edited by spiritblue on 2021-09-09 22:40:53
2022-03-20 10:25:44
Bonjour

j'ai dernierement déménager sur un nouveau serveur et dès je complete le reCAPTCHA a la connexion il me donne l'erreur j'ai pas completer le reCAPTCHA mais ilfonctionnais bien sur le vieux serveur,

vous avez une idée de ce qui provoque ce bug?
========================================

Hello

I recently moved to a new server and as soon as I complete the reCAPTCHA at login it gives me the error I did not complete the reCAPTCHA but it worked fine on the old server,

do you have any idea what is causing this bug?

2022-03-20 12:24:45
A new server = maybe dns change

1 Try turn off in config & empty keys

2 in Google admin remove site eg https://www.google.com/recaptcha/admin/site/438532290/settings

3 turn config on/true (no keys) try site it should stop connection

4 back to Google admin add domain back get keys and add to config

Google needs to re-connect, or I think you can add a new site get new keys and do it that way

#####################

Un nouveau serveur = peut-être un changement de DNS

1 Essayez de désactiver dans la configuration et les touches vides

2 dans Google admin supprimer le site, par exemple https://www.google.com/recaptcha/admin/site/438532290/settings

3 allumez la configuration/true (pas de clés) essayez le site, il devrait arrêter la connexion

4 retour à l'administrateur Google ajouter le domaine récupérer les clés et ajouter à la configuration

Google doit se reconnecter, ou je pense que vous pouvez ajouter un nouveau site, obtenir de nouvelles clés et procéder ainsi
2022-03-20 17:39:49
merci M-jay ton aide

j'ai fait comme dit, effectivement javais 6 sites, donc j’ai garder un mais tous ce faire encore par le retour de page login?
Mon dns est #1 https://mxtoolbox.com/SuperTool.aspx?action=dns%3acrazyspirits.com&run=networktools
=================================

thank you M-jay your help

I did as said, actually I had 6 sites, so I kept one but all this to do again by returning from the login page?
My dns is #1 https://mxtoolbox.com/SuperTool.aspx?action=dns%3acrazyspirits.com&run=networktools
Last edited by spiritblue on 2022-03-20 17:40:06
2022-03-20 20:22:39
I remove captcha keys here & delete in google admin - but still works - maybe google has cache - no keys but all browsers work - strange
how long on new server ?

#################################

Je supprime les clés captcha ici et les supprime dans google admin - mais fonctionne toujours - peut-être que google a du cache - pas de clés mais tous les navigateurs fonctionnent - étrange
combien de temps sur nouveau serveur ?
2022-03-20 20:42:13
oui j'ai supprimer les clé et re-créer un site avec clée ou pas il me redirige encore, sa fait 4 jours environs j'ai le nouveau serveur
========================
yes I deleted the keys and re-created a site with key or not it redirects me again, it's been around 4 days I have the new server

2022-03-21 10:48:58
perhaps unset($responseData);
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
2022-03-21 22:26:59
j’ai trouver une solution
j’ai mis en écrit le deuxième autolink après le else
et testé avec d'autres navigateurs et ça bien fonctionner

((merci de l'aide les amis  👍

==================================

I found a solution
I wrote the second autolink after the else
and tested with other browsers and it works well

((thanks for the help friends 👍
2022-12-18 14:40:21
This mod doesn't work. after editing the files the login button disappears and if you try to login the page gives error 500.
2022-12-18 19:39:19
perhaps post your login php file
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
2023-01-01 19:53:23
Ok, I have already found the error. There was a missing "?>" at the end of the Captcha.php code.

But still I have another problem. Now the captcha appears without problems, but when I fill out the form and press the register button, "account login.php redirection" appears on the screen and it redirects me to a url "https://www.mydomain.com/<b>Please check the the captcha form.</b>"

I have reviewed the code 3 times and everything is perfect. I'm just trying to put it in the register, not in the login.
2023-01-01 20:51:51
If this doesnt work out, force image upload (like a Avatar) and validate the heck out of the file before accepting. This will throw bots in the garbage.
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728