mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 14:23:57 -07:00
Добавление retracker.local через конфиг
This commit is contained in:
parent
1e78d6c0ea
commit
c2bceb9fc5
8 changed files with 26 additions and 19 deletions
|
@ -27,6 +27,7 @@ $default_cfg_bool = array(
|
|||
'update_dlstat' => 1,
|
||||
'limit_active_tor' => 0,
|
||||
'limit_concurrent_ips' => 0,
|
||||
'retracker_local' => 0
|
||||
);
|
||||
|
||||
$default_cfg_num = array(
|
||||
|
|
|
@ -188,6 +188,8 @@ $tr_cfg = array(
|
|||
'limit_leech_ips' => 0,
|
||||
'tor_topic_up' => true,
|
||||
'gold_silver_enabled' => true,
|
||||
'retracker_local' => false,
|
||||
'retracker_local_host' => 'http://retracker.local',
|
||||
);
|
||||
|
||||
$bb_cfg['show_dl_status_in_search'] = true;
|
||||
|
|
|
@ -32,19 +32,6 @@ function send_file_to_browser($attachment, $upload_dir)
|
|||
$gotit = true;
|
||||
}
|
||||
|
||||
//
|
||||
// Determine the Browser the User is using, because of some nasty incompatibilities.
|
||||
// Most of the methods used in this function are from phpMyAdmin. :)
|
||||
//
|
||||
if (!empty($_SERVER['HTTP_USER_AGENT']))
|
||||
{
|
||||
$HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
|
||||
}
|
||||
elseif (!isset($HTTP_USER_AGENT))
|
||||
{
|
||||
$HTTP_USER_AGENT = '';
|
||||
}
|
||||
|
||||
// Correct the mime type - we force application/octet-stream for all files, except images
|
||||
// Please do not change this, it is a security precaution
|
||||
if (!strstr($attachment['mimetype'], 'image'))
|
||||
|
@ -62,8 +49,8 @@ function send_file_to_browser($attachment, $upload_dir)
|
|||
// Now the tricky part... let's dance
|
||||
header('Pragma: public');
|
||||
$real_filename = clean_filename(basename($attachment['real_filename']));
|
||||
$mimetype = "{$attachment['mimetype']};";
|
||||
$charset = (@$lang['CONTENT_ENCODING']) ? "charset={$lang['CONTENT_ENCODING']};" : '';
|
||||
$mimetype = $attachment['mimetype'].';';
|
||||
$charset = (isset($lang['CONTENT_ENCODING'])) ? "charset={$lang['CONTENT_ENCODING']};" : '';
|
||||
|
||||
// Send out the Headers
|
||||
header("Content-Type: $mimetype $charset name=\"$real_filename\"");
|
||||
|
|
|
@ -354,7 +354,7 @@ function tracker_register ($attach_id, $mode = '', $tor_status = TOR_NOT_APPROVE
|
|||
|
||||
function send_torrent_with_passkey ($filename)
|
||||
{
|
||||
global $attachment, $auth_pages, $userdata, $bb_cfg, $lang;
|
||||
global $attachment, $auth_pages, $userdata, $bb_cfg, $tr_cfg, $lang;
|
||||
|
||||
if (!$bb_cfg['bt_add_auth_key'] || $attachment['extension'] !== TORRENT_EXT || !$size = @filesize($filename))
|
||||
{
|
||||
|
@ -456,11 +456,19 @@ function send_torrent_with_passkey ($filename)
|
|||
{
|
||||
unset($tor['announce-list']);
|
||||
}
|
||||
elseif (@$tor['announce-list'])
|
||||
elseif (isset($tor['announce-list']))
|
||||
{
|
||||
$tor['announce-list'] = array_merge($tor['announce-list'], array(array($announce)));
|
||||
}
|
||||
|
||||
// Add retracker.local
|
||||
if (isset($tr_cfg['retracker_local']) && $tr_cfg['retracker_local']) {
|
||||
if (!isset($tor['announce-list'])) {
|
||||
$tor['announce-list'] = array();
|
||||
}
|
||||
$tor['announce-list'][] = array($tr_cfg['retracker_local_host']);
|
||||
}
|
||||
|
||||
// Add publisher & topic url
|
||||
$publisher_name = $bb_cfg['server_name'];
|
||||
$publisher_url = make_url(TOPIC_URL . $topic_id);
|
||||
|
|
|
@ -2555,6 +2555,7 @@ $lang['USE_AUTH_KEY_EXPL'] = 'enable check for passkey';
|
|||
$lang['AUTH_KEY_NAME'] = 'Passkey name';
|
||||
$lang['AUTH_KEY_NAME_EXPL'] = 'passkey key name in GET request';
|
||||
$lang['ALLOW_GUEST_DL'] = 'Allow guest access to tracker';
|
||||
$lang['RETRACKER_LOCAL'] = 'Add retracker.local';
|
||||
|
||||
//
|
||||
// Forum config
|
||||
|
|
|
@ -2555,6 +2555,7 @@ $lang['USE_AUTH_KEY_EXPL'] = 'включить авторизацию по passk
|
|||
$lang['AUTH_KEY_NAME'] = 'Имя ключа passkey';
|
||||
$lang['AUTH_KEY_NAME_EXPL'] = 'имя ключа, который будет добавляться в GET запросе к announce url для идентификации юзера';
|
||||
$lang['ALLOW_GUEST_DL'] = 'Разрешить "гостям" (неавторизованным юзерам) доступ к трекеру';
|
||||
$lang['RETRACKER_LOCAL'] = 'Добавлять retracker.local';
|
||||
|
||||
//
|
||||
// Forum config
|
||||
|
|
|
@ -2555,7 +2555,7 @@ $lang['USE_AUTH_KEY_EXPL'] = 'включити авторизацію по passk
|
|||
$lang['AUTH_KEY_NAME'] = "Ім'я ключа passkey";
|
||||
$lang['AUTH_KEY_NAME_EXPL'] = "ім'я ключа, який буде додаватися до GET запиті до announce url для ідентифікації користувача";
|
||||
$lang['ALLOW_GUEST_DL'] = "Дозволити 'гостям' (неавторизованим юзерам) доступ до трекера";
|
||||
|
||||
$lang['RETRACKER_LOCAL'] = 'Додавати retracker.local';
|
||||
//
|
||||
// Forum config
|
||||
//
|
||||
|
|
|
@ -51,7 +51,14 @@
|
|||
<td><h4>{L_ALLOW_GUEST_DL}</h4><!-- IF L_ALLOW_GUEST_DL_EXPL --><h6>{L_ALLOW_GUEST_DL_EXPL}</h6><!-- ENDIF --></td>
|
||||
<td> <!-- IF $bb_cfg['bt_tor_browse_only_reg'] -->{L_NO}<!-- ELSE -->{L_YES}<!-- ENDIF --></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><h4>{L_RETRACKER_LOCAL}</h4></td>
|
||||
<td>
|
||||
<label for="retracker_true">
|
||||
<input type="radio" name="retracker" id="retracker_true" value="1" {RETRACKER_LOCAL_YES} /> {L_YES} </label>
|
||||
<label for="retracker_false"> <input type="radio" name="retracker" id="retracker_false" value="0" {RETRACKER_LOCAL_NO} /> {L_NO} </label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2">{L_LIMIT_ACTIVE_TOR_HEAD}</th>
|
||||
</tr>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue