Author Topic: Anti-Bot: Are You Human/Bot? - 2.0 RC3 - RC4  (Read 6113 times)

Crip

  • Designer
  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Cripzone
Anti-Bot: Are You Human/Bot? - 2.0 RC3 - RC4
« on: November 04, 2010, 08:50:05 PM »
mod link: http://custom.simplemachines.org/mods/index.php?mod=999
 
manuel installing.
 
open: ./Sources/Register.php
 
find:
Code: [Select]

 // Under age restrictions?
Add Before
Code: [Select]
## Start MOD Are You Human? - Generating Code
if (!empty($modSettings['are_you_human_s']))
{
// Generate Random field name
$_SESSION['are_you_human']['name'] = chr(mt_rand(97, 122)) . md5(mt_rand());
$_SESSION['are_you_human']['answer'] = chr(mt_rand(97, 122)) . md5(mt_rand());

// Choice the Question
$context['are_you_human_question'] = $modSettings['are_you_human_q'] >> 1
? $txt['are_you_human_q' . mt_rand(1, 2)]
: ($modSettings['are_you_human_q'] ? $txt['are_you_human_q2'] : $txt['are_you_human_q1']);

// Choice the Answer
$answer_correct = $context['are_you_human_question'] == $txt['are_you_human_q1']
? $txt['are_you_human_answers'][0] : $txt['are_you_human_answers'][1];

// Shuffle the Answers?
if ($modSettings['are_you_human_a'])
shuffle($txt['are_you_human_answers']);

// Create the Options
$context['are_you_human_answers'] = '';
foreach ($txt['are_you_human_answers'] as $value)
$context['are_you_human_answers'] .= '
<option value="' . ($value == $answer_correct ? $_SESSION['are_you_human']['answer'] : chr(mt_rand(97, 122)) . md5(mt_rand())) . '">' . $value . '</option>';
unset($answer_correct);

// This page should be reaload always
header('Cache-Control: no-store');
}
## End MOD Are You Human? - Generating Code

Find:
Code: [Select]

 
// Are they under age, and under age users are banned?

Add Before:
Code: [Select]

 
## Start MOD Are You Human? - Capturing Bots

// Backup & Deleting SuperGlobal
$session = isset($_SESSION['are_you_human']) ? $_SESSION['are_you_human'] : false;
unset($_SESSION['are_you_human']);

// Are You Human?
if (!empty($modSettings['are_you_human_s']))
if (empty($session) || empty($_POST[$session['name']]) || $_POST[$session['name']] != $session['answer'])
fatal_lang_error(empty($session) ? 'are_you_human_expired' : 'are_you_human_fail', false);

// Old way - spammers should be the only one trying this
if (isset($_POST['areyouhuman']))
fatal_lang_error('are_you_human_fail', false);

## End MOD Are You Human? - Capturing Bots

open ./Sources/ManageRegistration.php
find:
Code: [Select]

 array('text', 'coppaPhone'),

add after:
Code: [Select]

 
'',
## MOD Are You Human?
array('check', 'are_you_human_s'),
array('select', 'are_you_human_q', array($txt['are_you_human_q_0'], $txt['are_you_human_q_1'], $txt['are_you_human_q_2'])),
array('check', 'are_you_human_a'),

Open ./Themes/default/languages/Modifications.english.php
find:
Code: [Select]

 ?>
add before:
Code: [Select]

 
// Are You Human?
$txt['are_you_human_q1'] = 'Are You Human?';
$txt['are_you_human_q2'] = 'Are You Bot?';
$txt['are_you_human_desc'] = 'Another Anti-Bot Measure';
$txt['are_you_human_answers'][0] = 'Yes';
$txt['are_you_human_answers'][1] = 'No';
$txt['are_you_human_answers'][2] = 'I don\'t know';
$txt['are_you_human_answers'][3] = 'Maybe';
$txt['are_you_human_answers'][4] = 'I think...';
$txt['are_you_human_answers'][5] = 'Waits';
$txt['are_you_human_answers'][6] = 'Hmm'; // You can add more Answers for confused the bots

$txt['are_you_human_expired'] = 'This page has expired. Please restart the <a href="' . $scripturl . '?action=register;">registration page</a>.';
$txt['are_you_human_fail'] = 'Please confirm that you are human in order to proceed with registration.<br />
Bots are not allowed to register.';

$txt['are_you_human_s'] = 'Enable MOD Are You Human';
$txt['are_you_human_q'] = 'Select the Question';
$txt['are_you_human_a'] = 'Order Rand the Answers';
$txt['are_you_human_q_0'] = 'Are You Human?';
$txt['are_you_human_q_1'] = 'Are You Bot?';
$txt['are_you_human_q_2'] = 'Random Question';

open  ./Themes/default/Register.template.php
 
find:
Code: [Select]

  // If OpenID is enabled, give the user a choice between password and OpenID.
Add before:
Code: [Select]

      if (!empty($modSettings['are_you_human_s']))
  echo '
     <dl class="register_form" id="openid_group">
      <dt>
       <b>', $context['are_you_human_question'], ':</b>
       <div class="smalltext">', $txt['are_you_human_desc'], '</div>
      </dt>
      <dd>
       <select name="', $_SESSION['are_you_human']['name'], '" tabindex="',  $context['tabindex']++, '" class="select">',
        $context['are_you_human_answers'], '
       </select>
      </dd>
     </dl>';

tomochita

  • Guest
Re: Anti-Bot: Are You Human/Bot? - 2.0 RC3 - RC4
« Reply #1 on: December 28, 2011, 11:25:53 AM »
ยางรถ ล้อแม็ก คุณภาพดี บริการส่ง ฟรี!! ทั่วประเทศ ⇒ wheelspecthailand

สำหรับท่านที่กำลังมองหา ล้อแม็ก ยางรถ คุณภาพเยี่ยม ต้องมาที่ วีลสเปคไทยแลนด์ ผู้นำมอเตอร์สปอร์ต ที่ใครๆก็อยากมา พร้อมโปรโมชั่นพิเศษมากมาย ซื้อ ล้อแม็ก ฟรี ยางรถ