Commit 5d046f85 authored by Gabor Hudiczius's avatar Gabor Hudiczius
Browse files

rtwi-0.3.5-100220

parent db24b197
......@@ -172,6 +172,7 @@ $viewtypes = array(
$refreshrates = array(
"refreshrate_0" => "關閉",
"refreshrate_5" => "5 seconds",
"refreshrate_60" => "1 分鐘",
"refreshrate_180" => "3 分鐘",
"refreshrate_420" => "7 分鐘",
......
......@@ -172,6 +172,7 @@ $viewtypes = array(
$refreshrates = array(
"refreshrate_0" => "Aus",
"refreshrate_5" => "5 seconds",
"refreshrate_60" => "1 Minute",
"refreshrate_180" => "3 Minuten",
"refreshrate_420" => "7 Minuten",
......
......@@ -172,6 +172,7 @@ $viewtypes = array(
$refreshrates = array(
"refreshrate_0" => "Off",
"refreshrate_5" => "5 seconds",
"refreshrate_60" => "1 minute",
"refreshrate_180" => "3 minutes",
"refreshrate_420" => "7 minutes",
......
......@@ -172,6 +172,7 @@ $viewtypes = array(
$refreshrates = array(
"refreshrate_0" => "Letiltva",
"refreshrate_5" => "5 másodperc",
"refreshrate_60" => "1 perc",
"refreshrate_180" => "3 perc",
"refreshrate_420" => "7 perc",
......
......@@ -88,7 +88,6 @@ function prepare_serverinfo_responses( &$responses, &$message, &$config ) {
$responses["upload_rate_suffix"] = $upload_rate_arr[1];
$responses["check_hash_value"] = $responses["check_hash"] == 0 ? $message["no"] : $message["yes"];
$responses["handshake_log_value"] = $responses["handshake_log"] == 0 ? $message["no"] : $message["yes"];
$responses["safe_sync_value"] = $responses["safe_sync"] == 0 ? $message["no"] : $message["yes"];
$responses["use_udp_trackers_value"] = $responses["use_udp_trackers"] == 0 ? $message["no"] : $message["yes"];
......@@ -462,8 +461,8 @@ $multicallnum = 0;
// initializing xmlrpc methods
$xmlrpc_methods = array(
"si" => $config["dht"] === "1" ?
array( "dht_statistics", "get_bind", "get_check_hash", "get_connection_leech", "get_connection_seed", "get_dht_port", "get_directory", "get_download_rate", "get_handshake_log", "get_hash_interval", "get_hash_max_tries", "get_hash_read_ahead", "get_http_cacert", "get_http_capath", "get_http_proxy", "get_ip", "get_key_layout", "get_max_downloads_div", "get_max_downloads_global", "get_max_file_size", "get_max_memory_usage", "get_max_open_files", "get_max_open_http", "get_max_open_sockets", "get_max_peers", "get_max_peers_seed", "get_max_uploads", "get_max_uploads_div", "get_max_uploads_global", "get_memory_usage", "get_min_peers", "get_min_peers_seed", "get_name", "get_peer_exchange", "get_port_open", "get_port_random", "get_port_range", "get_preload_min_size", "get_preload_required_rate", "get_preload_type", "get_proxy_address", "get_receive_buffer_size", "get_safe_free_diskspace", "get_safe_sync", "get_scgi_dont_route", "get_send_buffer_size", "get_session", "get_session_lock", "get_session_on_completion", "get_split_file_size", "get_split_suffix", "get_stats_not_preloaded", "get_stats_preloaded", "get_timeout_safe_sync", "get_timeout_sync", "get_tracker_dump", "get_tracker_numwant", "get_upload_rate", "get_use_udp_trackers", "system.client_version", "system.get_cwd", "system.hostname", "system.library_version", "system.pid", "view_list" ) :
array( "get_bind", "get_check_hash", "get_connection_leech", "get_connection_seed", "get_directory", "get_download_rate", "get_handshake_log", "get_hash_interval", "get_hash_max_tries", "get_hash_read_ahead", "get_http_cacert", "get_http_capath", "get_http_proxy", "get_ip", "get_key_layout", "get_max_downloads_div", "get_max_downloads_global", "get_max_file_size", "get_max_memory_usage", "get_max_open_files", "get_max_open_http", "get_max_open_sockets", "get_max_peers", "get_max_peers_seed", "get_max_uploads", "get_max_uploads_div", "get_max_uploads_global", "get_memory_usage", "get_min_peers", "get_min_peers_seed", "get_name", "get_peer_exchange", "get_port_open", "get_port_random", "get_port_range", "get_preload_min_size", "get_preload_required_rate", "get_preload_type", "get_proxy_address", "get_receive_buffer_size", "get_safe_free_diskspace", "get_safe_sync", "get_scgi_dont_route", "get_send_buffer_size", "get_session", "get_session_lock", "get_session_on_completion", "get_split_file_size", "get_split_suffix", "get_stats_not_preloaded", "get_stats_preloaded", "get_timeout_safe_sync", "get_timeout_sync", "get_tracker_dump", "get_tracker_numwant", "get_upload_rate", "get_use_udp_trackers", "system.client_version", "system.get_cwd", "system.hostname", "system.library_version", "system.pid", "view_list" ),
array( "dht_statistics", "get_bind", "get_check_hash", "get_connection_leech", "get_connection_seed", "get_dht_port", "get_directory", "get_download_rate", "get_hash_interval", "get_hash_max_tries", "get_hash_read_ahead", "get_http_cacert", "get_http_capath", "get_http_proxy", "get_ip", "get_key_layout", "get_max_downloads_div", "get_max_downloads_global", "get_max_file_size", "get_max_memory_usage", "get_max_open_files", "get_max_open_http", "get_max_open_sockets", "get_max_peers", "get_max_peers_seed", "get_max_uploads", "get_max_uploads_div", "get_max_uploads_global", "get_memory_usage", "get_min_peers", "get_min_peers_seed", "get_name", "get_peer_exchange", "get_port_open", "get_port_random", "get_port_range", "get_preload_min_size", "get_preload_required_rate", "get_preload_type", "get_proxy_address", "get_receive_buffer_size", "get_safe_free_diskspace", "get_safe_sync", "get_scgi_dont_route", "get_send_buffer_size", "get_session", "get_session_lock", "get_session_on_completion", "get_split_file_size", "get_split_suffix", "get_stats_not_preloaded", "get_stats_preloaded", "get_timeout_safe_sync", "get_timeout_sync", "get_tracker_numwant", "get_upload_rate", "get_use_udp_trackers", "system.client_version", "system.get_cwd", "system.hostname", "system.library_version", "system.pid", "view_list" ) :
array( "get_bind", "get_check_hash", "get_connection_leech", "get_connection_seed", "get_directory", "get_download_rate", "get_hash_interval", "get_hash_max_tries", "get_hash_read_ahead", "get_http_cacert", "get_http_capath", "get_http_proxy", "get_ip", "get_key_layout", "get_max_downloads_div", "get_max_downloads_global", "get_max_file_size", "get_max_memory_usage", "get_max_open_files", "get_max_open_http", "get_max_open_sockets", "get_max_peers", "get_max_peers_seed", "get_max_uploads", "get_max_uploads_div", "get_max_uploads_global", "get_memory_usage", "get_min_peers", "get_min_peers_seed", "get_name", "get_peer_exchange", "get_port_open", "get_port_random", "get_port_range", "get_preload_min_size", "get_preload_required_rate", "get_preload_type", "get_proxy_address", "get_receive_buffer_size", "get_safe_free_diskspace", "get_safe_sync", "get_scgi_dont_route", "get_send_buffer_size", "get_session", "get_session_lock", "get_session_on_completion", "get_split_file_size", "get_split_suffix", "get_stats_not_preloaded", "get_stats_preloaded", "get_timeout_safe_sync", "get_timeout_sync", "get_tracker_numwant", "get_upload_rate", "get_use_udp_trackers", "system.client_version", "system.get_cwd", "system.hostname", "system.library_version", "system.pid", "view_list" ),
"d" => array( "d.get_base_filename=", "d.get_base_path=", "d.get_bytes_done=", "d.get_chunk_size=", "d.get_chunks_hashed=", "d.get_complete=", "d.get_completed_bytes=", "d.get_completed_chunks=", "d.get_connection_current=", "d.get_connection_leech=", "d.get_connection_seed=", "d.get_creation_date=", "d.get_custom1=", "d.get_custom2=", "d.get_custom3=", "d.get_custom4=", "d.get_custom5=", "d.get_directory=", "d.get_down_rate=", "d.get_down_total=", "d.get_free_diskspace=", "d.get_hash=", "d.get_hashing=", "d.get_ignore_commands=", "d.get_left_bytes=", "d.get_local_id=", "d.get_local_id_html=", "d.get_max_file_size=", "d.get_max_size_pex=", "d.get_message=", "d.get_name=", "d.get_peer_exchange=", "d.get_peers_accounted=", "d.get_peers_complete=", "d.get_peers_connected=", "d.get_peers_max=", "d.get_peers_min=", "d.get_peers_not_connected=", "d.get_priority=", "d.get_priority_str=", "d.get_ratio=", "d.get_size_bytes=", "d.get_size_chunks=", "d.get_size_files=", "d.get_size_pex=", "d.get_skip_rate=", "d.get_skip_total=", "d.get_state=", "d.get_state_changed=", "d.get_tied_to_file=", "d.get_tracker_focus=", "d.get_tracker_numwant=", "d.get_tracker_size=", "d.get_up_rate=", "d.get_up_total=", "d.get_uploads_max=", "d.is_active=", "d.is_hash_checked=", "d.is_hash_checking=", "d.is_multi_file=", "d.is_open=", "d.is_pex_active=", "d.is_private=" ),
"f" => array( "f.get_completed_chunks=", "f.get_frozen_path=", "f.is_created=", "f.is_open=", "f.get_last_touched=", "f.get_match_depth_next=", "f.get_match_depth_prev=", "f.get_offset=", "f.get_path=", "f.get_path_components=", "f.get_path_depth=", "f.get_priority=", "f.get_range_first=", "f.get_range_second=", "f.get_size_bytes=", "f.get_size_chunks=" ),
"p" => array( "p.get_address=", "p.get_client_version=", "p.get_completed_percent=", "p.get_down_rate=", "p.get_down_total=", "p.get_id=", "p.get_id_html=", "p.get_options_str=", "p.get_peer_rate=", "p.get_peer_total=", "p.get_port=", "p.get_up_rate=", "p.get_up_total=", "p.is_encrypted=", "p.is_incoming=", "p.is_obfuscated=", "p.is_snubbed=" ),
......@@ -472,6 +471,12 @@ $xmlrpc_methods = array(
);
// getting request values
if ( isset( $_REQUEST["format"] ) ) {
$format = $_REQUEST["format"];
} else {
$format = "";
}
if ( isset( $_REQUEST["mod"] ) ) {
$mod = $_REQUEST["mod"];
} else {
......@@ -636,7 +641,7 @@ if ( ( isset( $xmlrpc ) && ( $xmlrpc->geterrorsnum() == 0 ) ) || ( $mod == "logi
// retrieving server info
if ( !$xmlrpc->setmrequest( $xmlrpc_methods["si"] ) || !$xmlrpc->call() || !$xmlrpc->parse() ) {
$_SESSION["rtwi_err"] = $xmlrpc->getlasterror();
$_SESSION["rtwi_err"] = $xmlrpc->geterrors();
break;
}
$si_responses = $xmlrpc->mfetch( $xmlrpc_methods["si"] );
......@@ -644,7 +649,7 @@ if ( ( isset( $xmlrpc ) && ( $xmlrpc->geterrorsnum() == 0 ) ) || ( $mod == "logi
// getting up/down rates for totals
$methodlist = array( "d.get_down_rate=", "d.get_up_rate=" );
if ( !$xmlrpc->setrequest( "d.multicall", array_merge( array( $_SESSION["rtwi_view"] ), $methodlist ) ) || !$xmlrpc->call() || !$xmlrpc->parse() ) {
$_SESSION["rtwi_err"] = $xmlrpc->getlasterror();
$_SESSION["rtwi_err"] = $xmlrpc->geterrors();
break;
}
$response = $xmlrpc->fetch();
......@@ -692,7 +697,7 @@ if ( ( isset( $xmlrpc ) && ( $xmlrpc->geterrorsnum() == 0 ) ) || ( $mod == "logi
case "addtorrent" : { // add a new torrent
// getting download directory
if ( !$xmlrpc->setmrequest( array( "get_directory", "system.get_cwd" ) ) || !$xmlrpc->call() || !$xmlrpc->parse() ) {
$_SESSION["rtwi_err"] = $xmlrpc->getlasterror();
$_SESSION["rtwi_err"] = $xmlrpc->geterrors();
break;
}
$directories = $xmlrpc->fetch();
......@@ -756,14 +761,14 @@ if ( ( isset( $xmlrpc ) && ( $xmlrpc->geterrorsnum() == 0 ) ) || ( $mod == "logi
// retrieving server info
if ( !$xmlrpc->setmrequest( $xmlrpc_methods["si"] ) || !$xmlrpc->call() || !$xmlrpc->parse() ) {
$_SESSION["rtwi_err"] = $xmlrpc->getlasterror();
$_SESSION["rtwi_err"] = $xmlrpc->geterrors();
break;
}
$si_responses = $xmlrpc->mfetch( $xmlrpc_methods["si"] );
// retrieving download info
if ( !$xmlrpc->setrequest( "d.multicall", array_merge( array( $_SESSION["rtwi_view"] ), $xmlrpc_methods["d"] ) ) || !$xmlrpc->call() || !$xmlrpc->parse() ) {
$_SESSION["rtwi_err"] = $xmlrpc->getlasterror();
$_SESSION["rtwi_err"] = $xmlrpc->geterrors();
break;
}
$response = $xmlrpc->fetch();
......@@ -800,7 +805,7 @@ if ( ( isset( $xmlrpc ) && ( $xmlrpc->geterrorsnum() == 0 ) ) || ( $mod == "logi
// retrieve peer list info
if ( !$xmlrpc->setrequest( "p.multicall", array_merge( array( $torrent["d_hash"], 0 ), $xmlrpc_methods["p"] ) ) || !$xmlrpc->call() || !$xmlrpc->parse() ) {
$_SESSION["rtwi_err"] = $xmlrpc->getlasterror();
$_SESSION["rtwi_err"] = $xmlrpc->geterrors();
break;
}
$response = $xmlrpc->fetch();
......@@ -844,10 +849,11 @@ if ( ( isset( $xmlrpc ) && ( $xmlrpc->geterrorsnum() == 0 ) ) || ( $mod == "logi
// retreive file list info
if ( !$xmlrpc->setrequest( "f.multicall", array_merge( array( $torrent["d_hash"], 0 ), $xmlrpc_methods["f"] ) ) || !$xmlrpc->call() || !$xmlrpc->parse() ) {
$_SESSION["rtwi_err"] = $xmlrpc->getlasterror();
$_SESSION["rtwi_err"] = $xmlrpc->geterrors();
break;
}
$response = $xmlrpc->fetch();
// process the file info
for ( $i = 0; $i < count( $response ); $i++ ) {
for ( $r = 0; $r < count( $xmlrpc_methods["f"] ); $r++ ) {
......@@ -889,7 +895,7 @@ if ( ( isset( $xmlrpc ) && ( $xmlrpc->geterrorsnum() == 0 ) ) || ( $mod == "logi
// retrieving tracker list info
if ( !$xmlrpc->setrequest( "t.multicall", array_merge( array( $torrent["d_hash"], 0 ), $xmlrpc_methods["t"] ) ) || !$xmlrpc->call() || !$xmlrpc->parse() ) {
$_SESSION["rtwi_err"] = $xmlrpc->getlasterror();
$_SESSION["rtwi_err"] = $xmlrpc->geterrors();
break;
}
$response = $xmlrpc->fetch();
......@@ -971,14 +977,14 @@ if ( ( isset( $xmlrpc ) && ( $xmlrpc->geterrorsnum() == 0 ) ) || ( $mod == "logi
} else {
// retrieving server info
if ( !$xmlrpc->setmrequest( $xmlrpc_methods["si"] ) || !$xmlrpc->call() || !$xmlrpc->parse() ) {
$_SESSION["rtwi_err"] = $xmlrpc->getlasterror();
$_SESSION["rtwi_err"] = $xmlrpc->geterrors();
break;
}
$si_responses = $xmlrpc->mfetch( $xmlrpc_methods["si"] );
// retrieving download info
if ( !$xmlrpc->setrequest( "download_list", array( $_SESSION["rtwi_view"] ) ) || !$xmlrpc->call() || !$xmlrpc->parse() ) {
$_SESSION["rtwi_err"] = $xmlrpc->getlasterror();
$_SESSION["rtwi_err"] = $xmlrpc->geterrors();
break;
}
$torrents = $xmlrpc->fetch();
......@@ -987,7 +993,7 @@ if ( ( isset( $xmlrpc ) && ( $xmlrpc->geterrorsnum() == 0 ) ) || ( $mod == "logi
if ( in_array( $hash, $torrents ) ) {
// getting the filename
if ( !$xmlrpc->setmrequest( $xmlrpc_methods["g"], array( $hash, $id ) ) || !$xmlrpc->call() || !$xmlrpc->parse() ) {
$_SESSION["rtwi_err"] = $xmlrpc->getlasterror();
$_SESSION["rtwi_err"] = $xmlrpc->geterrors();
break;
}
$response = $xmlrpc->mfetch( $xmlrpc_methods["g"] );
......@@ -1005,7 +1011,7 @@ if ( ( isset( $xmlrpc ) && ( $xmlrpc->geterrorsnum() == 0 ) ) || ( $mod == "logi
default : { // torrents
// retrieving server info
if ( !$xmlrpc->setmrequest( $xmlrpc_methods["si"] ) || !$xmlrpc->call() || !$xmlrpc->parse() ) {
$_SESSION["rtwi_err"] = $xmlrpc->getlasterror();
$_SESSION["rtwi_err"] = $xmlrpc->geterrors();
break;
}
$si_responses = $xmlrpc->mfetch( $xmlrpc_methods["si"] );
......@@ -1024,7 +1030,7 @@ if ( ( isset( $xmlrpc ) && ( $xmlrpc->geterrorsnum() == 0 ) ) || ( $mod == "logi
}
// retrieving download info
if ( !$xmlrpc->setrequest( "d.multicall", array_merge( array( $_SESSION["rtwi_view"] ), $xmlrpc_methods["d"] ) ) || !$xmlrpc->call() || !$xmlrpc->parse() ) {
$_SESSION["rtwi_err"] = $xmlrpc->getlasterror();
$_SESSION["rtwi_err"] = $xmlrpc->geterrors();
break;
}
$response = $xmlrpc->fetch();
......@@ -1075,7 +1081,7 @@ if ( ( isset( $xmlrpc ) && ( $xmlrpc->geterrorsnum() == 0 ) ) || ( $mod == "logi
}
}
} elseif ( isset( $xmlrpc ) ) {
$_SESSION["rtwi_err"] = $xmlrpc->getlasterror();
$_SESSION["rtwi_err"] = $xmlrpc->geterrors();
if ( $ajax === true ) {
$layout_file = "layout.ajax.index.xsl";
......@@ -1121,20 +1127,25 @@ if ( $ajax === false && $mod != "getfile" ) {
// displaying the page
if ( $mod != "getfile" ) {
require_once( "includes/classes/xsl_handler.inc.php" );
$page = new page_handler( $config["site_theme"], $layout_file, $xml );
$page->parse();
$text = $page->fetch();
$len = strlen( $text );
// @header( "content-length: {$len}" );
@header( "content-type: text/html; charset=utf-8" );
@header( "content-language: hu" );
@header( "cache-control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0" );
@header( "pragma: no-cache" );
@header( "expires: thu, 1 jan 1970 00:00:00 gmt" );
@header( "imagetoolbar: no" );
print $text;
if ( $format == "xml" ) {
print $xml->SaveXML();
} else {
require_once( "includes/classes/xsl_handler.inc.php" );
$page = new page_handler( $config["site_theme"], $layout_file, $xml );
$page->parse();
$text = $page->fetch();
$len = strlen( $text );
@header( "content-length: {$len}" );
@header( "content-type: text/html; charset=utf-8" );
@header( "content-language: hu" );
@header( "cache-control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0" );
@header( "pragma: no-cache" );
@header( "expires: thu, 1 jan 1970 00:00:00 gmt" );
@header( "imagetoolbar: no" );
print $text;
}
} else { // sending file to download
// getting the filename
$path = "{$d_directory_value}/{$response["f_path"]}";
......
......@@ -158,7 +158,7 @@ switch ( $_REQUEST["mod"] ) {
if ( isset( $_REQUEST["refreshrate"] ) && $_REQUEST["refreshrate"] != "" ) {
$refreshrate = $_REQUEST["refreshrate"];
settype( $refreshrate, "int" );
if ( $refreshrate < 60 ) {
if ( $refreshrate < 0 ) {
$refreshrate = 0;
}
......@@ -292,7 +292,7 @@ switch ( $_REQUEST["mod"] ) {
case 0 : {
if ( is_uploaded_file( $_FILES["torrentfile"]["tmp_name"] ) ) {
$torrent = file_get_contents( $_FILES["torrentfile"]["tmp_name"] );
$xmlrpc->set_type( &$torrent, "base64" );
$xmlrpc->set_type( $torrent, "base64" );
} else {
$_SESSION["rtwi_err"] = "rtfileattack";
header( "location: {$config["index"]}?mod=addtorrent" );
......@@ -360,14 +360,14 @@ switch ( $_REQUEST["mod"] ) {
if ( $dlpath != "" ) {
$param[] = "d.set_directory={$dlpath}";
}
if ( isset( $_REQUEST["torrentstart"] ) && $_REQUEST["torrentstart"] == "start" ) {
$param[] = "d.start=";
}
if ( $_REQUEST["tfmethod"] == "url" || isset( $_REQUEST["keeptorrentfile"] ) && $_REQUEST["keeptorrentfile"] == "on" ) {
$method = "load_verbose";
$method = "load";
} else {
$method = "load_raw_verbose";
$method = "load_raw";
}
if ( isset( $_REQUEST["torrentstart"] ) && $_REQUEST["torrentstart"] == "start" ) {
$method = "{$method}_start";
}
if ( !$xmlrpc->setrequest( $method, $param ) || !$xmlrpc->call() ) {
$_SESSION["rtwi_err"] = $xmlrpc->geterrors();
......
......@@ -25,7 +25,7 @@
<meta name="description" content="{/root/labels/description}" />
<meta name="doc-type" content="web page" />
<meta name="rating" content="general" />
<meta name="robots" content="all" />
<meta name="robots" content="noindex, nofollow" />
<link rel="stylesheet" type="text/css" href="themes/default_ajax/inc/style.css" />
<script type="text/javascript" src="themes/default_ajax/inc/afunc.js"></script>
<script type="text/javascript" src="themes/default_ajax/inc/hfunc.js"></script>
......
......@@ -25,7 +25,7 @@
<meta name="description" content="{labels/description}" />
<meta name="doc-type" content="web page" />
<meta name="rating" content="general" />
<meta name="robots" content="all" />
<meta name="robots" content="noindex, nofollow" />
<link rel="stylesheet" type="text/css" href="themes/default_ajax/inc/style.css" />
<script type="text/javascript" src="themes/default_ajax/inc/afunc.js"></script>
<script type="text/javascript" src="themes/default_ajax/inc/hfunc.js"></script>
......
......@@ -20,7 +20,7 @@
<meta name="description" content="{labels/description}" />
<meta name="doc-type" content="web page" />
<meta name="rating" content="general" />
<meta name="robots" content="all" />
<meta name="robots" content="noindex, nofollow" />
<link rel="stylesheet" type="text/css" href="themes/default_ajax/inc/style.css" />
<title><xsl:value-of select="labels/title" /></title>
</head>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment