Example #1
0
 private function get_html()
 {
     $config = RMFunctions::get()->plugin_settings('ayah', true);
     self::set_config();
     require_once RMCPATH . '/plugins/ayah/include/ayah.php';
     $ayah = new AYAH();
     $ayah->debug_mode($config['debug']);
     return $ayah->getPublisherHTML();
 }
Example #2
0
 public function check()
 {
     $config = RMFunctions::get()->plugin_settings('recaptcha', true);
     $this->set_config();
     include_once RMCPATH . '/plugins/ayah/include/ayah.php';
     $ayah = new AYAH();
     $ayah->debug_mode($config['debug']);
     $resp = $ayah->scoreResult();
     return $resp;
 }
Example #3
0
function getHtmlByName($captcha)
{
    if ($captcha == 'sweet') {
        //sweet-captcha
        //$sweetcaptcha = new $sweetcaptcha(237528,'1bdea965d3b5c76f8e181497c7f13a42','22e2f639510c142c5217bc7324fb0ba2','sweetcaptcha.php');
        //require_once('sweetcaptcha.php');
        return $sweetcaptcha->get_html();
    } elseif ($captcha == 're') {
        //recaptcha
        $publickey = "6Lf3kAYTAAAAAGJpD5oRTiwMHDF2Enp5jjDCxOAh";
        $privatekey = "6Lf3kAYTAAAAAEMVCybX4IDJtl_uEpJKuQsPc8Q5";
        return recaptcha_get_html($publickey, null);
    } elseif ($captcha == 'playtrue') {
        ////playtruecaptcha stuff
        $ayah = new AYAH();
        return $ayah->getPublisherHTML();
    } elseif ($captcha == 'secureimage') {
        ///secure image suff
        $options = array();
        $options['input_name'] = 'ct_captcha';
        return Securimage::getCaptchaHtml($options);
    }
}
Example #4
0
         if (array_key_exists('address', $_POST)) {
             $resp = solvemedia_check_answer($data['solvemedia_verification_key'], getIP(), array_key_exists('adcopy_challenge', $_POST) ? $_POST['adcopy_challenge'] : '', array_key_exists('adcopy_response', $_POST) ? $_POST['adcopy_response'] : '', $data["solvemedia_auth_key"]);
             $data["captcha_valid"] = $resp->is_valid;
         }
         break;
     case 'reCaptcha':
         $data["captcha"] = str_replace('<:: your_site_key ::>', $data["recaptcha_public_key"], $recaptcha_template);
         if (array_key_exists('address', $_POST)) {
             $url = 'https://www.google.com/recaptcha/api/siteverify?secret=' . $data["recaptcha_private_key"] . '&response=' . (array_key_exists('g-recaptcha-response', $_POST) ? $_POST["g-recaptcha-response"] : '') . '&remoteip=' . getIP();
             $resp = json_decode(file_get_contents($url), true);
             $data['captcha_valid'] = $resp['success'];
         }
         break;
     case 'AreYouAHuman':
         require_once "libs/ayahlib.php";
         $ayah = new AYAH(array('publisher_key' => $data['ayah_publisher_key'], 'scoring_key' => $data['ayah_scoring_key'], 'web_service_host' => 'ws.areyouahuman.com', 'debug_mode' => false, 'use_curl' => !$connection_options['disable_curl']));
         $data['captcha'] = $ayah->getPublisherHTML();
         if (array_key_exists('address', $_POST)) {
             $score = $ayah->scoreResult();
             $data['captcha_valid'] = $score;
         }
         break;
     case 'FunCaptcha':
         require_once "libs/funcaptcha.php";
         $funcaptcha = new FUNCAPTCHA();
         $data["captcha"] = $funcaptcha->getFunCaptcha($data["funcaptcha_public_key"]);
         if (array_key_exists('address', $_POST)) {
             $data['captcha_valid'] = $funcaptcha->checkResult($data["funcaptcha_private_key"]);
         }
         break;
 }
Example #5
0
//
//
// Include the dropbox preferences -- we need this to have the
// dropbox filepaths setup for us, beyond simply needing our
// configuration!
//
require "../config/preferences.php";
require "recaptchalib.php";
require_once "ayah.php";
var_dump(NSSDROPBOX_LIB_DIR);
require_once NSSDROPBOX_LIB_DIR . "Smartyconf.php";
require_once NSSDROPBOX_LIB_DIR . "NSSDropoff.php";
require_once NSSDROPBOX_LIB_DIR . "Verify.php";
if ($theDropbox = new NSSDropbox($NSSDROPBOX_PREFS)) {
    $theDropbox->SetupPage();
    $ayah = new AYAH();
    if ($_POST['Action'] == "verify") {
        //
        // Posted form data indicates that a dropoff form was filled-out
        // and submitted.
        //
        // If the request key is provided, then pull it out and look it up.
        // If it's a real one, then just redirect straight out to the pre-
        // populated New Dropoff page by simulating them clicking the link
        // in the email they will receive.
        if ($_POST['req'] != '') {
            $reqKey = $_POST['req'];
            $reqKey = preg_replace('/[^a-zA-Z0-9]/', '', $reqKey);
            $reqKey = strtolower(substr($reqKey, 0, 12));
            // Get 1st 3 words
            $recordlist = $theDropbox->database->DBReadReqData($reqKey);
Example #6
0
File: apply.php Project: binbot/l4h
<?php

session_start();
# PlayThru
require_once "captcha/ayah.php";
$ayah = new AYAH();
# Load previous form data, if there was an errors
if ($_POST['submitapp']) {
    require "backend/PHP/submitapplication.php";
}
?>
<!DOCTYPE html>
<html>
    <head>
        <title>
            Apply - Linux4Hope
        </title>
        <link href="style.css" rel="stylesheet" type="text/css">
        <link href="assets/icon.png" rel="shortcut icon">
        <script src="http://use.edgefonts.net/chunk;muli:n3,n4.js"></script>
        <script src='http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js'></script>
        <script src='assets/scripts/script.js'></script>
    </head>
    <body>
        <div id="bg-inner">
            <!-- Background inner begin -->
            <div class="colors">
                <div class="white"></div>
                <div class="black"></div>
                <div class="white"></div>
            </div>
Example #7
0
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script> //bootstrap 3.1.1
<style>body{margin: 30px;}</style>
<h1>AltCoin (ALT) Faucet</h1>
<hr />
<?php 
require_once "ayah.php";
// Install areyouahuman.com into this folder.
require_once "jsonRPCClient.php";
//get this here: http://jsonrpcphp.org/
$alt = new jsonRPCClient('http://*****:*****@localhost:port/');
//set to altcoind user/pass/port
$min = 1;
//set to minimum payout
$max = 5;
//set to max payout
$ayah = new AYAH();
if (array_key_exists('submit', $_POST)) {
    $score = $ayah->scoreResult();
    if ($score) {
        $username = $_POST['address'];
        if (!empty($_POST['address'])) {
            if ($alt->getbalance() < 1) {
                echo '<div class="alert alert-dismissable alert-danger"><button type="button" class="close" data-dismiss="alert">×</button><strong>Error:</strong> <a href="#" class="alert-link"></a>Not enough balance.</div>';
            } else {
                $check = $alt->validateaddress($username);
                if ($check["isvalid"] == 1) {
                    $amount = rand($min, $max);
                    $alt->sendtoaddress($username, $amount);
                    echo '<div class="alert alert-dismissable alert-success"><button type="button" class="close" data-dismiss="alert">×</button><strong></strong> <a href="#" class="alert-link"></a>You got ';
                    echo $amount;
                    echo " ALT!</div>";
Example #8
0
<?php

////////sweet captcha
require_once 'sweetcaptcha.php';
//////recaptcha stuff
require_once 'recaptchalib.php';
/////playtrecaptcha stuff
require_once "ayah.php";
require_once "DetectDevice.php";
$ayah = new AYAH();
////secure image stuff
require_once 'securimage.php';
if ($_SERVER['REQUEST_METHOD'] == "GET") {
    header('Content - type: application/text');
    $url = $_SERVER['QUERY_STRING'];
    $detect = new DetectDevice();
    $captcha = $detect->getSelctedCaptcha($url);
    if ($captcha == 'sweet') {
        echo $sweetcaptcha->get_html();
    } elseif ($captcha == 're') {
        //recaptcha
        $publickey = "6Lf3kAYTAAAAAGJpD5oRTiwMHDF2Enp5jjDCxOAh";
        $privatekey = "6Lf3kAYTAAAAAEMVCybX4IDJtl_uEpJKuQsPc8Q5";
        $recaptcha = recaptcha_get_html($publickey, null);
        echo '<input type="text" placeholder="Name" value="re" name="Captcha" disabled="" style="display: none;">';
        echo $recaptcha;
    } elseif ($captcha == 'playtrue') {
        ////playtruecaptcha stuff
        //$ayah = new AYAH();
        echo $ayah->getPublisherHTML();
    } elseif ($captcha == 'secureimage') {
Example #9
0
<?php

define('_VALID', true);
require 'include/config.php';
require 'include/function_global.php';
require 'classes/filter.class.php';
require 'classes/validation.class.php';
require 'include/function_smarty.php';
require 'classes/email.class.php';
if ($config['user_registration'] == '0') {
    VRedirect::go($config['BASE_URL'] . '/error/registration_disabled');
}
if ($config['captcha'] == '1') {
    require_once "modules/ayah/ayah.php";
    $ayah = new AYAH();
    if (array_key_exists('submit_signup', $_POST)) {
        // Use the AYAH object to see if the user passed or failed the game.
        $score = $ayah->scoreResult();
        if ($score) {
            // This happens if the user passes the game. In this case,
            // we're just displaying a congratulatory message.
            // echo "Congratulations: you are a human!";
        } else {
            // This happens if the user does not pass the game.
            // echo "Sorry, but we were not able to verify you as human. Please try again.";
            $errors[] = $lang['signup.captcha'];
            $err['captcha'] = 1;
        }
    }
    $areyh = $ayah->getPublisherHTML();
    $smarty->assign('areyh', $areyh);
Example #10
0
 /**
  * Internal element validation
  *
  * @param   array $data          form data
  * @param   int   $repeatCounter repeat group counter
  *
  * @return bool
  */
 public function validate($data, $repeatCounter = 0)
 {
     $params = $this->getParams();
     $input = $this->app->input;
     if (!$this->canUse()) {
         return true;
     }
     if ($params->get('captcha-method') == 'recaptcha') {
         if (!function_exists('_recaptcha_qsencode')) {
             require_once JPATH_SITE . '/plugins/fabrik_element/captcha/libs/recaptcha-php-1.11/recaptchalib.php';
         }
         $privateKey = $params->get('recaptcha_privatekey');
         if ($input->get('recaptcha_response_field')) {
             $challenge = $input->get('recaptcha_challenge_field');
             $response = $input->get('recaptcha_response_field');
             $resp = recaptcha_check_answer($privateKey, FabrikString::filteredIp(), $challenge, $response);
             return $resp->is_valid ? true : false;
         }
         return false;
     } elseif ($params->get('captcha-method') == 'nocaptcha') {
         if ($input->get('g-recaptcha-response')) {
             require_once JPATH_SITE . '/plugins/fabrik_element/captcha/libs/ReCaptcha/ReCaptcha.php';
             require_once JPATH_SITE . '/plugins/fabrik_element/captcha/libs/ReCaptcha/RequestMethod.php';
             require_once JPATH_SITE . '/plugins/fabrik_element/captcha/libs/ReCaptcha/RequestMethod/Post.php';
             require_once JPATH_SITE . '/plugins/fabrik_element/captcha/libs/ReCaptcha/RequestParameters.php';
             require_once JPATH_SITE . '/plugins/fabrik_element/captcha/libs/ReCaptcha/Response.php';
             $privateKey = $params->get('recaptcha_privatekey');
             $noCaptcha = new \ReCaptcha\ReCaptcha($privateKey);
             $response = $input->get('g-recaptcha-response');
             $server = $input->server->get('REMOTE_ADDR');
             $resp = $noCaptcha->verify($response, $server);
             if ($resp->isSuccess()) {
                 return true;
             } else {
                 if (FabrikHelperHTML::isDebug()) {
                     $msg = "noCaptcha error: ";
                     foreach ($resp->getErrorCodes() as $code) {
                         $msg .= '<tt>' . $code . '</tt> ';
                     }
                     $this->app->enqueueMessage($msg);
                 }
                 return false;
             }
         }
         if (FabrikHelperHTML::isDebug()) {
             $this->app->enqueueMessage("No g-recaptcha-response!");
         }
         return false;
     } elseif ($params->get('captcha-method') == 'playthru') {
         if (!defined('AYAH_PUBLISHER_KEY')) {
             define('AYAH_PUBLISHER_KEY', $params->get('playthru_publisher_key', ''));
             define('AYAH_SCORING_KEY', $params->get('playthru_scoring_key', ''));
         }
         require_once JPATH_SITE . '/plugins/fabrik_element/captcha/libs/ayah_php_bundle_1.1.7/ayah.php';
         $ayah = new AYAH();
         return $ayah->scoreResult();
     } else {
         $this->getParams();
         if ($this->session->get('com_' . $this->package . '.element.captcha.security_code', null) != $data) {
             return false;
         }
         return true;
     }
 }
Example #11
0
 public function doCaptcha($display = true)
 {
     $captcha = parent::getOption('integration-captcha');
     switch ($captcha) {
         case 'reCAPTCHA':
             require_once 'captcha/recaptcha-1.11/recaptchalib.php';
             $publickey = parent::getOption('reCAPTCHA-public-key');
             $privatekey = parent::getOption('reCAPTCHA-private-key');
             /* Captcha has been submitted. */
             if (!empty($_POST['recaptcha_response_field'])) {
                 $resp = recaptcha_check_answer($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
                 if (!$resp->is_valid) {
                     $this->captchaError = $resp->error;
                 }
             } else {
                 $this->captchaError = true;
             }
             if ($display) {
                 echo recaptcha_get_html($publickey, $this->captchaError);
             }
             break;
         case 'playThru':
             if (!defined('AYAH_PUBLISHER_KEY')) {
                 define('AYAH_PUBLISHER_KEY', parent::getOption('playThru-publisher-key'));
             }
             if (!defined('AYAH_SCORING_KEY')) {
                 define('AYAH_SCORING_KEY', parent::getOption('playThru-scoring-key'));
             }
             if (!defined('AYAH_WEB_SERVICE_HOST')) {
                 define('AYAH_WEB_SERVICE_HOST', 'ws.areyouahuman.com');
             }
             require_once 'captcha/ayah-1.0.2/ayah.php';
             $integration = new AYAH();
             if (!$display && !empty($_POST) && !$integration->scoreResult()) {
                 $this->captchaError = true;
             }
             /* Show the captcha form. */
             if ($display) {
                 echo $integration->getPublisherHTML();
             }
             break;
     }
 }
Example #12
0
 /**
  * @return bool
  */
 function validate_captcha()
 {
     global $db, $lang, $mybb, $session, $plugins;
     $plugins->run_hooks('captcha_validate_start', $this);
     if ($this->type == 1) {
         // We have a normal CAPTCHA to handle
         $imagehash = $db->escape_string($mybb->input['imagehash']);
         $imagestring = $db->escape_string(my_strtolower($mybb->input['imagestring']));
         switch ($db->type) {
             case 'mysql':
             case 'mysqli':
                 $field = 'imagestring';
                 break;
             default:
                 $field = 'LOWER(imagestring)';
                 break;
         }
         $query = $db->simple_select("captcha", "*", "imagehash = '{$imagehash}' AND {$field} = '{$imagestring}'");
         $imgcheck = $db->fetch_array($query);
         if (!$imgcheck) {
             $this->set_error($lang->invalid_captcha_verify);
             $db->delete_query("captcha", "imagehash = '{$imagehash}'");
         }
     } elseif ($this->type == 2) {
         $challenge = $mybb->input['recaptcha_challenge_field'];
         $response = $mybb->input['recaptcha_response_field'];
         if (!$challenge || strlen($challenge) == 0 || !$response || strlen($response) == 0) {
             $this->set_error($lang->invalid_captcha);
         } else {
             // We have a reCAPTCHA to handle
             $data = $this->_qsencode(array('privatekey' => $mybb->settings['captchaprivatekey'], 'remoteip' => $session->ipaddress, 'challenge' => $challenge, 'response' => $response));
             // Contact Google and see if our reCAPTCHA was successful
             $http_request = "POST /recaptcha/api/verify HTTP/1.0\r\n";
             $http_request .= "Host: {$this->verify_server}\r\n";
             $http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n";
             $http_request .= "Content-Length: " . strlen($data) . "\r\n";
             $http_request .= "User-Agent: reCAPTCHA/PHP\r\n";
             $http_request .= "\r\n";
             $http_request .= $data;
             $fs = @fsockopen($this->verify_server, 80, $errno, $errstr, 10);
             if ($fs == false) {
                 $this->set_error($lang->invalid_captcha_transmit);
             } else {
                 // We connected, but is it correct?
                 fwrite($fs, $http_request);
                 while (!feof($fs)) {
                     $response .= fgets($fs, 1160);
                 }
                 fclose($fs);
                 $response = explode("\r\n\r\n", $response, 2);
                 $answer = explode("\n", $response[1]);
                 if (trim($answer[0]) != 'true') {
                     // We got it wrong! Oh no...
                     $this->set_error($lang->invalid_captcha_verify);
                 }
             }
         }
     } elseif ($this->type == 4) {
         $response = $mybb->input['g-recaptcha-response'];
         if (!$response || strlen($response) == 0) {
             $this->set_error($lang->invalid_nocaptcha);
         } else {
             // We have a noCAPTCHA to handle
             // Contact Google and see if our reCAPTCHA was successful
             $response = fetch_remote_file($this->verify_server, array('secret' => $mybb->settings['captchaprivatekey'], 'remoteip' => $session->ipaddress, 'response' => $response));
             if ($response == false) {
                 $this->set_error($lang->invalid_nocaptcha_transmit);
             } else {
                 $answer = json_decode($response, true);
                 if ($answer['success'] != 'true') {
                     // We got it wrong! Oh no...
                     $this->set_error($lang->invalid_nocaptcha);
                 }
             }
         }
     } elseif ($this->type == 3) {
         define('AYAH_PUBLISHER_KEY', $this->ayah_publisher_key);
         define('AYAH_SCORING_KEY', $this->ayah_scoring_key);
         define('AYAH_USE_CURL', $this->ayah_use_curl);
         define('AYAH_DEBUG_MODE', $this->ayah_debug_mode);
         define('AYAH_WEB_SERVICE_HOST', $this->ayah_web_service_host);
         require_once MYBB_ROOT . "inc/3rdparty/ayah/ayah.php";
         $ayah = new AYAH();
         $result = $ayah->scoreResult();
         if ($result == false) {
             $this->set_error($lang->invalid_ayah_result);
         }
     }
     $plugins->run_hooks('captcha_validate_end', $this);
     if (count($this->errors) > 0) {
         return false;
     } else {
         return true;
     }
 }
Example #13
0
function form_antibot($title = false, $input_name, $input_id, $input_value = false, $array = false)
{
    /* To do
    * To do: label off
    * Note: DO NOT USE DISABLED, it will not pass information to server. Use "readonly" instead.
    */
    global $_POST;
    if (isset($title) && $title !== "") {
        $title = stripinput($title);
    } else {
        $title = "";
    }
    if (isset($input_name) && $input_name !== "") {
        $input_name = stripinput($input_name);
    } else {
        $input_name = "";
    }
    if (isset($input_id) && $input_id !== "") {
        $input_id = stripinput($input_id);
    } else {
        $input_id = "";
    }
    if (isset($input_value) && $input_value !== "") {
        $input_value = stripinput($input_value);
    } else {
        $input_value = "";
    }
    // 4 choices to sub-array
    // a. icon, b. button, c.dropdown list d.dropdown with modal
    if (!is_array($array)) {
        $array = array();
        $state_validation = "";
        $before = "";
        $after = "";
        $required = "";
        $placeholder = "";
        $deactivate = "";
        $width = "";
        $class = "input-sm";
        $well = "";
        $type = "";
        $stacking = "";
    } else {
        $before = array_key_exists('before', $array) ? $array['before'] : "";
        $after = array_key_exists('after', $array) ? $array['after'] : "";
        $placeholder = array_key_exists('placeholder', $array) ? $array['placeholder'] : "";
        $deactivate = array_key_exists('deactivate', $array) ? $array['deactivate'] : "";
        $class = array_key_exists('class', $array) ? $array['class'] : "input-sm";
        $required = array_key_exists('required', $array) ? $array['required'] : "";
        $width = array_key_exists('width', $array) ? "style='width: " . $array['width'] . "'" : "";
        $well = array_key_exists('well', $array) ? "style='margin-top:-10px;'" : "";
        $type = array_key_exists('password', $array) && $array['password'] == "1" ? "password" : "text";
        $stacking = array_key_exists("stacking", $array) ? 1 : "";
    }
    if ($required == "1" && (isset($_POST[$input_name]) && empty($_POST[$input_name]))) {
        $state_validation = "has-error";
    } else {
        $state_validation = "";
    }
    if ($stacking == "1") {
        $col = "col-sm-12 col-md-12 col-lg-12";
        $col2 = "col-sm-12 col-md-12 col-lg-12";
    } else {
        $col = "col-sm-12 col-md-3 col-lg-3 control-label";
        $col2 = "col-sm-12 col-md-9 col-lg-9";
    }
    // Append/Prepend Plugin API
    if (!empty($before) || !empty($after)) {
        $init_bs3 = "<div class='input-group'>";
        $end_bs3 = "</div>";
    } else {
        // cancel plugin
        $init_bs3 = "";
        $end_bs3 = "";
    }
    $html = "";
    if (!empty($title)) {
        $html .= "<div class='form-group " . $state_validation . "'>";
        $html .= "<label for='{$input_id}-0' class='{$col}'>{$title}</label>";
        $html .= "<div class='{$col2}' {$well}>";
    }
    // Are you a human
    require_once INCLUDES . "captchas/ayah/ayah.php";
    $ayah = new AYAH();
    if (array_key_exists('ayah_submit', $_POST)) {
        $score = $ayah->scoreResult();
        if ($score) {
            $html = "Congratulations: you are a human!";
        } else {
            $html = "Sorry, but we were not able to verify you as human. Please try again.";
        }
    }
    $html .= "<div class='row'>";
    $html .= "<div class='col-sm-12 col-md-12 col-lg-12'>";
    $html .= $ayah->getPublisherHTML();
    $html .= "</div>";
    $html .= "</div>";
    if (!empty($title)) {
        $html .= "</div></div>";
    }
    return $html;
}
Example #14
0
function ust_signup_fields_bp()
{
    $ust_settings = get_site_option("ust_settings");
    if ($ust_settings['signup_protect'] == 'recaptcha') {
        $recaptcha = get_site_option('ust_recaptcha');
        require_once 'includes/recaptchalib.php';
        echo '<div class="register-section" id="blog-details-section">';
        echo "<script type='text/javascript'>var RecaptchaOptions = { theme : '{$recaptcha['theme']}', lang : '{$recaptcha['lang']}' , tabindex : 30 };</script>";
        echo '<label>' . __('Human Verification:', 'ust') . '</label>';
        do_action('bp_recaptcha_errors');
        echo '<div id="reCAPTCHA">';
        echo rp_recaptcha_get_html($recaptcha['pubkey']);
        echo '</div></div>';
    } else {
        if ($ust_settings['signup_protect'] == 'asirra') {
            echo '<div class="register-section" id="blog-details-section">';
            echo '<label>' . __('Human Verification:', 'ust') . '</label>';
            do_action('bp_asirra_errors');
            echo '<div id="asirraError"></div>';
            echo '<script type="text/javascript" src="http://challenge.asirra.com/js/AsirraClientSide.js"></script>';
            echo '<script type="text/javascript">
          asirraState.SetEnlargedPosition("right");
          asirraState.SetCellsPerRow(4);
          formElt = document.getElementById("signup_form");
          formElt.onsubmit = function() { return MySubmitForm(); };
          
          var passThroughFormSubmit = false;
          function MySubmitForm() {
            if (passThroughFormSubmit) {
              return true;
            }
            Asirra_CheckIfHuman(HumanCheckComplete);

            return false;
          }
          function HumanCheckComplete(isHuman) {
            if (!isHuman) {
              asirraError = document.getElementById("asirraError");
              asirraError.innerHTML = \'<div class="error">' . __('Please try to correctly identify the cats again.', 'ust') . '</div>\';
              return false;
            } else {
              passThroughFormSubmit = true;
              formElt.submit();
              return true;
            }
            
          }
          </script>';
            echo '</div>';
            echo '<input type="hidden" name="signup_submit" value="1" />';
        } else {
            if ($ust_settings['signup_protect'] == 'questions') {
                $ust_qa = get_site_option("ust_qa");
                if (is_array($ust_qa) && count($ust_qa)) {
                    $qkey = rand(0, count($ust_qa) - 1);
                    //encrypt the answer field name to make it harder for sploggers to guess. Changes every hour & different for every site.
                    $salt = get_site_option("ust_salt");
                    $datesalt = strtotime(date('Y-m-d H:00:00'));
                    $field_name = 'qa_' . md5($qkey . $salt . $datesalt);
                    echo '<div class="register-section" id="antisplog">';
                    echo '<label>' . __('Human Verification:', 'ust') . '</label>';
                    do_action('bp_qa_errors');
                    echo stripslashes($ust_qa[$qkey][0]);
                    echo '<br /><input type="text" id="qa" name="' . $field_name . '" value="' . htmlentities($_POST[$field_name]) . '" />';
                    echo '<br /><small>' . __('NOTE: Answers are not case sensitive.', 'ust') . '</small>';
                    echo '</div>';
                }
            } else {
                if ($ust_settings['signup_protect'] == 'ayah') {
                    $ust_ayah = get_site_option("ust_ayah");
                    require_once "includes/ayah.php";
                    $integration = new AYAH(array("publisher_key" => @$ust_ayah['pubkey'], "scoring_key" => @$ust_ayah['privkey']));
                    echo '<div class="register-section" id="blog-details-section">';
                    do_action('bp_ayah_errors');
                    echo $integration->getPublisherHTML();
                    echo '</div>';
                }
            }
        }
    }
}
Example #15
0
     $auth = $_POST['auth'];
     $authIP = '';
     $authEmail = '';
     $authOrganization = '';
     $authExpiry = 0;
     $result = $theDropbox->ReadAuthData($auth, $authIP, $authEmail, $authOrganization, $authExpiry);
     if (!$result) {
         $theDropbox->SetupPage();
         NSSError($smarty->getConfigVariable('ErrorDownloadAuth'), "Authentication Failure");
     }
     if ($authExpiry > time() && $authIP == $_SERVER["REMOTE_ADDR"]) {
         $authSuccess = TRUE;
     }
     // Everything succeeded, so let them through.
 }
 $ayah = new AYAH();
 $captcha = $theDropbox->captcha();
 // Check their recaptcha result. If they passed, then write an AuthData
 // record with their IP in the Name field. This is then used by download.php.
 // If they failed, re-present the pickup page as if they just went there
 // again, but with an error message at the top telling them they were wrong.
 if ($authSuccess || isset($_POST['Action']) && $_POST['Action'] == "Pickup") {
     $resp = FALSE;
     if (!$authSuccess) {
         if ($captcha == 'areyouahuman') {
             $resp = $ayah->scoreResult();
         } elseif ($captcha == 'google' || $captcha == '') {
             // Using Google or an old version without this set
             $reCaptchaPrivateKey = $theDropbox->recaptchaPrivateKey();
             if ($reCaptchaPrivateKey == 'disabled') {
                 $resp = TRUE;
 /**
  * Gets the HTML that will be displayed on a form.
  *
  * @return {string} HTML
  */
 function getForm()
 {
     $ayah = new AYAH();
     return $ayah->getPublisherHTML() . '<noscript>' . wfMessage('areyouahumancaptcha-nojs')->parse() . '</noscript>';
 }