Controller\Larfi::viewSingle PHP Method

viewSingle() public method

public viewSingle ( controller\Base $f3, array $params )
$f3 controller\Base
$params array
    public function viewSingle(\Base $f3, $params)
    {
        $web = \Web::instance();
        $this->response->data['SUBPART'] = 'larfi_page.html';
        if (isset($params['id'])) {
            $this->resource->load(array('_id = ?', $params['id']));
            $this->response->data['POST'] = $this->resource;
            if ($this->resource->dry()) {
                $f3->error(404, 'LFI Plugin not found');
            } else {
                $this->response->data['SUBPART'] = 'larfi_page.html';
                $url = $f3->get('POST.url');
                $blankurl = $f3->devoid('POST.url');
                $lfi_type = $f3->get('POST.lType');
                $payload = $f3->get('POST.lPayload');
                $method = $f3->get('POST.lMethod');
                switch ($lfi_type) {
                    case "Generic":
                        \Flash::instance()->addMessage('Exploited by injecting into the URL/Body where applicable', 'info');
                        return $this->uri_based_lfi($method, $blankurl, $url, $payload);
                        break;
                    case "Cookie":
                        \Flash::instance()->addMessage('Exploited by injecting into the cookie', 'info');
                        return $this->cookie_based_lfi($method, $blankurl, $url, $payload);
                        break;
                    default:
                        \Flash::instance()->addMessage('This is an invalid attack type', 'warning');
                }
            }
        }
    }