• Ресурсы форума переехали на Servahoc.ru

Помогите убрать рекапчу с страницы регистрации

ando

Участник
Пожалуйста закоментите строки, которые проверяют рекапчу, хочу ее отрубить

PHP:
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<style>.g-recaptcha > div { position: relative; margin: auto; }</style>

<div class="full-height-content fixed bg-grad-trans text-center">
    <div class="center-content p-a-lg">
        <img src="/user/images/mine.png" class="img-responsive m-x-auto m-y-lg" alt="Logo">

        <p class="ls" style="color:rgba(255, 255, 255, 0.7);font-weight: 100;"><?=$TEXT['sign-in-title'];?></p>

        <div class="form-group">
            <a href="./login" class="btn btn-white btn-outline btn-wide text-uppercase"><?=$TEXT['sign-in'];?></a>
        </div>
    </div>
    <footer class="rs-footer login-footer text-center">
        <span class="text-white small ls" style="font-weight:100;">© 2018 Pocket-Mine - All Rights Reserved.</span>
    </footer>
</div>

<div class="full-height-content right-side bg-white">
    <div class="p-a-md p-y-lg bg-white">
        <div class="row">
            <div class="col-md-8 col-md-offset-2">
                <p class="f-l-15 text-uppercase text-center text-muted m-y-lg"><?=$TEXT['create-account-title'];?></p>
                <form class="m-b-lg" id="regform">
                    <div class="form-group">
                        <label class="control-label loginlab"><?=$TEXT['form-title-1'];?></label>
                        <input type="text" class="form-control" name="login" minlength="3" maxlength="15" required="">
                        <p class="help-block" style="font-family: Rubik;font-weight: 100;letter-spacing: 0.5px;"><?=$TEXT['form-help-1'];?></p>
                    </div>
                    <div class="form-group">
                        <label class="control-label loginlab"><?=$TEXT['form-title-2'];?></label>
                        <input type="email" class="form-control" name="email" required="">
                        <p class="help-block"
                           style="font-family: Rubik;font-weight: 100;letter-spacing: 0.5px;color: #9e0707;"><?=$TEXT['form-help-2'];?></p>
                    </div>
                    <div class="row">
                        <div class="col-sm-6">
                            <div class="form-group">
                                <label class="control-label loginlab"><?=$TEXT['form-title-3'];?></label>
                                <input type="password" class="form-control" maxlength="20" minlength="6" name="pass1"
                                       required="">
                                <p class="help-block"
                                   style="font-family: Rubik;font-weight: 100;letter-spacing: 0.5px;"><?=$TEXT['form-help-3'];?></p>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="form-group">
                                <label class="control-label loginlab"><?=$TEXT['form-title-4'];?></label>
                                <input type="password" class="form-control" maxlength="20" minlength="6" name="pass2"
                                       required="">
                                <p class="help-block" style="font-family: Rubik;font-weight: 100;letter-spacing: 0.5px;"><?=$TEXT['form-help-4'];?></p>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="g-recaptcha" data-sitekey="6Lc3PZ0UAAAAAEUVzSO_FUZU1LmW4fso_l-W1X1g"></div>
                    </div>
                    <div class="form-group">
                        <div class="checkbox checkbox-custom text-muted">
                            <label class="ls" style="font-weight: 100;font-family: Rubik;">
                                <input type="checkbox" value="" checked="" required="">
                                <span class="checker"></span> <?=$TEXT['terms'];?>
                            </label>
                        </div>
                    </div>
                    <div class="form-group m-t-md">
                        <input type="hidden" name="type" value="signup">
                        <button class="btn btn-block insert_new_btn" style="border-radius: 2px;text-transform:uppercase;"><i class="fa fa-user-circle-o"></i> <?=$TEXT['create-account'];?></button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

PHP:
<?php
require 'classes/_mcrypt.class.php';
$mcrypt = new mcrypt();

$dlg = "ru";

if(!isset($_COOKIE['lang']) && empty($_COOKIE['lang'])) {
    setcookie("lang", $dlg, time() + 14 * 24 * 3600, "/");
}

$lang = isset($_COOKIE['lang']) && !empty($_COOKIE['lang']) ? func::clear($_COOKIE['lang']) : 'ru';
$lang = 'lang/' . $lang . '/forms/signup.lang.php';
include_once $lang;

if (!isset($_POST['login']) || empty($_POST['login'])) {
    echo status('err', $TEXT['error-1']);
    exit();
}
if (strlen($_POST['login']) <= 4) {
    echo status('err', $TEXT['error-2']);
    exit();
}
if (!isset($_POST['email']) || empty($_POST['email'])) {
    echo status('err', $TEXT['error-3']);
    exit();
}
if (!$func->isMail($_POST['email'])) {
    echo status('err', $TEXT['error-4']);
    exit();
}
if (!isset($_POST['pass1']) || empty($_POST['pass1'])) {
    echo status('err', $TEXT['error-5']);
    exit();
}
if (!isset($_POST['pass2']) || empty($_POST['pass2'])) {
    echo status('err', $TEXT['error-6']);
    exit();
}

if ($_POST['password'] != $_POST['confirm']) {
    echo status('err', $TEXT['error-7']);
    exit();
}
if (strlen($_POST['pass1']) <= 5) {
    echo status('err', $TEXT['error-8']);
    exit();
}

$recaptcha_secret = "6Lc3PZ0UAAAAAO5MxTJ8q44U1jnwEltIHR1-Tj_x";
$response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$recaptcha_secret."&response=".$_POST['g-recaptcha-response']."&remoteip=".$_SERVER['REMOTE_ADDR']);
$response = json_decode($response, true);
if($response["success"] === false) {
//    echo status('err', 're-CAPTCHA не пройдёна!');
    exit();
}

if($ip != '81.9.25.37') {
    $db->Query("SELECT * FROM users WHERE ip = '{$ip}'");
    if ($db->NumRows() > 0) {
        echo status('err', $TEXT['error-9']);
        exit();
    }
}

$email = $func->clear($_POST['email']);
$login = $func->clear($_POST['login']);

$arr = array('email' => $TEXT['email'], 'login' => $TEXT['login']);
foreach ($arr as $key => $value) {
    $db->Query("SELECT * FROM users WHERE {$key} = '{$$key}'");
    if ($db->NumRows() > 0) {
        echo status('err', $TEXT['such'].' ' . $value . ' '.$TEXT['already-exist-system']);
        exit();
    }
}

if (isset($_COOKIE['httpref'])) {
    $httpref = func::clear($_COOKIE['httpref']);
} else $httpref = '0';

$password = $func->clear($_POST['pass1']);
$password = $mcrypt->encrypt($password);

$time = date('Y-m-d H:i:s', time());

$db->Query("INSERT INTO users (login,email,password,ip,date_reg, last) VALUES ('{$login}','{$email}','{$password}','{$ip}','{$time}','{$time}')");
$id = $db->LastInsert();

$ref_1 = 0;
$ref_2 = 0;
if (isset($_COOKIE['referal']) && !empty($_COOKIE['referal'])) {
    $ref = func::clear($_COOKIE['referal']);
    $db->Query("SELECT * FROM users WHERE id = '{$ref}' OR login = '{$ref}'");
    if ($db->NumRows() > 0) {
        $info = $db->FetchArray();
        $db->Query("SELECT * FROM users_ref WHERE user_id = '{$info['id']}'");
        $ref_dat = $db->FetchArray();
        $ref_1 = $info['id'];
        $ref_2 = $ref_dat['ref_1'];
        $db->Query("UPDATE users SET refs = refs + '1' WHERE id = '{$ref_1}'");
        $db->Query("SELECT * FROM users_conf WHERE user_id = '{$ref_1}'");
        $us_dat = $db->FetchArray();
        $db->Query("INSERT INTO history (user_id, ref_id, type, b_pur, b_out, b_adv, date_op) VALUES ('{$ref_1}', '{$id}', '17', '{$us_dat['b_pur']}', '{$us_dat['b_out']}', '{$us_dat['b_adv']}', '{$time}')");
    } else {
        $ref_1 = 6;
    }
}

$db->Query("INSERT INTO users_conf (user_id,b_pur,b_out,b_adv) VALUES ('{$id}','0','0','0')");
$db->Query("INSERT INTO users_ref (user_id,ref_1,ref_2,to_ref_1,to_ref_2,httpref) VALUES ('{$id}','{$ref_1}','{$ref_2}','0','0','{$httpref}')");
$db->Query("INSERT INTO users_income (user_id) VALUES ('{$id}')");
$db->Query("INSERT INTO users_leaders (user_id) VALUES ('{$id}')");
$db->Query("SELECT * FROM item WHERE id = '1'");
if ($db->NumRows() > 0) {
    $item = $db->FetchArray();
    $db->Query("INSERT INTO users_items (user_id, item, sel, lvl, collection, date_op) VALUES ('{$id}', '{$item['id']}', '0', '1', '{$time}', '{$time}')");
}
$db->Query("INSERT INTO users_bonus (user_id, last_op) VALUES ('{$id}', '{$time}')");

$db->Query("INSERT INTO auth (user_id,ip,date_op) VALUES ('{$id}','{$ip}','{$time}')");

$_SESSION['user'] = $id;
$arr = array('type' => 'reload', 'msg' => $TEXT['success-signup'], 'link' => '/user/');
echo status('success', $arr);


Могу дать скрипт рулетки (не паблик) за помощь
 

ando

Участник
Если не трудно, отключите шифрование mcrypt, пожалуйста:)
 

APTEMOH

Участник
Вырезать:

HTML:
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<style>.g-recaptcha > div { position: relative; margin: auto; }</style>

<div class="form-group">
                        <div class="g-recaptcha" data-sitekey="6Lc3PZ0UAAAAAEUVzSO_FUZU1LmW4fso_l-W1X1g"></div>
                    </div>
PHP:
$recaptcha_secret = "6Lc3PZ0UAAAAAO5MxTJ8q44U1jnwEltIHR1-Tj_x";
$response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$recaptcha_secret."&response=".$_POST['g-recaptcha-response']."&remoteip=".$_SERVER['REMOTE_ADDR']);
$response = json_decode($response, true);
if($response["success"] === false) {
//    echo status('err', 're-CAPTCHA не пройдёна!');
    exit();
}
 
  • Like
Реакции: ando
Сверху