コード例 #1
0
 /**
  * Delete spam and optionally delete the users.
  * @param type $LogIDs 
  */
 public function DeleteSpam($LogIDs)
 {
     $this->Permission('Garden.Moderation.Manage');
     if (!$this->Request->IsPostBack()) {
         throw PermissionException('Javascript');
     }
     $LogIDs = explode(',', $LogIDs);
     // Ban the appropriate users.
     $UserIDs = $this->Form->GetFormValue('UserID', array());
     if (!is_array($UserIDs)) {
         $UserIDs = array();
     }
     if (!empty($UserIDs)) {
         // Grab the rest of the log entries.
         $OtherLogIDs = $this->LogModel->GetWhere(array('Operation' => 'Spam', 'RecordUserID' => $UserIDs));
         $OtherLogIDs = ConsolidateArrayValuesByKey($OtherLogIDs, 'LogID');
         $LogIDs = array_merge($LogIDs, $OtherLogIDs);
         foreach ($UserIDs as $UserID) {
             Gdn::UserModel()->Ban($UserID, array('Reason' => 'Spam', 'DeleteContent' => TRUE, 'Log' => TRUE));
         }
     }
     // Grab the logs.
     $this->LogModel->Delete($LogIDs);
     $this->Render('Blank', 'Utility');
 }
コード例 #2
0
 public function Delete($LogIDs) {
    $this->Permission('Garden.Moderation.Manage');
    // Grab the logs.
    $this->LogModel->Delete($LogIDs);
 }