Капча для гостя при скачивании файлов git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@118 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
nanosimbiot 2011-07-17 21:18:51 +00:00
commit 317468eae6
4 changed files with 23 additions and 5 deletions

View file

@ -57,8 +57,8 @@ $bb_cfg['css_ver'] = 1;
// Increase number of revision after update
$bb_cfg['tp_version'] = '2.0.2';
$bb_cfg['tp_release_state'] = 'TP II r112';
$bb_cfg['tp_release_date'] = '15-07-2011';
$bb_cfg['tp_release_state'] = 'TP II r118';
$bb_cfg['tp_release_date'] = '18-07-2011';
$bb_cfg['board_disabled_msg'] = 'форум временно отключен'; // 'forums temporarily disabled'; // show this msg if board has been disabled via ON/OFF trigger
$bb_cfg['srv_overloaded_msg'] = "Извините, в данный момент сервер перегружен\nПопробуйте повторить запрос через несколько минут";

View file

@ -343,6 +343,24 @@ if ($download_mode == PHYSICAL_LINK)
}
else
{
if(IS_GUEST && !CAPTCHA()->verify_code())
{
global $template;
$redirect_url = !empty($_POST['redirect_url']) ? $_POST['redirect_url'] : $_SERVER['HTTP_REFERER'];
$message = '<form action="'. DOWNLOAD_URL . $attachment['attach_id'] .'" method="post">';
$message .= $lang['CONFIRM_CODE'];
$message .= '<div class="mrg_10">'. CAPTCHA()->get_html() .'</div>';
$message .= '<input type="hidden" name="redirect_url" value="'. $redirect_url .'" />';
$message .= '<input type="submit" class="bold" value="'. $lang['SUBMIT'] .'" /> &nbsp;';
$message .= '<input type="button" class="bold" value="Вернуться обратно" onclick="document.location.href = \''. $redirect_url .'\';" />';
$message .= '</form>';
$template->assign_vars(array(
'ERROR_MESSAGE' => $message,
));
require(PAGE_HEADER);
require(PAGE_FOOTER);
}
if (intval($attach_config['allow_ftp_upload']))
{
// We do not need a download path, we are not downloading physically

View file

@ -116,7 +116,7 @@ function tracker_unregister ($attach_id, $mode = '')
// XBTT
if($bb_cfg['announce_type'] == 'xbt')
{
$sql = 'INSERT INTO '. BB_BT_TORRENTS ."_del(topic_id, info_hash)
$sql = "INSERT INTO ". BB_BT_TORRENTS ."_del(topic_id, info_hash)
SELECT topic_id, info_hash
FROM ". BB_BT_TORRENTS ."
WHERE attach_id = $attach_id ON DUPLICATE KEY UPDATE is_del=1";
@ -470,7 +470,7 @@ function send_torrent_with_passkey ($filename)
message_die(GENERAL_ERROR, $lang['PASSKEY_ERR_TOR_NOT_REG']);
}
if (bf($userdata['user_opt'], 'user_opt', 'allow_passkey'))
if (bf($userdata['user_opt'], 'user_opt', 'allow_passkey') && !IS_GUEST)
{
message_die(GENERAL_ERROR, 'Could not add passkey');
}

View file

@ -139,8 +139,8 @@
<input title="Alt+Enter" type="submit" name="preview" value="{L_PREVIEW}" id="post-preview-btn" onclick="$('#post-submit').remove();" />&nbsp;&nbsp;
<input title="Ctrl+Enter" type="submit" name="post" class="bold" value="{L_SUBMIT}" id="post-submit-btn" />
<input type="button" value="Быстрый предпросмотр" onclick="ajax.exec({ action: 'view_message', message: $('textarea.editor').val() });">
<div id="post-js-warn">Для отправки сообщений необходимo включить JavaScript</div>
</div>
<div id="post-js-warn">Для отправки сообщений необходимo включить JavaScript</div>
<script type="text/javascript">
function dis_submit_btn ()