diff --git a/upload/includes/functions.php b/upload/includes/functions.php index 158fe516d..96faf799d 100644 --- a/upload/includes/functions.php +++ b/upload/includes/functions.php @@ -1066,6 +1066,7 @@ class html_common function _array2html_rec ($array, $ul, $li) { + @natsort($array); foreach ($array as $k => $v) { if (is_array($v)) diff --git a/upload/includes/functions_torrent.php b/upload/includes/functions_torrent.php index 5d95dbcd3..4f55427d1 100644 --- a/upload/includes/functions_torrent.php +++ b/upload/includes/functions_torrent.php @@ -465,12 +465,7 @@ function send_torrent_with_passkey ($filename) } } - // Redirect guests to login page - if (IS_GUEST) - { - $redirect_url = ($post_id) ? POST_URL . $post_id : 'index.php'; - redirect(LOGIN_URL . $redirect_url); - } + if (!$attachment['tracker_status']) { @@ -487,7 +482,7 @@ function send_torrent_with_passkey ($filename) $passkey_val = $bt_userdata['auth_key']; } - if (!$passkey_val && $userdata['session_logged_in']) + if (!$passkey_val) { if ($bb_cfg['bt_gen_passkey_on_reg']) { @@ -563,20 +558,16 @@ function send_torrent_with_passkey ($filename) message_die(GENERAL_ERROR, 'This is not a bencoded file'); } - $passkey_url = (!$userdata['session_logged_in'] || isset($_GET['no_passkey'])) ? '' : "?$passkey_key=$passkey_val&"; - if ($passkey_url) + // XBTT unique passkey + if($bb_cfg['announce_type'] == 'xbt') { - // XBTT unique passkey - if($bb_cfg['announce_type'] == 'xbt') - { - $info_hash = pack('H*', sha1(bencode($tor['info']))); - $passkey = substr('00000000'. dechex($userdata['user_id']), -8) . substr(sha1($bb_cfg['torrent_pass_private_key'] .' '. $passkey_val .' '. $userdata['user_id'] .' '. $info_hash), 0, 24); - $announce = preg_replace('@/a[^/]*$@i', "/$passkey$0", $ann_url); - } - else - { - $announce = strval($ann_url . $passkey_url); - } + $info_hash = pack('H*', sha1(bencode($tor['info']))); + $passkey = substr('00000000'. dechex($userdata['user_id']), -8) . substr(sha1($bb_cfg['torrent_pass_private_key'] .' '. $passkey_val .' '. $userdata['user_id'] .' '. $info_hash), 0, 24); + $announce = preg_replace('@/a[^/]*$@i', "/$passkey$0", $ann_url); + } + else + { + $announce = strval($ann_url . "?$passkey_key=$passkey_val&"); } // Replace original announce url with tracker default diff --git a/upload/includes/ucp/usercp_register.php b/upload/includes/ucp/usercp_register.php index c443bbb38..628f3df5c 100644 --- a/upload/includes/ucp/usercp_register.php +++ b/upload/includes/ucp/usercp_register.php @@ -48,7 +48,11 @@ switch ($mode) // Ограничение по времени else if ($bb_cfg['new_user_reg_restricted']) { - require(BB_PATH .'/misc/php/registration_restrict_hours.php'); + if (in_array(date('G'), array(0,/*1,2,3,4,5,6,7,8,11,12,13,14,15,16,*/17,18,19,20,21,22,23))) + { + bb_die('В данный момент регистрация закрыта

Вы можете зарегистрироваться с 01:00 до 17:00 MSK (сейчас '. date('G:i') .' MSK)

Приносим извинения за это временное неудобство'); + } + } // Вывод начальной страницы с условиями регистрации if (empty($_POST['reg_agreed']))