LogController::notSpam PHP Method

notSpam() public method

public notSpam ( )
    public function notSpam()
    {
        if (!Gdn::request()->isAuthenticatedPostBack(true)) {
            throw new Exception('Requires POST', 405);
        }
        $this->permission(array('Garden.Moderation.Manage', 'Moderation.Spam.Manage'), false);
        $LogIDs = Gdn::request()->post('LogIDs');
        $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');
    }