Commit ac81d6ab authored by Gabor Hudiczius's avatar Gabor Hudiczius
Browse files

rtwi-0.3.3-090725

parent a771e839
favicon.ico

1.37 KB

......@@ -130,7 +130,7 @@ class xmlrpc_handler {
}
private function decode( $str ) {
$str = preg_replace( "%<(/{0,1})(i8|ex\.i8)>%", "<\\1string>", $str );
$str = preg_replace( "%<(/{0,1})(i8|ex.i8)>%", "<\\1string>", $str );
$str = preg_replace( "/>\s*?</s", "><", $str );
$xml = new DOMDocument( "1.0", "utf-8" );
$xml->formatOutput = true;
......@@ -230,7 +230,7 @@ class xmlrpc_handler {
break;
}
default : {
print "Bibi: ".gettype( $param );
print "Error: ".gettype( $param );
exit;
break;
}
......@@ -320,7 +320,7 @@ class xmlrpc_handler {
do {
$line = fgets( $fp );
} while ( trim( $line ) != "" );
if ( ( $this->response = stream_get_contents( $fp ) ) !== false ) {
$tt = getmicrotime();
$this->calls++;
......
......@@ -85,6 +85,7 @@ $message = array(
"d_connection_current_leech" => "Leeching",
"d_connection_current_seed" => "做種中",
"d_connection_current_initial_seed" => "Initial seeding",
"d_ignore_commands_0" => "Not ignoring commands",
"d_ignore_commands_1" => "Ignoring commands",
"d_active_0" => "已停止",
......@@ -206,7 +207,8 @@ $label = array(
"selectlanguage" => "選擇語言",
"areyousure" => "你確定嗎?",
"areyousureerase" => "Are you sure? All downloaded data will be erased.",
"areyousureerase" => "Are you sure, you want to delete",
"alldatawillbedestroyed" => "All data will be destroyed.",
"homepage" => "rTWi project homepage",
......
......@@ -85,6 +85,7 @@ $message = array(
"d_connection_current_leech" => "Leeche",
"d_connection_current_seed" => "Seede",
"d_connection_current_initial_seed" => "Initial seeding",
"d_ignore_commands_0" => "Ignoriere Befehle nicht",
"d_ignore_commands_1" => "Ignoriere Befhele",
"d_active_0" => "Gestoppt",
......@@ -206,7 +207,8 @@ $label = array(
"selectlanguage" => "Sprache wählen",
"areyousure" => "Bist du dir sicher?",
"areyousureerase" => "Bist du dir sicher? Alle heruntegeladenen Daten werden gelöscht.",
"areyousureerase" => "Bist du dir sicher?",
"alldatawillbedestroyed" => "Alle heruntegeladenen Daten werden gelöscht.",
"homepage" => "rTWi Projekt Homepage",
......@@ -386,4 +388,4 @@ $label = array(
"lasttimescraped" => "Letzter Scrape",
);
?>
\ No newline at end of file
?>
......@@ -85,6 +85,7 @@ $message = array(
"d_connection_current_leech" => "Leeching",
"d_connection_current_seed" => "Seeding",
"d_connection_current_initial_seed" => "Initial seeding",
"d_ignore_commands_0" => "Not ignoring commands",
"d_ignore_commands_1" => "Ignoring commands",
"d_active_0" => "Stopped",
......@@ -206,7 +207,8 @@ $label = array(
"selectlanguage" => "Select language",
"areyousure" => "Are you sure?",
"areyousureerase" => "Are you sure? All downloaded data will be erased.",
"areyousureerase" => "Are you sure, you want to delete",
"alldatawillbedestroyed" => "All data will be destroyed.",
"homepage" => "rTWi project homepage",
......@@ -386,4 +388,4 @@ $label = array(
"lasttimescraped" => "Last time scraped",
);
?>
\ No newline at end of file
?>
......@@ -85,6 +85,7 @@ $message = array(
"d_connection_current_leech" => "Letöltés",
"d_connection_current_seed" => "Feltöltés",
"d_connection_current_initial_seed" => "Kezdő feltöltés",
"d_ignore_commands_0" => "Parancsok figyelembevétele",
"d_ignore_commands_1" => "Parancsok figyelmen kívü hagyása",
"d_active_0" => "Leállítva",
......@@ -206,7 +207,8 @@ $label = array(
"selectlanguage" => "Válassz nyelvet",
"areyousure" => "Biztosan törlöd?",
"areyousureerase" => "Biztosan törlöd? Minden letöltött adat törlésre kerül.",
"areyousureerase" => "Biztosan törlöd?",
"alldatawillbedestroyed" => "Minden adat törlésre fog kerülni.",
"homepage" => "rTWi honlap",
......@@ -386,4 +388,4 @@ $label = array(
"lasttimescraped" => "Utoljára lekérdezve",
);
?>
\ No newline at end of file
?>
; full url of the rTWi (with a trailing slash)
base = http://example.com/
; change, if you've renamed the index.html file
index = index.php
; change, if you've renamed the input.php file
input = input.php
; path to home directory of users (with heading and trailing slash)
home_path = /home/
; path to the file which keeps the user related informations
user_conf = /etc/rtorrent/users.conf
; language (english and hungarian is available)
lang = en
; site theme (look for themes in the "themes" directory)
site_theme = default_ajax
; do a directory tree, which can be expanded/collapsed
; set to "false" (without the quotes),
; if your webserver is running on a slow machine
; and you have torrents with a lots of files
; (a few hundreds of files in a single torrent, and more)
dodirtree = true
; true if ajax is allowed
ajax = true
; true if dht is enabled
dht = true
; true if users are allowed to download finished files from the webui
download = true
; true if users are allowed to erase downloaded data from the webui
erase = true
; true if flags are allowed in peers page
flags = false
; true if hiding the filelist is allowed
hidedirtree = true
; true if users are allowed to set the language of the web interface
language = true
; true if users are allowed to set a meta-refresh interval
refresh = true
; true if users are allowed to set throttle
throttle = true
......@@ -130,7 +130,7 @@ function prepare_serverinfo_responses( &$responses, &$message, &$config ) {
$dht_statistics_bytes_written_arr = switch_bytes( $responses["dht_statistics_bytes_written"] );
$responses["dht_statistics_bytes_read_value"] = sprintf( "%.1f", $dht_statistics_bytes_read_arr[0] );
$responses["dht_statistics_bytes_read_suffix"] = $bytes_up_arr[1];
$responses["dht_statistics_bytes_read_suffix"] = $dht_statistics_bytes_read_arr[1];
$responses["dht_statistics_bytes_written_value"] = sprintf( "%.1f", $dht_statistics_bytes_written_arr[0] );
$responses["dht_statistics_bytes_written_suffix"] = $dht_statistics_bytes_written_arr[1];
}
......@@ -187,7 +187,6 @@ function prepare_downloadlist_responses( &$responses, &$message, &$home_path, &$
$responses["d_active_value"] = $responses["d_active"] == 1 ? $message["d_active_1"] : $message["d_active_0"];
$responses["d_complete_value"] = $responses["d_complete"] == 1 ? $message["d_complete_1"] : $message["d_complete_0"];
$responses["d_connection_current_value"] = $responses["d_connection_current"] == "seed" ? $message["d_connection_current_seed"] : $message["d_connection_current_leech"];
$responses["d_creation_date_value"] = date( "Y-m-d H:i:s", $responses["d_creation_date"] );
$responses["d_ignore_commands_value"] = $responses["d_ignore_commands"] == 1 ? $message["d_ignore_commands_1"] : $message["d_ignore_commands_0"];
$responses["d_hash_checked_value"] = $responses["d_hash_checked"] == 1 ? $message["d_hash_checked_1"] : $message["d_hash_checked_0"];
......@@ -204,9 +203,9 @@ function prepare_downloadlist_responses( &$responses, &$message, &$home_path, &$
$responses["d_tracker_numwant_value"] = $responses["d_tracker_numwant"] == -1 ? $message["disabled"] : $responses["d_tracker_numwant"];
$responses["d_uploads_max_value"] = $responses["d_uploads_max"] == -1 ? $message["disabled"] : $responses["d_uploads_max"];
$responses["d_base_path_value"] = myrealpath( $responses["d_base_path"], $config["home_path"], $cwd );
$responses["d_directory_value"] = myrealpath( $responses["d_directory"], $config["home_path"], $cwd );
$responses["d_tied_to_file_value"] = myrealpath( $responses["d_tied_to_file"], $config["home_path"], $cwd );
$responses["d_base_path_value"] = myrealpath( $responses["d_base_path"], $home_path, $cwd );
$responses["d_directory_value"] = myrealpath( $responses["d_directory"], $home_path, $cwd );
$responses["d_tied_to_file_value"] = myrealpath( $responses["d_tied_to_file"], $home_path, $cwd );
if ( $responses["d_down_rate"] > 0 ) {
$responses["d_estimated_time"] = $responses["d_left_bytes"] / $responses["d_down_rate"];
......@@ -232,6 +231,11 @@ function prepare_downloadlist_responses( &$responses, &$message, &$home_path, &$
$responses["d_percentage_value"] = 100;
}
switch ( $responses["d_connection_current"] ) {
case "seed" : $responses["d_connection_current_value"] = $message["d_connection_current_seed"]; break;
case "initial_seed" : $responses["d_connection_current_value"] = $message["d_connection_current_initial_seed"]; break;
default : $responses["d_connection_current_value"] = $message["d_connection_current_leech"]; break;
}
switch ( $responses["d_hashing"] ) {
case 1 : $responses["d_hashing_value"] = $message["d_hashing_1"]; break;
case 2 : $responses["d_hashing_value"] = $message["d_hashing_2"]; break;
......@@ -264,7 +268,7 @@ function prepare_filelist_responses( &$responses, &$message, &$home_path, &$cwd
$responses["f_open_value"] = $responses["f_open"] == 1 ? $message["f_open_1"] : $message["f_open_0"];
$responses["f_last_touched_value"] = date( "Y-m-d H:i:s", substr( $responses["f_last_touched"], 0, -6 ) );
$responses["f_frozen_path_value"] = myrealpath( $responses["f_frozen_path"], $config["home_path"], $cwd );
$responses["f_frozen_path_value"] = myrealpath( $responses["f_frozen_path"], $home_path, $cwd );
if ( $responses["f_size_chunks"] == 0 ) {
$responses["f_percentage"] = 1;
......@@ -775,7 +779,7 @@ switch ( $mod ) {
// when we have a match
if ( is_array( $torrent ) ) {
// prepare download variables
prepare_downloadlist_responses( $torrent, $message, $home_path, $si_responses["get_cwd"] );
prepare_downloadlist_responses( $torrent, $message, $config["home_path"], $si_responses["get_cwd"] );
// decide what to do
switch ( $page ) {
case "peers" : { // peer list page
......@@ -822,7 +826,7 @@ switch ( $mod ) {
// create downloads root direcrory node
$node = $node->appendChild( $xml->createElement( "files_root" ) );
$node = $node->appendChild( $xml->createElement( "directory" ) );
$node->setAttribute( "dirname", $torrent["d_directory_value"] );
$node->setAttribute( "dirname", $torrent["d_base_filename"] );
$fst = getmicrotime();
......@@ -1095,7 +1099,7 @@ if ( $mod != "getfile" ) {
@header( "Content-Description: File Transfer" );
@header( "Content-Type: application/force-download" );
@header( "Content-Length: {$filesize}" );
@header( "Content-Disposition: attachment; filename={$response["f_path"]}" );
@header( "Content-Disposition: attachment; filename=\"{$response["f_path"]}\"" );
// sending the file
readfile( $path );
......
......@@ -447,7 +447,7 @@ switch ( $_REQUEST["mod"] ) {
exit;
}
$xmlrpc->setrequest( "d.close", $hash );
$xmlrpc->setmrequest( array( "d.stop", "d.close" ), array( $hash ) );
$xmlrpc->call();
sleep( 1 );
......@@ -510,6 +510,7 @@ switch ( $_REQUEST["mod"] ) {
header( "location: {$config["index"]}" );
exit;
}
$xmlrpc->setrequest( "download_list", "" );
$xmlrpc->call();
$xmlrpc->parse();
......@@ -521,83 +522,21 @@ switch ( $_REQUEST["mod"] ) {
exit;
}
$xmlrpc->setrequest( "d.multicall", array( "", "d.get_hash=", "d.get_directory=", "d.get_size_files=" ) );
$xmlrpc->setrequest( "d.get_base_path", $hash );
$xmlrpc->call();
$xmlrpc->parse();
$response = $xmlrpc->fetch();
foreach ( $response as $key => $val ) {
if ( $val[0] == $hash ) {
$response = $val;
}
}
$directory = $response[1];
$size_files = $response[2];
$xmlrpc->setmrequest( array( "get_directory", "system.get_cwd" ) );
$xmlrpc->call();
$xmlrpc->parse();
$directories = $xmlrpc->fetch();
$dd = $directories[0][0];
$cwd = $directories[1][0];
$directory = myrealpath( $directory, $config["home_path"], $cwd );
$dd = myrealpath( $dd, $config["home_path"], $cwd );
$xmlrpc->setrequest( "f.multicall", array( $hash, 0, "f.get_frozen_path=" ) );
$xmlrpc->setrequest( "execute", array( "rm", "-rf", "--", $response ) );
$xmlrpc->call();
$xmlrpc->parse();
$files = $xmlrpc->fetch();
$unlink_num = 0;
$dirs = array();
foreach ( $files as $key => $val ) {
$dirs[] = dirname( $val[0] );
if ( is_writable( $val[0] ) ) {
if ( @unlink( $val[0] ) ) {
$unlink_num++;
}
}
}
$dirs = array_unique( $dirs );
foreach ( $dirs as $key => $val ) {
$pattern = "'({$directory}.*?)(/[^/]*)$'";
if ( preg_match( $pattern, $val, $match ) ) {
$dirs[] = $match[1];
}
}
$dirs = array_unique( $dirs );
if ( in_array( $dd, $dirs ) ) {
$key = array_search( $dd, $dirs );
unset( $dirs[$key] );
}
rsort( $dirs );
//print_r( $dirs );
$size_dirs = $size_files == 1 ? 0 : count( $dirs );
$rmdir_num = 0;
foreach ( $dirs as $key => $val ) {
if ( is_writable( $val ) ) {
if ( @rmdir( $val ) ) {
$rmdir_num++;
}
}
}
$xmlrpc->setrequest( "d.erase", $hash );
$xmlrpc->call();
sleep( 1 );
if ( $unlink_num != $size_files || $rmdir_num != $size_dirs ) {
$_SESSION["rtwi_err"] = "warntorrenterase";
header( "location: {$config["index"]}" );
exit;
} else {
$_SESSION["rtwi_err"] = "succtorrenterase";
header( "location: {$config["index"]}" );
exit;
}
$_SESSION["rtwi_err"] = "succtorrenterase";
header( "location: {$config["index"]}" );
exit;
break;
}
......@@ -640,7 +579,7 @@ switch ( $_REQUEST["mod"] ) {
break;
}
case "close" : {
$xmlrpc->setrequest( "d.multicall", array( $_SESSION["rtwi_view"], "d.close=" ) );
$xmlrpc->setrequest( "d.multicall", array( $_SESSION["rtwi_view"], "d.stop=", "d.close=" ) );
$xmlrpc->call();
sleep( 1 );
......
......@@ -118,7 +118,6 @@ select.whiteselect {
}
#mainmenu a:hover {
display: block;
color: #000000;
background: #e0e0e0;
}
......
......@@ -402,7 +402,7 @@
<a href="{/root/iurl}?mod=torrentremove&amp;hash={d_hash}" title="{/root/labels/remove}" onclick="var answer = confirm( '{/root/labels/areyousure}' ); if ( !answer ) return false;"><xsl:value-of select="/root/labels/remove" /></a>
<xsl:choose>
<xsl:when test="/root/allow_erase = 'true'">
<a href="{/root/iurl}?mod=torrenterase&amp;hash={d_hash}" title="{/root/labels/erase}" onclick="var answer = confirm( '{/root/labels/areyousureerase}' ); if ( !answer ) return false;"><xsl:value-of select="/root/labels/erase" /></a>
<a href="{/root/iurl}?mod=torrenterase&amp;hash={d_hash}" title="{/root/labels/erase}" onclick="var answer = confirm( '{/root/labels/areyousureerase}\n{d_base_path}\n{/root/labels/alldatawillbedestroyed}' ); if ( !answer ) return false;"><xsl:value-of select="/root/labels/erase" /></a>
</xsl:when>
</xsl:choose>
</div>
......
......@@ -41,17 +41,17 @@
<li>
<div class="lftitle"><xsl:value-of select="labels/password" />:</div>
<div class="lffield">
<input id="lfpass" type="password" title="labels/password" name="loginpass" />
<input id="lfpass" type="password" title="{labels/password}" name="loginpass" />
</div>
</li>
<li>
<div class="lftitle"><xsl:value-of select="labels/rememberme" />:</div>
<div class="lffield">
<input id="lfremember" type="checkbox" title="labels/rememberme" name="rememberme" />
<input id="lfremember" type="checkbox" title="{labels/rememberme}" name="rememberme" />
</div>
</li>
<li class="formsend">
<input class="inputok" type="submit" title="{labels/login}" name="{labels/login}" value="{labels/login}" />
<input class="inputok" type="submit" title="{labels/login}" name="loginok" value="{labels/login}" />
</li>
</ul>
</form>
......
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