mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-20 09:30:49 +08:00
fix tracker url and takeinvite.php
This commit is contained in:
+1
-1
@@ -15,7 +15,7 @@ if (!file_exists($rootpath . '.env')) {
|
||||
$installScriptRelativePath = 'install/install.php';
|
||||
$installScriptFile = $rootpath . "public/$installScriptRelativePath";
|
||||
if (file_exists($installScriptFile)) {
|
||||
header('Location: ' . getBaseUrl() . $installScriptRelativePath);
|
||||
header('Location: ' . getBaseUrl() . '/' . $installScriptRelativePath);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2715,6 +2715,9 @@ function set_langfolder_cookie($folder, $expires = 0x7fffffff)
|
||||
function get_protocol_prefix()
|
||||
{
|
||||
global $securelogin;
|
||||
if (isHttps()) {
|
||||
return "https://";
|
||||
}
|
||||
if ($securelogin == "yes") {
|
||||
return "https://";
|
||||
} elseif ($securelogin == "no") {
|
||||
|
||||
@@ -387,10 +387,16 @@ function arr_set(&$array, $key, $value)
|
||||
return $array;
|
||||
}
|
||||
|
||||
function isHttps()
|
||||
{
|
||||
$result = !empty($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) !== 'off');
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
function getSchemeAndHttpHost()
|
||||
{
|
||||
$isHttps = !empty($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) !== 'off');
|
||||
$isHttps = isHttps();
|
||||
$protocol = $isHttps ? 'https' : 'http';
|
||||
$port = $_SERVER['SERVER_PORT'];
|
||||
$result = "$protocol://" . $_SERVER['HTTP_HOST'];
|
||||
@@ -411,5 +417,5 @@ function getBaseUrl()
|
||||
} else {
|
||||
$url .= $requestUri;
|
||||
}
|
||||
return $url;
|
||||
return trim($url, '/');
|
||||
}
|
||||
|
||||
+2
-1
@@ -89,7 +89,8 @@ if (strlen($CURUSER['passkey']) != 32) {
|
||||
}
|
||||
|
||||
$dict = bdec_file($fn, $max_torrent_size);
|
||||
$dict['value']['announce']['value'] = $ssl_torrent . $base_announce_url . "?passkey=$CURUSER[passkey]";
|
||||
//$dict['value']['announce']['value'] = $ssl_torrent . $base_announce_url . "?passkey=$CURUSER[passkey]";
|
||||
$dict['value']['announce']['value'] = getSchemeAndHttpHost() . "/announce.php?passkey=$CURUSER[passkey]";
|
||||
$dict['value']['announce']['string'] = strlen($dict['value']['announce']['value']).":".$dict['value']['announce']['value'];
|
||||
$dict['value']['announce']['strlen'] = strlen($dict['value']['announce']['string']);
|
||||
/*if ($announce_urls[1] != "") // add multi-tracker
|
||||
|
||||
@@ -14,7 +14,7 @@ function bark($msg) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$id = $CURUSER[id];
|
||||
$id = $CURUSER['id'];
|
||||
$email = unesc(htmlspecialchars(trim($_POST["email"])));
|
||||
$email = safe_email($email);
|
||||
if (!$email)
|
||||
@@ -48,13 +48,13 @@ $hash = md5(mt_rand(1,10000).$CURUSER['username'].TIMENOW.$CURUSER['passhash'])
|
||||
$title = $SITENAME.$lang_takeinvite['mail_tilte'];
|
||||
|
||||
sql_query("INSERT INTO invites (inviter, invitee, hash, time_invited) VALUES ('".mysql_real_escape_string($id)."', '".mysql_real_escape_string($email)."', '".mysql_real_escape_string($hash)."', " . sqlesc(date("Y-m-d H:i:s")) . ")");
|
||||
sql_query("UPDATE users SET invites = invites - 1 WHERE id = ".mysql_real_escape_string($id)."") or sqlerr(__FILE__, __LINE__);
|
||||
|
||||
sql_query("UPDATE users SET invites = invites - 1 WHERE id = ".mysql_real_escape_string($id)) or sqlerr(__FILE__, __LINE__);
|
||||
$signupUrl = getBaseUrl() . "/signup.php?type=invite&invitenumber=$hash";
|
||||
$message = <<<EOD
|
||||
{$lang_takeinvite['mail_one']}{$arr[username]}{$lang_takeinvite['mail_two']}
|
||||
<b><a href="javascript:void(null)" onclick="window.open('http://$BASEURL/signup.php?type=invite&invitenumber=$hash')">{$lang_takeinvite['mail_here']}</a></b><br />
|
||||
http://$BASEURL/signup.php?type=invite&invitenumber=$hash
|
||||
<br />{$lang_takeinvite['mail_three']}$invite_timeout{$lang_takeinvite['mail_four']}{$arr[username]}{$lang_takeinvite['mail_five']}<br />
|
||||
{$lang_takeinvite['mail_one']}{$arr['username']}{$lang_takeinvite['mail_two']}
|
||||
<b><a href="javascript:void(null)" onclick="window.open($signupUrl)">{$lang_takeinvite['mail_here']}</a></b><br />
|
||||
$signupUrl
|
||||
<br />{$lang_takeinvite['mail_three']}$invite_timeout{$lang_takeinvite['mail_four']}{$arr['username']}{$lang_takeinvite['mail_five']}<br />
|
||||
$body
|
||||
<br /><br />{$lang_takeinvite['mail_six']}
|
||||
EOD;
|
||||
|
||||
Reference in New Issue
Block a user