mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
Unqualified function/constant reference and much more
Signed-off-by: Yuriy Pikhtarev <iglix@me.com>
This commit is contained in:
parent
b08f6e898b
commit
78af495048
68 changed files with 273 additions and 277 deletions
47
dl.php
47
dl.php
|
@ -128,7 +128,6 @@ for ($i = 0; $i < $num_auth_pages && $authorised == false; $i++) {
|
|||
$topic_id = $row['topic_id'];
|
||||
$forum_id = $row['forum_id'];
|
||||
|
||||
$is_auth = array();
|
||||
$is_auth = auth(AUTH_ALL, $forum_id, $userdata);
|
||||
set_die_append_msg($forum_id, $topic_id);
|
||||
|
||||
|
@ -181,27 +180,27 @@ if ($download_mode == PHYSICAL_LINK) {
|
|||
$url = make_url($upload_dir . '/' . $attachment['physical_filename']);
|
||||
header('Location: ' . $url);
|
||||
exit;
|
||||
} else {
|
||||
if (IS_GUEST && !bb_captcha('check')) {
|
||||
global $template;
|
||||
|
||||
$redirect_url = $_POST['redirect_url'] ?? isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/';
|
||||
$message = '<form action="' . DOWNLOAD_URL . $attachment['attach_id'] . '" method="post">';
|
||||
$message .= $lang['CAPTCHA'] . ':';
|
||||
$message .= '<div class="mrg_10" align="center">' . bb_captcha('get') . '</div>';
|
||||
$message .= '<input type="hidden" name="redirect_url" value="' . $redirect_url . '" />';
|
||||
$message .= '<input type="submit" class="bold" value="' . $lang['SUBMIT'] . '" /> ';
|
||||
$message .= '<input type="button" class="bold" value="' . $lang['GO_BACK'] . '" onclick="document.location.href = \'' . $redirect_url . '\';" />';
|
||||
$message .= '</form>';
|
||||
|
||||
$template->assign_vars(array(
|
||||
'ERROR_MESSAGE' => $message,
|
||||
));
|
||||
|
||||
require(PAGE_HEADER);
|
||||
require(PAGE_FOOTER);
|
||||
}
|
||||
|
||||
send_file_to_browser($attachment, $upload_dir);
|
||||
exit;
|
||||
}
|
||||
|
||||
if (IS_GUEST && !bb_captcha('check')) {
|
||||
global $template;
|
||||
|
||||
$redirect_url = $_POST['redirect_url'] ?? $_SERVER['HTTP_REFERER'] ?? '/';
|
||||
$message = '<form action="' . DOWNLOAD_URL . $attachment['attach_id'] . '" method="post">';
|
||||
$message .= $lang['CAPTCHA'] . ':';
|
||||
$message .= '<div class="mrg_10" align="center">' . bb_captcha('get') . '</div>';
|
||||
$message .= '<input type="hidden" name="redirect_url" value="' . $redirect_url . '" />';
|
||||
$message .= '<input type="submit" class="bold" value="' . $lang['SUBMIT'] . '" /> ';
|
||||
$message .= '<input type="button" class="bold" value="' . $lang['GO_BACK'] . '" onclick="document.location.href = \'' . $redirect_url . '\';" />';
|
||||
$message .= '</form>';
|
||||
|
||||
$template->assign_vars(array(
|
||||
'ERROR_MESSAGE' => $message,
|
||||
));
|
||||
|
||||
require(PAGE_HEADER);
|
||||
require(PAGE_FOOTER);
|
||||
}
|
||||
|
||||
send_file_to_browser($attachment, $upload_dir);
|
||||
exit;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue