LogController::confirm PHP Method

confirm() public method

Confirmation page.
Since: 2.0.?
public confirm ( )
    public function confirm()
    {
        if (!Gdn::request()->isAuthenticatedPostBack(true)) {
            throw new Exception('Requires POST', 405);
        }
        $this->permission(array('Garden.Moderation.Manage', 'Moderation.Spam.Manage', 'Moderation.ModerationQueue.Manage'), false);
        $Action = Gdn::request()->post('Action', false);
        $LogIDs = Gdn::request()->post('IDs', false);
        $this->Form->addHidden('LogIDs', $LogIDs);
        $this->Form->IDPrefix = 'Confirm_';
        if (trim($LogIDs)) {
            $LogIDArray = explode(',', $LogIDs);
        } else {
            $LogIDArray = array();
        }
        // We also want to collect the users from the log.
        $Logs = $this->LogModel->getIDs($LogIDArray);
        $Users = array();
        foreach ($Logs as $Log) {
            $UserID = $Log['RecordUserID'];
            if (!$UserID) {
                continue;
            }
            $Users[$UserID] = array('UserID' => $UserID);
        }
        Gdn::userModel()->joinUsers($Users, array('UserID'));
        $this->setData('Users', $Users);
        $this->setData('Action', $Action);
        $this->setData('ActionUrl', url('/log/' . $Action));
        $this->setData('ItemCount', count($LogIDArray));
        $this->render();
    }