public function NotSpam($LogIDs) { $this->Permission('Garden.Moderation.Manage'); if (!$this->Request->IsPostBack()) { throw PermissionException('Javascript'); } $Logs = array(); // Verify the appropriate users. $UserIDs = $this->Form->GetFormValue('UserID', array()); if (!is_array($UserIDs)) { $UserIDs = array(); } foreach ($UserIDs as $UserID) { Gdn::UserModel()->SetField($UserID, 'Verified', TRUE); $Logs = array_merge($Logs, $this->LogModel->GetWhere(array('Operation' => 'Spam', 'RecordUserID' => $UserID))); } // Grab the logs. $Logs = array_merge($Logs, $this->LogModel->GetIDs($LogIDs)); // try { foreach ($Logs as $Log) { $this->LogModel->Restore($Log); } // } catch (Exception $Ex) { // $this->Form->AddError($Ex->getMessage()); // } $this->LogModel->Recalculate(); $this->SetData('Complete'); $this->SetData('Count', count($Logs)); $this->Render('Blank', 'Utility'); }
public function Restore($LogIDs) { $this->Permission('Garden.Moderation.Manage'); // Grab the logs. $Logs = $this->LogModel->GetIDs($LogIDs); foreach ($Logs as $Log) { $this->LogModel->Restore($Log); } $this->LogModel->Recalculate(); }