Browse Source

Allow for revoking promotion purchasing permission

spaghetti 8 years ago
parent
commit
b7d468f9f1
4 changed files with 21 additions and 5 deletions
  1. 1
    0
      classes/users.class.php
  2. 4
    0
      sections/store/promotion.php
  3. 12
    1
      sections/user/takemoderate.php
  4. 4
    4
      sections/user/user.php

+ 1
- 0
classes/users.class.php View File

@@ -162,6 +162,7 @@ class Users {
162 162
           i.DisableAvatar,
163 163
           i.DisablePM,
164 164
           i.DisableNips,
165
+          i.DisablePromotion,
165 166
           i.DisableRequests,
166 167
           i.DisableForums,
167 168
           i.DisableTagging,

+ 4
- 0
sections/store/promotion.php View File

@@ -119,6 +119,10 @@ if ($DB->has_results()) {
119 119
       $Err[] = "You cannot be promoted while warned";
120 120
     }
121 121
 
122
+    if ($LoggedUser['DisablePromotion']) {
123
+      $Err[] = "You have been banned from purchasing promotions";
124
+    }
125
+
122 126
     if ($BP < $Classes[$To]['Price']) {
123 127
       $Err[] = "Not enough points";
124 128
     }

+ 12
- 1
sections/user/takemoderate.php View File

@@ -78,6 +78,7 @@ $DisableUpload = isset($_POST['DisableUpload']) ? 1 : 0;
78 78
 $DisableWiki = isset($_POST['DisableWiki']) ? 1 : 0;
79 79
 $DisablePM = isset($_POST['DisablePM']) ? 1 : 0;
80 80
 $DisableNips = isset($_POST['DisableNips']) ? 1 : 0;
81
+$DisablePromotion = isset($_POST['DisablePromotion']) ? 1 : 0;
81 82
 $DisableIRC = isset($_POST['DisableIRC']) ? 1 : 0;
82 83
 $DisableRequests = isset($_POST['DisableRequests']) ? 1 : 0;
83 84
 $DisableLeech = isset($_POST['DisableLeech']) ? 0 : 1;
@@ -134,6 +135,7 @@ $DB->query("
134 135
     DisableWiki,
135 136
     DisablePM,
136 137
     DisableNips,
138
+    DisablePromotion,
137 139
     DisableIRC,
138 140
     DisableRequests,
139 141
     m.RequiredRatio,
@@ -655,7 +657,16 @@ if ($DisableNips != $Cur['DisableNips'] && check_perms('users_disable_any')) {
655 657
   $EditSummary[] = 'Nip earning ' . ($DisableNips ? 'disabled' : 'enabled');
656 658
   $HeavyUpdates['DisableNips'] = $DisableNips;
657 659
   if (!empty($UserReason)) {
658
-    Misc::send_pm($UserID, 0, 'Your Nip-earning ability has been disabled', "Your Nip-earning ability been disabled. The reason given was: [quote]{$UserReason}[/quote] If you would like to discuss this, please join ".BOT_DISABLED_CHAN.' on our IRC network. Instructions can be found [url='.site_url().'wiki.php?action=article&amp;name=IRC+-+How+to+join]here[/url].');
660
+    Misc::send_pm($UserID, 0, 'Your Nip-earning ability has been disabled', "Your Nip-earning ability has been disabled. The reason given was: [quote]{$UserReason}[/quote] If you would like to discuss this, please join ".BOT_DISABLED_CHAN.' on our IRC network. Instructions can be found [url='.site_url().'wiki.php?action=article&amp;name=IRC+-+How+to+join]here[/url].');
661
+  }
662
+}
663
+
664
+if ($DisablePromotion != $Cur['DisablePromotion'] && check_perms('users_disable_any')) {
665
+  $UpdateSet[] = "DisablePromotion = '$DisablePromotion'";
666
+  $EditSummary[] = 'Class purchasing ' . ($DisablePromotion ? 'disabled' : 'enabled');
667
+  $HeavyUpdates['DisablePromotion'] = $DisablePromotion;
668
+  if (!empty($UserReason)) {
669
+    Misc::send_pm($UserID, 0, 'Your promotion purchasing ability has been disabled', "Your promotion purchasing ability has been disabled. The reason given was: [quote]{$UserReason}[/quote] If you would like to discuss this, please join ".BOT_DISABLED_CHAN.' on our IRC network. Instructions can be found [url='.site_url().'wiki.php?action=article&amp;name=IRC+-+How+to+join]here[/url].');
659 670
   }
660 671
 }
661 672
 

+ 4
- 4
sections/user/user.php View File

@@ -64,6 +64,7 @@ if (check_perms('users_mod')) { // Person viewing is a staff member
64 64
       i.DisableWiki,
65 65
       i.DisablePM,
66 66
       i.DisableNips,
67
+      i.DisablePromotion,
67 68
       i.DisableIRC,
68 69
       i.DisableRequests," . "
69 70
       m.FLTokens,
@@ -83,7 +84,7 @@ if (check_perms('users_mod')) { // Person viewing is a staff member
83 84
     header("Location: log.php?search=User+$UserID");
84 85
   }
85 86
 
86
-  list($Username,  $Email,  $LastAccess, $IP, $Class, $Uploaded, $Downloaded, $RequiredRatio, $CustomTitle, $torrent_pass, $Enabled, $Paranoia, $Invites, $DisableLeech, $Visible, $BonusPoints, $JoinDate, $Info, $Avatar, $AdminComment, $Donor, $Artist, $Warned, $SupportFor, $RestrictedForums, $PermittedForums, $InviterID, $InviterName, $ForumPosts, $RatioWatchEnds, $RatioWatchDownload, $DisableAvatar, $DisableInvites, $DisablePosting, $DisableForums, $DisableTagging, $DisableUpload, $DisableWiki, $DisablePM, $DisableNips, $DisableIRC, $DisableRequests, $FLTokens, $CommentHash, $InfoTitle, $LockedAccount) = $DB->next_record(MYSQLI_NUM, array(8, 11));
87
+  list($Username, $Email, $LastAccess, $IP, $Class, $Uploaded, $Downloaded, $RequiredRatio, $CustomTitle, $torrent_pass, $Enabled, $Paranoia, $Invites, $DisableLeech, $Visible, $BonusPoints, $JoinDate, $Info, $Avatar, $AdminComment, $Donor, $Artist, $Warned, $SupportFor, $RestrictedForums, $PermittedForums, $InviterID, $InviterName, $ForumPosts, $RatioWatchEnds, $RatioWatchDownload, $DisableAvatar, $DisableInvites, $DisablePosting, $DisableForums, $DisableTagging, $DisableUpload, $DisableWiki, $DisablePM, $DisableNips, $DisablePromotion, $DisableIRC, $DisableRequests, $FLTokens, $CommentHash, $InfoTitle, $LockedAccount) = $DB->next_record(MYSQLI_NUM, array(8, 11));
87 88
 } else { // Person viewing is a normal user
88 89
   $DB->query("
89 90
     SELECT
@@ -1394,9 +1395,8 @@ if (!$DisableNips) {
1394 1395
           <br /><br />
1395 1396
 
1396 1397
           <input type="checkbox" name="DisableTagging" id="DisableTagging"<? if ($DisableTagging == 1) { ?> checked="checked"<? } ?> /> <label for="DisableTagging" class="tooltip" title="This only disables a user's ability to delete tags.">Tagging</label> |
1397
-          <input type="checkbox" name="DisableWiki" id="DisableWiki"<? if ($DisableWiki == 1) { ?> checked="checked"<? } ?> /> <label for="DisableWiki">Wiki</label>
1398
-          <br /><br />
1399
-
1398
+          <input type="checkbox" name="DisableWiki" id="DisableWiki"<? if ($DisableWiki == 1) { ?> checked="checked"<? } ?> /> <label for="DisableWiki">Wiki</label> |
1399
+          <input type="checkbox" name="DisablePromotion" id="DisablePromotion"<? if ($DisablePromotion == 1) { ?> checked="checked"<? } ?> /> <label for="DisablePromotion">Promotions</label> |
1400 1400
           <input type="checkbox" name="DisableInvites" id="DisableInvites"<? if ($DisableInvites == 1) { ?> checked="checked"<? } ?> /> <label for="DisableInvites">Invites</label>
1401 1401
         </td>
1402 1402
       </tr>

Loading…
Cancel
Save