LogController::user PHP Method

user() public method

Searches the logs for edit, delete or ban operations on posts made by the user with the given user ID.
public user ( $recordUserID, string $Page = '' )
$recordUserID The user ID to search the logs for.
$Page string The page number.
    public function user($recordUserID, $Page = '')
    {
        if (!is_numeric($recordUserID)) {
            throw new Exception('Invalid ID');
        }
        $this->permission('Garden.Moderation.Manage');
        list($Offset, $Limit) = offsetLimit($Page, 10);
        $this->setData('Title', t('Change Log by User'));
        $Where = array('Operation' => array('Edit', 'Delete', 'Ban'), 'RecordUserID' => $recordUserID);
        $RecordCount = $this->LogModel->getCountWhere($Where);
        $this->setData('RecordCount', $RecordCount);
        if ($Offset >= $RecordCount) {
            $Offset = $RecordCount - $Limit;
        }
        $Log = $this->LogModel->getWhere($Where, 'LogID', 'Desc', $Offset, $Limit);
        $this->setData('Log', $Log);
        if ($this->deliveryType() == DELIVERY_TYPE_VIEW) {
            $this->View = 'Table';
        }
        Gdn_Theme::section('Moderation');
        $this->setHighlightRoute('dashboard/log/edits');
        $this->render('record');
    }