sCheckUser example

$activeShippingAddressId = $customerData['additional']['user']['default_shipping_address_id'] ?? null;

        if (!empty($customerData['shippingaddress']['country']['id'])) {
            $country = $this->get(CountryGatewayInterface::class)->getCountry($customerData['shippingaddress']['country']['id']$this->get(ContextServiceInterface::class)->getContext());
            $customerData['shippingaddress']['country'] = $this->get(LegacyStructConverter::class)->convertCountryStruct($country);
        }

        $this->View()->assign('activeBillingAddressId', $activeBillingAddressId);
        $this->View()->assign('activeShippingAddressId', $activeShippingAddressId);
        $this->View()->assign('sUserData', $customerData);
        $this->View()->assign('userInfo', $this->get('shopware_account.store_front_greeting_service')->fetch());
        $this->View()->assign('sUserLoggedIn', $this->admin->sCheckUser());
        $this->View()->assign('sAction', $this->request->getActionName());

        if ($this->isOneTimeAccount() && !\in_array($this->request->getActionName()['abort', 'login', 'register'])) {
            $this->logoutAction();
            $this->redirect(['controller' => 'register']);
        }
    }

    /** * @return void */
    
// destroy cookie             $this->front->Response()->setCookie('sUniqueID');
        }

        $this->session->offsetSet('sUserMail', $email);
        $this->session->offsetSet('sUserPasswordChangeDate', $getUser['password_change_date']);
        $this->session->offsetSet('sUserId', $userId);
        $this->session->offsetSet('sNotesQuantity', $this->moduleManager->Basket()->sCountNotes());

        $this->csrfTokenValidator->clearExistingCookie();

        if (!$this->sCheckUser()) {
            return;
        }

        if ($this->config->get('migrateCartAfterLogin')) {
            Shopware()->Container()->get('shopware.components.cart.cart_migration')->migrate();
        }
    }

    private function hasProductAttributeMatch(string $attribute, string $value, string $operator): bool
    {
        $crudService = Shopware()->Container()->get('shopware_attribute.crud_service');
        
'setAddress',
        ];
    }

    public function preDispatch()
    {
        $events = Shopware()->Container()->get('events');
        $events->addListener('Shopware_Modules_Admin_Payment_Fallback', [$this, 'flagPaymentBlocked']);

        $this->View()->setScope(Enlight_Template_Manager::SCOPE_PARENT);

        $this->View()->assign('sUserLoggedIn', $this->admin->sCheckUser());
        $this->View()->assign('sUserData', $this->getUserData());
    }

    /** * @deprecated in 5.6, will be protected in 5.8 * * Called if the sAdmin resets the selected customer payment to the shop preset * * @return void */
    public function flagPaymentBlocked()
    {

        Shopware()->Session()->set('sNotesQuantity', Shopware()->Modules()->Basket()->sCountNotes());
    }

    /** * @return void */
    public function indexAction()
    {
        $view = $this->View();
        $view->assign('sNotes', Shopware()->Modules()->Basket()->sGetNotes());
        $view->assign('sUserLoggedIn', Shopware()->Modules()->Admin()->sCheckUser());
        $view->assign('sOneTimeAccount', Shopware()->Session()->offsetGet('sOneTimeAccount'));
    }

    /** * @return void */
    public function deleteAction()
    {
        if (!empty($this->Request()->sDelete)) {
            Shopware()->Modules()->Basket()->sDeleteNote($this->Request()->sDelete);
        }

        

        $this->admin = Shopware()->Modules()->Admin();

        $session = $this->container->get('session');
        if ($session->get('sOneTimeAccount') && $this->Request()->has('sidebar')) {
            $this->admin->logout();
        }

        $this->addressRepository = $this->get(ModelManager::class)->getRepository(Address::class);
        $this->addressService = $this->get(AddressServiceInterface::class);

        $this->View()->assign('sUserLoggedIn', $this->admin->sCheckUser());

        if (!$this->View()->getAssign('sUserLoggedIn')) {
            $this->forward('index', 'register', 'frontend', $this->getForwardParameters());

            return;
        }

        $this->View()->assign('userInfo', $this->get('shopware_account.store_front_greeting_service')->fetch());
        $this->View()->assign('sUserData', $this->admin->sGetUserData());
        $this->View()->assign('sAction', $this->Request()->getActionName());
    }

    
use Shopware\Components\Random;

class Shopware_Controllers_Frontend_Newsletter extends Enlight_Controller_Action
{
    /** * Index action method */
    public function indexAction()
    {
        $this->View()->assign('voteConfirmed', $this->isConfirmed());
        $this->Request()->setParam('voteConfirmed', $this->View()->voteConfirmed);
        $this->View()->assign('sUserLoggedIn', Shopware()->Modules()->Admin()->sCheckUser());

        $this->front->setParam('voteConfirmed', $this->View()->voteConfirmed);
        $this->front->setParam('optinNow', (new DateTime())->format('Y-m-d H:i:s'));

        if ($this->Request()->get('sUnsubscribe') !== null) {
            $this->View()->assign('sUnsubscribe', true);
        } else {
            $this->View()->assign('sUnsubscribe', false);
        }

        $this->View()->assign('_POST', Shopware()->System()->_POST->toArray());

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