|
@@ -225,7 +225,7 @@ if (isset($_COOKIE['session']) && isset($_COOKIE['userid'])) {
|
225
|
225
|
|
226
|
226
|
$UserSessions = $Cache->get_value("users_sessions_$UserID");
|
227
|
227
|
if (!is_array($UserSessions)) {
|
228
|
|
- $DB->query(
|
|
228
|
+ $DB->prepared_query(
|
229
|
229
|
"
|
230
|
230
|
SELECT
|
231
|
231
|
SessionID,
|
|
@@ -250,7 +250,7 @@ if (isset($_COOKIE['session']) && isset($_COOKIE['userid'])) {
|
250
|
250
|
// Check if user is enabled
|
251
|
251
|
$Enabled = $Cache->get_value('enabled_'.$LoggedUser['ID']);
|
252
|
252
|
if ($Enabled === false) {
|
253
|
|
- $DB->query("
|
|
253
|
+ $DB->prepared_query("
|
254
|
254
|
SELECT Enabled
|
255
|
255
|
FROM users_main
|
256
|
256
|
WHERE ID = '$LoggedUser[ID]'");
|
|
@@ -267,7 +267,7 @@ if (isset($_COOKIE['session']) && isset($_COOKIE['userid'])) {
|
267
|
267
|
// Up/Down stats
|
268
|
268
|
$UserStats = $Cache->get_value('user_stats_'.$LoggedUser['ID']);
|
269
|
269
|
if (!is_array($UserStats)) {
|
270
|
|
- $DB->query("
|
|
270
|
+ $DB->prepared_query("
|
271
|
271
|
SELECT Uploaded AS BytesUploaded, Downloaded AS BytesDownloaded, RequiredRatio
|
272
|
272
|
FROM users_main
|
273
|
273
|
WHERE ID = '$LoggedUser[ID]'");
|
|
@@ -321,7 +321,7 @@ if (isset($_COOKIE['session']) && isset($_COOKIE['userid'])) {
|
321
|
321
|
|
322
|
322
|
// Update LastUpdate every 10 minutes
|
323
|
323
|
if (strtotime($UserSessions[$SessionID]['LastUpdate']) + 600 < time()) {
|
324
|
|
- $DB->query("
|
|
324
|
+ $DB->prepared_query("
|
325
|
325
|
UPDATE users_main
|
326
|
326
|
SET LastAccess = NOW()
|
327
|
327
|
WHERE ID = '$LoggedUser[ID]'
|
|
@@ -343,7 +343,7 @@ if (isset($_COOKIE['session']) && isset($_COOKIE['userid'])) {
|
343
|
343
|
WHERE UserID = '$LoggedUser[ID]'
|
344
|
344
|
AND SessionID = '".db_string($SessionID)."'";
|
345
|
345
|
|
346
|
|
- $DB->query($SessionQuery);
|
|
346
|
+ $DB->prepared_query($SessionQuery);
|
347
|
347
|
$Cache->begin_transaction("users_sessions_$UserID");
|
348
|
348
|
$Cache->delete_row($SessionID);
|
349
|
349
|
|
|
@@ -362,7 +362,7 @@ if (isset($_COOKIE['session']) && isset($_COOKIE['userid'])) {
|
362
|
362
|
if (isset($LoggedUser['Permissions']['site_torrents_notify'])) {
|
363
|
363
|
$LoggedUser['Notify'] = $Cache->get_value('notify_filters_'.$LoggedUser['ID']);
|
364
|
364
|
if (!is_array($LoggedUser['Notify'])) {
|
365
|
|
- $DB->query("
|
|
365
|
+ $DB->prepared_query("
|
366
|
366
|
SELECT ID, Label
|
367
|
367
|
FROM users_notify_filters
|
368
|
368
|
WHERE UserID = '$LoggedUser[ID]'");
|
|
@@ -394,7 +394,7 @@ if (isset($_COOKIE['session']) && isset($_COOKIE['userid'])) {
|
394
|
394
|
// Get stylesheets
|
395
|
395
|
$Stylesheets = $Cache->get_value('stylesheets');
|
396
|
396
|
if (!is_array($Stylesheets)) {
|
397
|
|
- $DB->query('
|
|
397
|
+ $DB->prepared_query('
|
398
|
398
|
SELECT
|
399
|
399
|
ID,
|
400
|
400
|
LOWER(REPLACE(Name, " ", "_")) AS Name,
|
|
@@ -429,7 +429,7 @@ function logout()
|
429
|
429
|
setcookie('keeplogged', '', time() - 60 * 60 * 24 * 365, '/', '', false);
|
430
|
430
|
|
431
|
431
|
if ($SessionID) {
|
432
|
|
- G::$DB->query("
|
|
432
|
+ G::$DB->prepared_query("
|
433
|
433
|
DELETE FROM users_sessions
|
434
|
434
|
WHERE UserID = '" . G::$LoggedUser['ID'] . "'
|
435
|
435
|
AND SessionID = '".db_string($SessionID)."'");
|
|
@@ -451,7 +451,7 @@ function logout_all_sessions()
|
451
|
451
|
{
|
452
|
452
|
$UserID = G::$LoggedUser['ID'];
|
453
|
453
|
|
454
|
|
- G::$DB->query("
|
|
454
|
+ G::$DB->prepared_query("
|
455
|
455
|
DELETE FROM users_sessions
|
456
|
456
|
WHERE UserID = '$UserID'");
|
457
|
457
|
|