Browse Source

Allow for revoking promotion purchasing permission

spaghetti 8 years ago
parent
commit
b7d468f9f1

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

162
           i.DisableAvatar,
162
           i.DisableAvatar,
163
           i.DisablePM,
163
           i.DisablePM,
164
           i.DisableNips,
164
           i.DisableNips,
165
+          i.DisablePromotion,
165
           i.DisableRequests,
166
           i.DisableRequests,
166
           i.DisableForums,
167
           i.DisableForums,
167
           i.DisableTagging,
168
           i.DisableTagging,

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

119
       $Err[] = "You cannot be promoted while warned";
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
     if ($BP < $Classes[$To]['Price']) {
126
     if ($BP < $Classes[$To]['Price']) {
123
       $Err[] = "Not enough points";
127
       $Err[] = "Not enough points";
124
     }
128
     }

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

78
 $DisableWiki = isset($_POST['DisableWiki']) ? 1 : 0;
78
 $DisableWiki = isset($_POST['DisableWiki']) ? 1 : 0;
79
 $DisablePM = isset($_POST['DisablePM']) ? 1 : 0;
79
 $DisablePM = isset($_POST['DisablePM']) ? 1 : 0;
80
 $DisableNips = isset($_POST['DisableNips']) ? 1 : 0;
80
 $DisableNips = isset($_POST['DisableNips']) ? 1 : 0;
81
+$DisablePromotion = isset($_POST['DisablePromotion']) ? 1 : 0;
81
 $DisableIRC = isset($_POST['DisableIRC']) ? 1 : 0;
82
 $DisableIRC = isset($_POST['DisableIRC']) ? 1 : 0;
82
 $DisableRequests = isset($_POST['DisableRequests']) ? 1 : 0;
83
 $DisableRequests = isset($_POST['DisableRequests']) ? 1 : 0;
83
 $DisableLeech = isset($_POST['DisableLeech']) ? 0 : 1;
84
 $DisableLeech = isset($_POST['DisableLeech']) ? 0 : 1;
134
     DisableWiki,
135
     DisableWiki,
135
     DisablePM,
136
     DisablePM,
136
     DisableNips,
137
     DisableNips,
138
+    DisablePromotion,
137
     DisableIRC,
139
     DisableIRC,
138
     DisableRequests,
140
     DisableRequests,
139
     m.RequiredRatio,
141
     m.RequiredRatio,
655
   $EditSummary[] = 'Nip earning ' . ($DisableNips ? 'disabled' : 'enabled');
657
   $EditSummary[] = 'Nip earning ' . ($DisableNips ? 'disabled' : 'enabled');
656
   $HeavyUpdates['DisableNips'] = $DisableNips;
658
   $HeavyUpdates['DisableNips'] = $DisableNips;
657
   if (!empty($UserReason)) {
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
       i.DisableWiki,
64
       i.DisableWiki,
65
       i.DisablePM,
65
       i.DisablePM,
66
       i.DisableNips,
66
       i.DisableNips,
67
+      i.DisablePromotion,
67
       i.DisableIRC,
68
       i.DisableIRC,
68
       i.DisableRequests," . "
69
       i.DisableRequests," . "
69
       m.FLTokens,
70
       m.FLTokens,
83
     header("Location: log.php?search=User+$UserID");
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
 } else { // Person viewing is a normal user
88
 } else { // Person viewing is a normal user
88
   $DB->query("
89
   $DB->query("
89
     SELECT
90
     SELECT
1394
           <br /><br />
1395
           <br /><br />
1395
 
1396
 
1396
           <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="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
           <input type="checkbox" name="DisableInvites" id="DisableInvites"<? if ($DisableInvites == 1) { ?> checked="checked"<? } ?> /> <label for="DisableInvites">Invites</label>
1400
           <input type="checkbox" name="DisableInvites" id="DisableInvites"<? if ($DisableInvites == 1) { ?> checked="checked"<? } ?> /> <label for="DisableInvites">Invites</label>
1401
         </td>
1401
         </td>
1402
       </tr>
1402
       </tr>

Loading…
Cancel
Save