|
@@ -20,21 +20,21 @@ if ($UserID != $LoggedUser['ID'] && !check_perms('users_edit_profiles', $Permiss
|
20
|
20
|
}
|
21
|
21
|
|
22
|
22
|
$Val->SetFields('stylesheet', 1, "number", "You forgot to select a stylesheet.");
|
23
|
|
-$Val->SetFields('styleurl', 0, "regex", "You did not enter a valid stylesheet URL.", array('regex' => '/^'.CSS_REGEX.'$/i'));
|
|
23
|
+$Val->SetFields('styleurl', 0, "regex", "You did not enter a valid stylesheet URL.", ['regex' => '/^'.CSS_REGEX.'$/i']);
|
24
|
24
|
// The next two are commented out because the drop-down menus were replaced with a check box and radio buttons
|
25
|
25
|
//$Val->SetFields('disablegrouping', 0, "number", "You forgot to select your torrent grouping option.");
|
26
|
26
|
//$Val->SetFields('torrentgrouping', 0, "number", "You forgot to select your torrent grouping option.");
|
27
|
|
-$Val->SetFields('postsperpage', 1, "number", "You forgot to select your posts per page option.", array('inarray' => array(25, 50, 100)));
|
28
|
|
-//$Val->SetFields('hidecollage', 1, "number", "You forgot to select your collage option.", array('minlength' => 0, 'maxlength' => 1));
|
|
27
|
+$Val->SetFields('postsperpage', 1, "number", "You forgot to select your posts per page option.", ['inarray' => [25, 50, 100]]);
|
|
28
|
+//$Val->SetFields('hidecollage', 1, "number", "You forgot to select your collage option.", ['minlength' => 0, 'maxlength' => 1]);
|
29
|
29
|
$Val->SetFields('collagecovers', 1, "number", "You forgot to select your collage option.");
|
30
|
|
-$Val->SetFields('avatar', 0, "regex", "You did not enter a valid avatar URL.", array('regex' => "/^".IMAGE_REGEX."$/i"));
|
|
30
|
+$Val->SetFields('avatar', 0, "regex", "You did not enter a valid avatar URL.", ['regex' => "/^".IMAGE_REGEX."$/i"]);
|
31
|
31
|
$Val->SetFields('email', 1, "email", "You did not enter a valid email address.");
|
32
|
|
-$Val->SetFields('twofa', 0, "regex", "You did not enter a valid 2FA verification code.", array('regex' => '/^[0-9]{6}$/'));
|
33
|
|
-$Val->SetFields('irckey', 0, "string", "You did not enter a valid IRC key. An IRC key must be between 6 and 32 characters long.", array('minlength' => 6, 'maxlength' => 32));
|
34
|
|
-$Val->SetFields('new_pass_1', 0, "regex", "You did not enter a valid password. A valid password is 6 characters or longer.", array('regex' => '/(?=^.{6,}$).*$/'));
|
35
|
|
-$Val->SetFields('new_pass_2', 1, "compare", "Your passwords do not match.", array('comparefield' => 'new_pass_1'));
|
|
32
|
+$Val->SetFields('twofa', 0, "regex", "You did not enter a valid 2FA verification code.", ['regex' => '/^[0-9]{6}$/']);
|
|
33
|
+$Val->SetFields('irckey', 0, "string", "You did not enter a valid IRC key. An IRC key must be between 6 and 32 characters long.", ['minlength' => 6, 'maxlength' => 32]);
|
|
34
|
+$Val->SetFields('new_pass_1', 0, "regex", "You did not enter a valid password. A valid password is 6 characters or longer.", ['regex' => '/(?=^.{6,}$).*$/']);
|
|
35
|
+$Val->SetFields('new_pass_2', 1, "compare", "Your passwords do not match.", ['comparefield' => 'new_pass_1']);
|
36
|
36
|
if (check_perms('site_advanced_search')) {
|
37
|
|
- $Val->SetFields('searchtype', 1, "number", "You forgot to select your default search preference.", array('minlength' => 0, 'maxlength' => 1));
|
|
37
|
+ $Val->SetFields('searchtype', 1, "number", "You forgot to select your default search preference.", ['minlength' => 0, 'maxlength' => 1]);
|
38
|
38
|
}
|
39
|
39
|
|
40
|
40
|
$Err = $Val->ValidateForm($_POST);
|
|
@@ -75,7 +75,7 @@ if (isset($_POST['p_snatched_c']) && isset($_POST['p_seeding_c']) && isset($_POS
|
75
|
75
|
|
76
|
76
|
// if showing exactly 2 of stats, show all 3 of stats
|
77
|
77
|
$StatsShown = 0;
|
78
|
|
-$Stats = array('downloaded', 'uploaded', 'ratio');
|
|
78
|
+$Stats = ['downloaded', 'uploaded', 'ratio'];
|
79
|
79
|
foreach ($Stats as $S) {
|
80
|
80
|
if (isset($_POST["p_$S"])) {
|
81
|
81
|
$StatsShown++;
|
|
@@ -88,15 +88,15 @@ if ($StatsShown == 2) {
|
88
|
88
|
}
|
89
|
89
|
}
|
90
|
90
|
|
91
|
|
-$Paranoia = array();
|
92
|
|
-$Checkboxes = array('downloaded', 'uploaded', 'ratio', 'lastseen', 'requiredratio', 'invitedcount', 'artistsadded', 'notifications');
|
|
91
|
+$Paranoia = [];
|
|
92
|
+$Checkboxes = ['downloaded', 'uploaded', 'ratio', 'lastseen', 'requiredratio', 'invitedcount', 'artistsadded', 'notifications'];
|
93
|
93
|
foreach ($Checkboxes as $C) {
|
94
|
94
|
if (!isset($_POST["p_$C"])) {
|
95
|
95
|
$Paranoia[] = $C;
|
96
|
96
|
}
|
97
|
97
|
}
|
98
|
98
|
|
99
|
|
-$SimpleSelects = array('torrentcomments', 'collages', 'collagecontribs', 'uploads', 'uniquegroups', 'perfectflacs', 'seeding', 'leeching', 'snatched');
|
|
99
|
+$SimpleSelects = ['torrentcomments', 'collages', 'collagecontribs', 'uploads', 'uniquegroups', 'perfectflacs', 'seeding', 'leeching', 'snatched'];
|
100
|
100
|
foreach ($SimpleSelects as $S) {
|
101
|
101
|
if (!isset($_POST["p_$S".'_c']) && !isset($_POST["p_$S".'_l'])) {
|
102
|
102
|
// Very paranoid - don't show count or list
|
|
@@ -107,7 +107,7 @@ foreach ($SimpleSelects as $S) {
|
107
|
107
|
}
|
108
|
108
|
}
|
109
|
109
|
|
110
|
|
-$Bounties = array('requestsfilled', 'requestsvoted');
|
|
110
|
+$Bounties = ['requestsfilled', 'requestsvoted'];
|
111
|
111
|
foreach ($Bounties as $B) {
|
112
|
112
|
if (isset($_POST["p_$B".'_list'])) {
|
113
|
113
|
$_POST["p_$B".'_count'] = 'on';
|
|
@@ -292,7 +292,7 @@ if (!empty($_POST['sorthide'])) {
|
292
|
292
|
$Options['SortHide'][$E[0]] = $E[1];
|
293
|
293
|
}
|
294
|
294
|
} else {
|
295
|
|
- $Options['SortHide'] = array();
|
|
295
|
+ $Options['SortHide'] = [];
|
296
|
296
|
}
|
297
|
297
|
|
298
|
298
|
if (check_perms('site_advanced_search')) {
|
|
@@ -306,7 +306,6 @@ unset($Options['ArtistNoRedirect']);
|
306
|
306
|
unset($Options['ShowQueryList']);
|
307
|
307
|
unset($Options['ShowCacheList']);
|
308
|
308
|
|
309
|
|
-$DownloadAlt = isset($_POST['downloadalt']) ? 1 : 0;
|
310
|
309
|
$UnseededAlerts = isset($_POST['unseededalerts']) ? 1 : 0;
|
311
|
310
|
|
312
|
311
|
Donations::update_rewards($UserID);
|
|
@@ -316,11 +315,11 @@ NotificationsManager::save_settings($UserID);
|
316
|
315
|
if (!empty($_POST['badges'])) {
|
317
|
316
|
$BadgeIDs = array_slice($_POST['badges'], 0, 5);
|
318
|
317
|
} else {
|
319
|
|
- $BadgeIDs = array();
|
|
318
|
+ $BadgeIDs = [];
|
320
|
319
|
}
|
321
|
320
|
|
322
|
321
|
$BadgesChanged = false;
|
323
|
|
-$NewBadges = array();
|
|
322
|
+$NewBadges = [];
|
324
|
323
|
if ($Cache->get_value('user_badges_'.$UserID)) {
|
325
|
324
|
$Badges = $Cache->get_value('user_badges_'.$UserID);
|
326
|
325
|
foreach ($Badges as $Badge) {
|
|
@@ -334,7 +333,7 @@ if ($Cache->get_value('user_badges_'.$UserID)) {
|
334
|
333
|
$Displayed = false;
|
335
|
334
|
$BadgesChanged = true;
|
336
|
335
|
}
|
337
|
|
- $NewBadges[] = array('BadgeID' => $Badge['BadgeID'], 'Displayed' => $Displayed?'1':'0');
|
|
336
|
+ $NewBadges[] = ['BadgeID' => $Badge['BadgeID'], 'Displayed' => $Displayed?'1':'0'];
|
338
|
337
|
|
339
|
338
|
}
|
340
|
339
|
} else {
|
|
@@ -345,24 +344,18 @@ if ($BadgesChanged) {
|
345
|
344
|
}
|
346
|
345
|
// End Badge settings
|
347
|
346
|
|
348
|
|
-// Information on how the user likes to download torrents is stored in cache
|
349
|
|
-if ($DownloadAlt != $LoggedUser['DownloadAlt']) {
|
350
|
|
- $Cache->delete_value('user_'.$LoggedUser['torrent_pass']);
|
351
|
|
-}
|
352
|
|
-
|
353
|
347
|
$Cache->begin_transaction("user_info_$UserID");
|
354
|
|
-$Cache->update_row(false, array(
|
355
|
|
- 'Avatar' => display_str($_POST['avatar']),
|
356
|
|
- 'Paranoia' => $Paranoia
|
357
|
|
-));
|
|
348
|
+$Cache->update_row(false, [
|
|
349
|
+ 'Avatar' => display_str($_POST['avatar']),
|
|
350
|
+ 'Paranoia' => $Paranoia
|
|
351
|
+]);
|
358
|
352
|
$Cache->commit_transaction(0);
|
359
|
353
|
|
360
|
354
|
$Cache->begin_transaction("user_info_heavy_$UserID");
|
361
|
|
-$Cache->update_row(false, array(
|
362
|
|
- 'StyleID' => $_POST['stylesheet'],
|
363
|
|
- 'StyleURL' => display_str($_POST['styleurl']),
|
364
|
|
- 'DownloadAlt' => $DownloadAlt
|
365
|
|
- ));
|
|
355
|
+$Cache->update_row(false, [
|
|
356
|
+ 'StyleID' => $_POST['stylesheet'],
|
|
357
|
+ 'StyleURL' => display_str($_POST['styleurl'])
|
|
358
|
+]);
|
366
|
359
|
$Cache->update_row(false, $Options);
|
367
|
360
|
$Cache->commit_transaction(0);
|
368
|
361
|
|
|
@@ -378,7 +371,6 @@ $SQL = "
|
378
|
371
|
i.NotifyOnQuote = '".db_string($Options['NotifyOnQuote'])."',
|
379
|
372
|
i.Info = '".db_string($_POST['info'])."',
|
380
|
373
|
i.InfoTitle = '".db_string($_POST['profile_title'])."',
|
381
|
|
- i.DownloadAlt = '$DownloadAlt',
|
382
|
374
|
i.UnseededAlerts = '$UnseededAlerts',
|
383
|
375
|
m.Email = '".DBCrypt::encrypt($_POST['email'])."',
|
384
|
376
|
m.IRCKey = '".db_string($_POST['irckey'])."',
|
|
@@ -408,11 +400,11 @@ if (isset($_POST['resetpasskey'])) {
|
408
|
400
|
VALUES
|
409
|
401
|
('$UserID', '$OldPassKey', '$NewPassKey', '$ChangerIP', '".sqltime()."')");
|
410
|
402
|
$Cache->begin_transaction("user_info_heavy_$UserID");
|
411
|
|
- $Cache->update_row(false, array('torrent_pass' => $NewPassKey));
|
|
403
|
+ $Cache->update_row(false, ['torrent_pass' => $NewPassKey]);
|
412
|
404
|
$Cache->commit_transaction(0);
|
413
|
405
|
$Cache->delete_value("user_$OldPassKey");
|
414
|
406
|
|
415
|
|
- Tracker::update_tracker('change_passkey', array('oldpasskey' => $OldPassKey, 'newpasskey' => $NewPassKey));
|
|
407
|
+ Tracker::update_tracker('change_passkey', ['oldpasskey' => $OldPassKey, 'newpasskey' => $NewPassKey]);
|
416
|
408
|
}
|
417
|
409
|
|
418
|
410
|
$SQL .= "WHERE m.ID = '".db_string($UserID)."'";
|