Ok, people…careful with this one!
This is for if you would like to allow for mass ban & delete from the Tickets tab.
First you need to add a new button to the main page.
include/staff/tickets.inc.php
<input class="button" type="submit" name="banDelete" value="Ban & Delete" onClick=' return confirm("Are you ABSOLUTLEY CERTAIN this was spam?");'>
Then we need to add the functionality. Its easier here to replace a larger chunk so…
scp/tickets.php
Replace
if(!$errors) { $count=count($_POST['tids']); if(isset($_POST['reopen'])){ $i=0; foreach($_POST['tids'] as $k=>$v) { $t = new Ticket($v); if($t && @$t->reopen()) $i++; } $msg="$i of $count selected tickets reopened"; }elseif(isset($_POST['close'])){ $i=0; foreach($_POST['tids'] as $k=>$v) { $t = new Ticket($v); if($t && @$t->close()) $i++; } $msg="$i of $count selected tickets closed"; }elseif(isset($_POST['overdue'])){ $i=0; foreach($_POST['tids'] as $k=>$v) { $t = new Ticket($v); if($t && !$t->isoverdue()) if($t->markOverdue()) $i++; } $msg="$i of $count selected tickets marked overdue"; }elseif(isset($_POST['delete'])){ $i=0; foreach($_POST['tids'] as $k=>$v) { $t = new Ticket($v); if($t && @$t->delete()) $i++; } $msg="$i of $count selected tickets deleted"; } } break;
With
if(!$errors) { $count=count($_POST['tids']); if(isset($_POST['reopen'])){ $i=0; foreach($_POST['tids'] as $k=>$v) { $t = new Ticket($v); if($t && @$t->reopen()) $i++; } $msg="$i of $count selected tickets reopened"; }elseif(isset($_POST['close'])){ $i=0; foreach($_POST['tids'] as $k=>$v) { $t = new Ticket($v); if($t && @$t->close()) $i++; } $msg="$i of $count selected tickets closed"; }elseif(isset($_POST['overdue'])){ $i=0; foreach($_POST['tids'] as $k=>$v) { $t = new Ticket($v); if($t && !$t->isoverdue()) if($t->markOverdue()) $i++; } $msg="$i of $count selected tickets marked overdue"; }elseif(isset($_POST['delete'])){ $i=0; foreach($_POST['tids'] as $k=>$v) { $t = new Ticket($v); if($t && @$t->delete()) $i++; } $msg="$i of $count selected tickets deleted"; } // NOW MY CODE elseif(isset($_POST['banDelete'])){ $i=0; foreach($_POST['tids'] as $k=>$v) { $t = new Ticket($v); if($t && @$t->delete()) { if($beenBanned=$t->getEmail()){ if(Banlist::add($t->getEmail(),$thisuser->getName())){} $msg .= "$beenBanned banned!<br />";} $i++; } } $msg .= "$i of $count selected tickets deleted <br />$i of $count emails banned."; }} break;
All of your effected tickets will now be deleted and the emails banned. You will also be alerted to the result so you can double check your email addresses and unban if necessary.