Username
diff --git a/sections/staffpm/staff_inbox.php b/sections/staffpm/staff_inbox.php
index f4ab1a85..68b1337a 100644
--- a/sections/staffpm/staff_inbox.php
+++ b/sections/staffpm/staff_inbox.php
@@ -89,7 +89,7 @@
[Open]
[Resolved]
if ($IsStaff) { ?>
- [Scoreboard]
+ [Scoreboard]
} ?>
diff --git a/sections/tools/index.php b/sections/tools/index.php
index b72fce46..9e02b573 100644
--- a/sections/tools/index.php
+++ b/sections/tools/index.php
@@ -169,10 +169,10 @@
include('managers/official_tags.php');
break;
- case 'tag_aliases':
- include('managers/tag_aliases.php');
- break;
- case 'permissions':
+ case 'tag_aliases':
+ include('managers/tag_aliases.php');
+ break;
+ case 'permissions':
if (!check_perms('admin_manage_permissions')) { error(403); }
if (!empty($_REQUEST['id'])) {
@@ -218,15 +218,15 @@
if (!$Err) {
if (!is_numeric($_REQUEST['id'])) {
$DB->query("INSERT INTO permissions (Level,Name,Secondary,PermittedForums,`Values`,DisplayStaff)
- VALUES ('".db_string($Level)."',
- '".db_string($Name)."',
+ VALUES ('".db_string($Level)."',
+ '".db_string($Name)."',
".$Secondary.",
'".db_string($Forums)."',
'".db_string(serialize($Values))."',
'".db_string($DisplayStaff)."')");
} else {
$DB->query("UPDATE permissions SET Level='".db_string($Level)."',
- Name='".db_string($Name)."',
+ Name='".db_string($Name)."',
Secondary=".$Secondary.",
PermittedForums='".db_string($Forums)."',
`Values`='".db_string(serialize($Values))."',
diff --git a/sections/tools/managers/bans.php b/sections/tools/managers/bans.php
index 20a6831e..c1fa511d 100644
--- a/sections/tools/managers/bans.php
+++ b/sections/tools/managers/bans.php
@@ -4,10 +4,11 @@
if (isset($_POST['submit'])) {
authorize();
+ $IPA = substr($_POST['start'], 0, strcspn($_POST['start'], '.'));
if ($_POST['submit'] == 'Delete') { //Delete
if(!is_number($_POST['id']) || $_POST['id'] == ''){ error(0); }
$DB->query('DELETE FROM ip_bans WHERE ID='.$_POST['id']);
- $Bans = $Cache->delete_value('ip_bans');
+ $Cache->delete_value('ip_bans_'.$IPA);
} else { //Edit & Create, Shared Validation
$Val->SetFields('start', '1','regex','You must include the starting IP address.',array('regex'=>'/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/i'));
$Val->SetFields('end', '1','regex','You must include the ending IP address.',array('regex'=>'/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/i'));
@@ -28,19 +29,12 @@
ToIP='$End',
Reason='$Notes'
WHERE ID='".$_POST['id']."'");
- $Bans = $Cache->get_value('ip_bans');
- $Cache->begin_transaction();
- $Cache->update_row($_POST['id'], array($_POST['id'], $Start, $End));
- $Cache->commit_transaction();
} else { //Create
$DB->query("INSERT INTO ip_bans
(FromIP, ToIP, Reason) VALUES
('$Start','$End', '$Notes')");
- $ID = $DB->inserted_id();
- $Bans = $Cache->get_value('ip_bans');
- $Bans[$ID] = array($ID, $Start, $End);
- $Cache->cache_value('ip_bans', $Bans, 0);
}
+ $Cache->delete_value('ip_bans_'.$IPA);
}
}
diff --git a/sections/tools/misc/quick_ban.php b/sections/tools/misc/quick_ban.php
index f5ed7cdd..9f0453ae 100644
--- a/sections/tools/misc/quick_ban.php
+++ b/sections/tools/misc/quick_ban.php
@@ -1,22 +1,21 @@
query('DELETE FROM ip_bans WHERE ID='.$_GET['id']);
- $Bans = $Cache->delete_value('ip_bans');
- }
- elseif($_GET['perform'] == 'create') {
+if (!check_perms('admin_manage_ipbans')) { error(403); }
+ if (isset($_GET['perform'])) {
+ $IPA = substr($_GET['ip'], 0, strcspn($_GET['ip'], '.'));
+ if ($_GET['perform'] == 'delete') {
+ if (!is_number($_GET['id']) || $_GET['id'] == '') {
+ error(0);
+ }
+ $DB->query('DELETE FROM ip_bans WHERE ID='.$_GET['id']);
+ $Bans = $Cache->delete_value('ip_bans_'.$IPA);
+ } elseif ($_GET['perform'] == 'create') {
$Notes = db_string($_GET['notes']);
- $IP = Tools::ip_to_unsigned($_GET['ip']); //Sanitized by Validation regex
- $DB->query("INSERT INTO ip_bans
- (FromIP, ToIP, Reason) VALUES
- ('$IP','$IP', '$Notes')");
- $ID = $DB->inserted_id();
- $Bans = $Cache->get_value('ip_bans');
- $Bans[$ID] = array($ID, $Start, $End);
- $Cache->cache_value('ip_bans', $Bans, 0);
+ $IP = Tools::ip_to_unsigned($_GET['ip']); //Sanitized by Validation regex
+ $DB->query("INSERT INTO ip_bans
+ (FromIP, ToIP, Reason) VALUES
+ ('$IP','$IP', '$Notes')");
+ $Cache->delete_value('ip_bans_'.$IPA);
}
}
diff --git a/sections/torrents/add_tag.php b/sections/torrents/add_tag.php
index cf92445e..e8332f9d 100644
--- a/sections/torrents/add_tag.php
+++ b/sections/torrents/add_tag.php
@@ -14,9 +14,9 @@
$Tags = explode(',', $_POST['tagname']);
foreach($Tags as $TagName) {
$TagName = Misc::sanitize_tag($TagName);
-
+
if(!empty($TagName)) {
- $TagName = Misc::get_alias_tag($TagName);
+ $TagName = Misc::get_alias_tag($TagName);
// Check DB for tag matching name
$DB->query("SELECT t.ID FROM tags AS t WHERE t.Name LIKE '".$TagName."'");
list($TagID) = $DB->next_record();
diff --git a/sections/torrents/delete.php b/sections/torrents/delete.php
index 8b275c7f..0be2ba5e 100644
--- a/sections/torrents/delete.php
+++ b/sections/torrents/delete.php
@@ -161,7 +161,7 @@
if(!$GroupID) { ?>
=$TorrentID?> (Deleted)
- } else {?>
+ } else {?>
=$LinkName?>
[DL]
uploaded by =$UploaderName?> =time_diff($Time)?>
diff --git a/sections/torrents/download.php b/sections/torrents/download.php
index edb3b73d..438069f4 100644
--- a/sections/torrents/download.php
+++ b/sections/torrents/download.php
@@ -3,8 +3,8 @@
enforce_login();
$TorrentPass = $LoggedUser['torrent_pass'];
$DownloadAlt = $LoggedUser['DownloadAlt'];
- $UserID = $LoggedUser['ID'];
- $AuthKey = $LoggedUser['AuthKey'];
+ $UserID = $LoggedUser['ID'];
+ $AuthKey = $LoggedUser['AuthKey'];
} else {
$UserInfo = $Cache->get_value('user_'.$_REQUEST['torrent_pass']);
if(!is_array($UserInfo)) {
@@ -33,12 +33,12 @@
if (!is_number($TorrentID)){ error(0); }
/* uTorrent remote redownloads .torrent files every fifteen minutes
- to prevent this retardation from blowing bandwidth etc., let's block it
- if he's downloaded the .torrent file twice before */
+ to prevent this retardation from blowing bandwidth etc., let's block it
+ if he's downloaded the .torrent file twice before */
if (strpos($_SERVER['HTTP_USER_AGENT'], 'BTWebClient') !== FALSE) {
$DB->query("SELECT 1 FROM users_downloads WHERE UserID=$UserID AND TorrentID=$TorrentID LIMIT 3");
if ($DB->record_count() > 2) {
- error('You have already downloaded this .torrent three times. If you need to download it again, please do so from your browser, not through uTorrent remote.');
+ error('You have already downloaded this .torrent three times. If you need to download it again, please do so from your browser, not through uTorrent remote.');
die();
}
}
@@ -96,10 +96,10 @@
if (!Torrents::has_token($TorrentID)) {
if ($FLTokens <= 0) {
- error("You do not have any freeleech tokens left. Please use the regular DL link.");
+ error("You do not have any freeleech tokens left. Please use the regular DL link.");
}
if ($Size >= 1073741824) {
- error("This torrent is too large. Please use the regular DL link.");
+ error("This torrent is too large. Please use the regular DL link.");
}
// Let the tracker know about this
diff --git a/sections/torrents/edit.php b/sections/torrents/edit.php
index 63de4c1c..ec86c88d 100644
--- a/sections/torrents/edit.php
+++ b/sections/torrents/edit.php
@@ -1,12 +1,12 @@
-//*********************************************************************//
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Edit form ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
-// This page relies on the TORRENT_FORM class. All it does is call //
-// the necessary functions. //
-//---------------------------------------------------------------------//
-// At the bottom, there are grouping functions which are off limits to //
-// most members. //
-//*********************************************************************//
+//**********************************************************************//
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Edit form ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
+// This page relies on the TORRENT_FORM class. All it does is call //
+// the necessary functions. //
+//----------------------------------------------------------------------//
+// At the bottom, there are grouping functions which are off limits to //
+// most members. //
+//**********************************************************************//
require(SERVER_ROOT.'/classes/class_torrent_form.php');
diff --git a/sections/torrents/editgroup.php b/sections/torrents/editgroup.php
index 2f171175..bce81a2b 100644
--- a/sections/torrents/editgroup.php
+++ b/sections/torrents/editgroup.php
@@ -55,19 +55,19 @@
Description
- if($CategoryID == 1) { ?>
+ if($CategoryID == 1) { ?>
- foreach ($ReleaseTypes as $Key => $Val) { ?>
+ foreach ($ReleaseTypes as $Key => $Val) { ?>
>
=$Val?>
- } ?>
+ } ?>
- if (check_perms('torrents_edit_vanityhouse')) { ?>
+ if (check_perms('torrents_edit_vanityhouse')) { ?>
- Vanity House />
- }
- } ?>
+ Vanity House />
+ }
+ } ?>
Edit summary
diff --git a/sections/torrents/index.php b/sections/torrents/index.php
index ad4bce4f..5859102f 100644
--- a/sections/torrents/index.php
+++ b/sections/torrents/index.php
@@ -357,12 +357,12 @@ function js_pages($Action, $TorrentID, $NumResults, $CurrentPage) {
error(403);
}
break;
- case 'warn' :
- include(SERVER_ROOT.'/sections/torrents/warn.php');
- break;
- case 'take_warn' :
- include(SERVER_ROOT.'/sections/torrents/take_warn.php');
- break;
+ case 'warn' :
+ include(SERVER_ROOT.'/sections/torrents/warn.php');
+ break;
+ case 'take_warn' :
+ include(SERVER_ROOT.'/sections/torrents/take_warn.php');
+ break;
default:
enforce_login();
diff --git a/sections/torrents/merge.php b/sections/torrents/merge.php
index 3ffec808..26f1db6c 100644
--- a/sections/torrents/merge.php
+++ b/sections/torrents/merge.php
@@ -52,7 +52,7 @@
} else {
authorize();
- // Votes ninjutsu. This is so annoyingly complicated.
+ // Votes ninjutsu. This is so annoyingly complicated.
// 1. Get a list of everybody who voted on the old group and clear their cache keys
$DB->query("SELECT UserID FROM users_votes WHERE GroupID='$GroupID'");
while (list($UserID) = $DB->next_record()) {
@@ -64,12 +64,12 @@
$DB->query("DELETE FROM users_votes WHERE GroupID='$GroupID'");
$DB->query("INSERT INTO torrents_votes (GroupID, Ups, Total, Score)
SELECT $NewGroupID, UpVotes, TotalVotes, VoteScore
- FROM (SELECT IFNULL(SUM(IF(Type='Up',1,0)),0) As UpVotes,
+ FROM (SELECT IFNULL(SUM(IF(Type='Up',1,0)),0) As UpVotes,
COUNT(1) AS TotalVotes,
binomial_ci(IFNULL(SUM(IF(Type='Up',1,0)),0), COUNT(1)) AS VoteScore
- FROM users_votes
- WHERE GroupID = $NewGroupID
- GROUP BY GroupID) AS a
+ FROM users_votes
+ WHERE GroupID = $NewGroupID
+ GROUP BY GroupID) AS a
ON DUPLICATE KEY UPDATE
Ups = a.UpVotes,
Total = a.TotalVotes,
@@ -126,4 +126,4 @@
header('Location: torrents.php?id='.$GroupID);
}
-?>
\ No newline at end of file
+?>
diff --git a/sections/torrents/notify.php b/sections/torrents/notify.php
index 1a43f27e..c46c5a8b 100644
--- a/sections/torrents/notify.php
+++ b/sections/torrents/notify.php
@@ -190,7 +190,7 @@ function header_link($SortKey, $DefaultWay = "desc") {