I live ExBB and CMS Limbo! » Форумы и сайты » ExBB Community » Мод "Текстовое подтверждение при регистрации"

Страниц (1): [1]
 

1. технарь - 16 февраля 2018 — 06:51 - перейти к сообщению

Для установки необходимо:


1. открыть data/boardinfo.php

найти строку

PHP:
?>


перед которой вставить

PHP:
$this->exbb['text_confirmation'] = TRUE;



2. открыть admin/board_secure.tpl

найти строки

PHP:
<tr class="gen">
<td class="row1"><b>{$fm->LANG['AllowCodes']}</b> <img src="./im/images/help_ico.gif" alt='help' title ='{$fm->LANG['AllowCodesDesc']}'/></td>
<td class="row2"><input type="radio" name="new_exbb[b][exbbcodes]" value="yes" {$exbbcodes_yes} /> {$fm->LANG['Yes']}&nbsp;&nbsp;<input type="radio" name="new_exbb[b][exbbcodes]" value="no" {$exbbcodes_no} /> {$fm->LANG['No']}</td>
</tr>



добавить ниже строки


PHP:
<tr class="gen">
<td class="row1"><b>{$fm->LANG['AllowTextConf']}</b> <img src="./im/images/help_ico.gif" alt='help' title ='{$fm->LANG['AllowTextConfDesc']}'/></td>
<td class="row2"><input type="radio" name="new_exbb[b][text_confirmation]" value="yes" {$text_confirmation_yes} /> {$fm->LANG['Yes']}&nbsp;&nbsp;<input type="radio" name="new_exbb[b][text_confirmation]" value="no" {$text_confirmation_no} /> {$fm->LANG['No']}</td>
</tr>



3. открыть data/setvariables.php

найти

PHP:
$log_yes                = ($fm->exbb['log']) ? 'checked="checked"' : '';
$log_no = (!$fm->exbb['log']) ? 'checked="checked"' : '';


добавить ниже

PHP:
$text_confirmation_yes  = ($fm->exbb['text_confirmation']) ? 'checked="checked"' : '';
$text_confirmation_no = (!$fm->exbb['text_confirmation']) ? 'checked="checked"' : '';



4. открыть language/russian/lang_admin_setvariables.php

найти

PHP:
$this->LANG['AvatarUpload']         = 'Разрешить закачку личных аватар?';


перед которой добавить

PHP:
$this->LANG['AllowTextConf']        = 'Разрешить текстовое подтверждение при регистрации?';
$this->LANG['AllowTextConfDesc'] = 'При регистрации будет в текстовом режиме выведен вопрос на который нужно дать правильный ответ';



5. открыть templates/InvisionExBB/agreed.tpl

найти строки

PHP:
if ($fm->exbb['anti_bot'] === TRUE) 
{
echo <<<DATA
<tr>
<td class="profilleft"><b>{$fm->LANG['CaptchaCode']}</b><br /><span class="desc">{$fm->LANG['CaptchaBroken']}</span></td>
<td class="profilright"><img src="regimage.php" id="captcha" border="0" alt="captcha"></td>
</tr>
<tr>
<td class="profilleft"><b>{$fm->LANG['CaptchaСonfirm']}</b><br /><span class="desc">{$fm->LANG['CaptchaNote']}</span></td>
<td class="profilright"><input type="text" name="captcha" size="25" maxlength="10" onblur="verify_register(this);" />
<span id="verify_captcha"></span>
<script language="JavaScript" src="javascript/reload_captcha.js"></script></td>
</tr>
DATA;
}


после которых добавить

PHP:
if ($fm->exbb['text_confirmation'] === TRUE)
{
require('modules/text_confirmation/config.php');
$_SESSION['text_confirm'] = $value = $text_confirmation_config[array_rand($text_confirmation_config)];
echo <<<DATA
<tr>
<td class="profilleft"><b>{$value['title']}</b><br /><span class="desc">{$value['description']}</span></td>
<td class="profilright"><input type="text" name="confirm_question" size="25" maxlength="20"></td>
</tr>
DATA;
}


6. открыть register.php

найти строки

PHP:
if ($fm->exbb['anti_bot'] && ($fm->input['captcha'] == '' || !isset($_SESSION['captcha']) || $fm->input['captcha'] !== $_SESSION['captcha'])) 
{$fm->_Message($fm->LANG['Registration'],$fm->LANG['CaptchaError']);} // проверка капчи


после которых добавить

PHP:
if ($fm->exbb['text_confirmation'] === TRUE)                                                             // текстовое подтверждение
{
$value = $_SESSION['text_confirm'];
if ($fm->_LowerCase(trim($fm->input['confirm_question'])) !== $fm->_LowerCase($value['answer']))
{$fm->_Message($fm->LANG['Registration'], $fm->LANG['TextConfError']);}
}



7. открыть language/russian/lang_front_register.php

найти строку

PHP:
$this->LANG['NotNeededInfo']	= 'эта информация необязательна';


после которой добавить

PHP:
$this->LANG['TextConfError']    = 'Вы неправильно ответили на вопрос текстового подтверждения!';


8. создаем новую папку modules/text_confirmation в которой создаем файл config.php в который записываем примерно такой код

PHP:
<?php if (!defined('IN_EXBB')) die('Hack attempt!'); 

$text_confirmation_config = array
(
array
(
'title' => 'Контрольный вопрос',
'description' => 'Название самого короткого месяца в году',
'answer' => 'февраль'
),
array
(
'title' => 'Контрольный вопрос',
'description' => 'Столица России',
'answer' => 'Москва'
),
array
(
'title' => 'Контрольный вопрос',
'description' => 'Друг крокодила Гены',
'answer' => 'Чебурашка'
),
array
(
'title' => 'Контрольный вопрос',
'description' => 'Как называется второй месяц весны?',
'answer' => 'апрель'
)
);

?>


Правим этот файл под свои вопросы/ответы и пользуемся...

Powered by ExBB v1.1.180311