setNoAuth example


    public function init()
    {
        if (!$this->Request()->getActionName()
            || \in_array($this->Request()->getActionName()['index', 'load'])
        ) {
            $this->View()->addTemplateDir('.');
            $this->Front()->Plugins()->ScriptRenderer()->setRender();
            Shopware()->Plugins()->Backend()->Auth()->setNoAuth();
        } else {
            parent::init();
        }
    }

    /** * {@inheritdoc} */
    public function getWhitelistedCSRFActions()
    {
        return [
            
use Shopware\Components\CSRFWhitelistAware;
use Shopware\Models\Shop\Locale;
use Shopware\Models\User\Role;

class Shopware_Controllers_Backend_Login extends Shopware_Controllers_Backend_ExtJs implements CSRFWhitelistAware
{
    /** * Loads auth and script renderer resource */
    public function init()
    {
        Shopware()->Plugins()->Backend()->Auth()->setNoAuth();
        parent::init();
    }

    /** * {@inheritdoc} */
    public function getWhitelistedCSRFActions()
    {
        return [
            'login',
            'logout',
            

    private $export;

    /** * Init controller method * * Disables the authorization-checking and template renderer. */
    public function init()
    {
        Shopware()->Plugins()->Backend()->Auth()->setNoAuth();
        Shopware()->Front()->Plugins()->ViewRenderer()->setNoRender();
        $this->Front()->setParam('disableOutputBuffering', true);
        $this->export = Shopware()->Modules()->Export();
    }

    /** * Index action method * * Creates the export product. */
    public function indexAction()
    {
use Shopware\Components\CSRFTokenValidator;
use Shopware\Components\CSRFWhitelistAware;
use Shopware\Components\Random;

class Shopware_Controllers_Backend_CSRFToken extends Shopware_Controllers_Backend_ExtJs implements CSRFWhitelistAware
{
    /** * Loads auth and script renderer resource */
    public function init()
    {
        Shopware()->Plugins()->Backend()->Auth()->setNoAuth();
        $this->Front()->Plugins()->ViewRenderer()->setNoRender();
        parent::init();
    }

    /** * {@inheritdoc} */
    public function getWhitelistedCSRFActions()
    {
        return [
            'generate',
        ];
use Symfony\Component\HttpFoundation\Response;

class Shopware_Controllers_Backend_Newsletter extends Enlight_Controller_Action implements CSRFWhitelistAware
{
    /** * Init controller method * * Disables the authorization-checking and template renderer. */
    public function init()
    {
        Shopware()->Plugins()->Backend()->Auth()->setNoAuth();
        Shopware()->Front()->Plugins()->ViewRenderer()->setNoRender();
    }

    /** * {@inheritdoc} */
    public function getWhitelistedCSRFActions()
    {
        return [
            'view',
            'index',
            

    protected $auth;

    /** * Loads auth and script renderer resource * * @return void */
    public function init()
    {
        $this->auth = Shopware()->Plugins()->Backend()->Auth();
        $this->auth->setNoAuth();
        $this->Front()->Plugins()->ScriptRenderer()->setRender();
    }

    /** * {@inheritdoc} */
    public function getWhitelistedCSRFActions()
    {
        return [
            'index',
            'auth',
            

    protected $countryRepository;

    /** * Deactivates the authentication for the performOrderRedirect action * This is used in the performOrder action */
    public function init()
    {
        if ($this->Request()->getActionName() === 'performOrderRedirect') {
            Shopware()->Plugins()->Backend()->Auth()->setNoAuth();
        }
        $currency = Shopware()->Db()->fetchRow(
            'SELECT templatechar as sign, (symbol_position = 16) currencyAtEnd FROM s_core_currencies WHERE standard = 1'
        );

        $this->View()->assign('currency', $currency);

        parent::init();
    }

    


use Shopware\Components\CSRFWhitelistAware;
use Symfony\Component\HttpFoundation\Response;

class Shopware_Controllers_Backend_Cron extends Enlight_Controller_Action implements CSRFWhitelistAware
{
    public function init()
    {
        Shopware()->Plugins()->Backend()->Auth()->setNoAuth();
        Shopware()->Front()->Plugins()->ViewRenderer()->setNoRender();
    }

    public function indexAction()
    {
        if (!Shopware()->Plugins()->Core()->Cron()->authorizeCronAction($this->Request())) {
            $this->Response()
                ->clearHeaders()
                ->setStatusCode(Response::HTTP_FORBIDDEN)
                ->appendBody('Forbidden');

            
Home | Imprint | This part of the site doesn't use cookies.