mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-29 00:07:23 +08:00
fix announce for directory change
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
require_once('../include/bittorrent_announce.php');
|
||||
require_once('include/benc.php');
|
||||
require_once('../include/benc.php');
|
||||
dbconn_announce();
|
||||
//1. BLOCK ACCESS WITH WEB BROWSERS AND CHEATS!
|
||||
$agent = $_SERVER["HTTP_USER_AGENT"];
|
||||
|
||||
@@ -67,6 +67,7 @@ if ($Attach->enable_attachment())
|
||||
$filemd5 = md5_file($file['tmp_name']);
|
||||
$filename = date("YmdHis").$filemd5;
|
||||
$file_location = make_folder($savedirectory_attachment."/", $savepath) . $filename;
|
||||
do_log("file_location: $file_location");
|
||||
$db_file_location = $savepath.$filename;
|
||||
$abandonorig = false;
|
||||
$hasthumb = false;
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ else{
|
||||
|
||||
$res = sql_query("SELECT name, filename, save_as, size, owner,banned FROM torrents WHERE id = ".sqlesc($id)) or sqlerr(__FILE__, __LINE__);
|
||||
$row = mysql_fetch_assoc($res);
|
||||
$fn = "$torrent_dir/$id.torrent";
|
||||
$fn = ROOT_PATH . "$torrent_dir/$id.torrent";
|
||||
if ($CURUSER['downloadpos']=="no")
|
||||
permissiondenied();
|
||||
if (!$row || !is_file($fn) || !is_readable($fn))
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ print("<div align=\"right\">".$lang_login['text_select_lang']. $s . "</div>");
|
||||
unset($returnto);
|
||||
if (!empty($_GET["returnto"])) {
|
||||
$returnto = $_GET["returnto"];
|
||||
if (!$_GET["nowarn"]) {
|
||||
if (empty($_GET["nowarn"])) {
|
||||
print("<h1>" . $lang_login['h1_not_logged_in']. "</h1>\n");
|
||||
print("<p><b>" . $lang_login['p_error']. "</b> " . $lang_login['p_after_logged_in']. "</p>\n");
|
||||
}
|
||||
|
||||
+2
-6
@@ -8,10 +8,6 @@ parked();
|
||||
if (get_user_class() < UC_SYSOP)
|
||||
permissiondenied();
|
||||
|
||||
//read all configuration files
|
||||
require('config/allconfig.php');
|
||||
|
||||
|
||||
function go_back()
|
||||
{
|
||||
global $lang_settings;
|
||||
@@ -372,9 +368,9 @@ elseif ($action == 'authoritysettings') //Authority settings
|
||||
tr($lang_settings['row_add_offer'], $lang_settings['text_minimum_class'].classlist('addoffer',$maxclass,$AUTHORITY['addoffer']).$lang_settings['text_default'].get_user_class_name(UC_PEASANT,false,true,true).$lang_settings['text_add_offer_note'], 1);
|
||||
tr($lang_settings['row_offer_management'], $lang_settings['text_minimum_class'].classlist('offermanage',$maxclass,$AUTHORITY['offermanage']).$lang_settings['text_default'].get_user_class_name(UC_MODERATOR,false,true,true).$lang_settings['text_offer_management_note'],1);
|
||||
tr($lang_settings['row_upload_torrent'], $lang_settings['text_minimum_class'].classlist('upload',$maxclass,$AUTHORITY['upload']).$lang_settings['text_default'].get_user_class_name(UC_POWER_USER,false,true,true).$lang_settings['text_upload_torrent_note'], 1);
|
||||
if (THISTRACKER == "HDStar")
|
||||
// if (THISTRACKER == "HDStar")
|
||||
tr($lang_settings['row_upload_special_torrent'], $lang_settings['text_minimum_class'].classlist('uploadspecial',$maxclass,$AUTHORITY['uploadspecial']).$lang_settings['text_default'].get_user_class_name(UC_UPLOADER,false,true,true).$lang_settings['text_upload_special_torrent_note'],1);
|
||||
if (THISTRACKER == "HDStar")
|
||||
// if (THISTRACKER == "HDStar")
|
||||
tr($lang_settings['row_move_torrent'], $lang_settings['text_minimum_class'].classlist('movetorrent',$maxclass,$AUTHORITY['movetorrent']).$lang_settings['text_default'].get_user_class_name(UC_MODERATOR,false,true,true).$lang_settings['text_move_torrent_note'],1);
|
||||
tr($lang_settings['row_chronicle_management'], $lang_settings['text_minimum_class'].classlist('chrmanage',$maxclass,$AUTHORITY['chrmanage']).$lang_settings['text_default'].get_user_class_name(UC_MODERATOR,false,true,true).$lang_settings['text_chronicle_management_note'],1);
|
||||
tr($lang_settings['row_view_invite'], $lang_settings['text_minimum_class'].classlist('viewinvite',$maxclass,$AUTHORITY['viewinvite']).$lang_settings['text_default'].get_user_class_name(UC_MODERATOR,false,true,true).$lang_settings['text_view_invite_note'],1);
|
||||
|
||||
+2
-1
@@ -117,8 +117,9 @@ else
|
||||
|
||||
while ($arr = mysql_fetch_assoc($res))
|
||||
{
|
||||
$del = '';
|
||||
if (get_user_class() >= $sbmanage_class) {
|
||||
$del="[<a href=\"shoutbox.php?del=".$arr['id']."\">".$lang_shoutbox['text_del']."</a>]";
|
||||
$del .= "[<a href=\"shoutbox.php?del=".$arr['id']."\">".$lang_shoutbox['text_del']."</a>]";
|
||||
}
|
||||
if ($arr["userid"]) {
|
||||
$username = get_username($arr["userid"],false,true,true,true,false,false,"",true);
|
||||
|
||||
@@ -30,7 +30,7 @@ if ($row["passhash"] != md5($row["secret"] . $password . $row["secret"]))
|
||||
if ($row["enabled"] == "no")
|
||||
bark($lang_takelogin['std_account_disabled']);
|
||||
|
||||
if ($_POST["securelogin"] == "yes")
|
||||
if (isset($_POST["securelogin"]) && $_POST["securelogin"] == "yes")
|
||||
{
|
||||
$securelogin_indentity_cookie = true;
|
||||
$passh = md5($row["passhash"].$_SERVER["REMOTE_ADDR"]);
|
||||
@@ -41,7 +41,7 @@ else
|
||||
$passh = md5($row["passhash"]);
|
||||
}
|
||||
|
||||
if ($securelogin=='yes' || $_POST["ssl"] == "yes")
|
||||
if ($securelogin=='yes' || (isset($_POST["ssl"]) && $_POST["ssl"] == "yes"))
|
||||
{
|
||||
$pprefix = "https://";
|
||||
$ssl = true;
|
||||
@@ -51,7 +51,7 @@ else
|
||||
$pprefix = "http://";
|
||||
$ssl = false;
|
||||
}
|
||||
if ($securetracker=='yes' || $_POST["trackerssl"] == "yes")
|
||||
if ($securetracker=='yes' || (isset($_POST["trackerssl"] ) && $_POST["trackerssl"] == "yes"))
|
||||
{
|
||||
$trackerssl = true;
|
||||
}
|
||||
@@ -59,7 +59,7 @@ else
|
||||
{
|
||||
$trackerssl = false;
|
||||
}
|
||||
if ($_POST["logout"] == "yes")
|
||||
if (isset($_POST["logout"]) && $_POST["logout"] == "yes")
|
||||
{
|
||||
logincookie($row["id"], $passh,1,900,$securelogin_indentity_cookie, $ssl, $trackerssl);
|
||||
//sessioncookie($row["id"], $passh,true);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
require_once("include/benc.php");
|
||||
require_once("../include/benc.php");
|
||||
require_once("../include/bittorrent.php");
|
||||
|
||||
ini_set("upload_max_filesize",$max_torrent_size);
|
||||
|
||||
@@ -34,6 +34,7 @@ function dltable($name, $arr, $torrent)
|
||||
"<td class=colhead align=center width=1%>".$lang_viewpeerlist['col_idle']."</td>" .
|
||||
"<td class=colhead align=center width=1%>".$lang_viewpeerlist['col_client']."</td></tr>\n";
|
||||
$now = time();
|
||||
$num = 0;
|
||||
foreach ($arr as $e) {
|
||||
$privacy = get_single_value("users", "privacy","WHERE id=".sqlesc($e['userid']));
|
||||
++$num;
|
||||
@@ -62,7 +63,7 @@ function dltable($name, $arr, $torrent)
|
||||
}
|
||||
else $location = "";
|
||||
|
||||
$s .= "<td class=rowfollow align=center width=1%><nobr>" . ($e[connectable] == "yes" ? $lang_viewpeerlist['text_yes'] : "<font color=red>".$lang_viewpeerlist['text_no']."</font>") . "</nobr></td>\n";
|
||||
$s .= "<td class=rowfollow align=center width=1%><nobr>" . ($e['connectable'] == "yes" ? $lang_viewpeerlist['text_yes'] : "<font color=red>".$lang_viewpeerlist['text_no']."</font>") . "</nobr></td>\n";
|
||||
$s .= "<td class=rowfollow align=center width=1%><nobr>" . mksize($e["uploaded"]) . "</nobr></td>\n";
|
||||
|
||||
$s .= "<td class=rowfollow align=center width=1%><nobr>" . mksize(($e["uploaded"] - $e["uploadoffset"]) / $secs) . "/s</nobr></td>\n";
|
||||
@@ -71,7 +72,7 @@ function dltable($name, $arr, $torrent)
|
||||
if ($e["seeder"] == "no")
|
||||
$s .= "<td class=rowfollow align=center width=1%><nobr>" . mksize(($e["downloaded"] - $e["downloadoffset"]) / $secs) . "/s</nobr></td>\n";
|
||||
else
|
||||
$s .= "<td class=rowfollow align=center width=1%><nobr>" . mksize(($e["downloaded"] - $e["downloadoffset"]) / max(1, $e["finishedat"] - $e[st])) . "/s</nobr></td>\n";
|
||||
$s .= "<td class=rowfollow align=center width=1%><nobr>" . mksize(($e["downloaded"] - $e["downloadoffset"]) / max(1, $e["finishedat"] - $e['st'])) . "/s</nobr></td>\n";
|
||||
if ($e["downloaded"])
|
||||
{
|
||||
$ratio = floor(($e["uploaded"] / $e["downloaded"]) * 1000) / 1000;
|
||||
|
||||
Reference in New Issue
Block a user