src/Controller/MelisAuthController.php
public function loginAction()
    {
        $isChecked = false;
        $pathAppConfigForm = '/meliscore/forms/meliscore_login';

        $melisMelisCoreConfig = $this->serviceLocator->get('MelisCoreConfig');
        $appConfigForm = $melisMelisCoreConfig->getItem($pathAppConfigForm);

        $factory = new \Zend\Form\Factory();
        $loginForm = $factory->createForm($appConfigForm);
        $loginDataConfig = $melisMelisCoreConfig->getItem('meliscore_login/datas');

        // change to layout login
        $isRemembered = !empty($_COOKIE['remember']) ? (int) $_COOKIE['remember'] : 0;
        $user = '';
        $pass = '';
        if ($isRemembered == 1) {
            $user = $this->crypt($_COOKIE['cookie1'], 'decrypt');
            $loginForm->get('usr_login')->setValue($user);
            $loginForm->get('usr_password')->setValue($pass);
            $isChecked = true;

        }

        $view = new ViewModel();
        $view->setVariable('meliscore_login', $loginForm);
        $view->setVariable('login_logo', $loginDataConfig['login_logo']);
        $view->isChecked = $isChecked;

        return $view;
    }
public function loginAction()
    {
        $isChecked = false;
        $pathAppConfigForm = '/meliscore/forms/meliscore_login';

        $melisMelisCoreConfig = $this->serviceLocator->get('MelisCoreConfig');
        $appConfigForm = $melisMelisCoreConfig->getItem($pathAppConfigForm);

        $factory = new \Zend\Form\Factory();
        $loginForm = $factory->createForm($appConfigForm);
        $loginDataConfig = $melisMelisCoreConfig->getItem('meliscore_login/datas');

        // change to layout login
        $isRemembered = !empty($_COOKIE['remember']) ? (int) $_COOKIE['remember'] : 0;
        $user = '';
        $pass = '';
        if ($isRemembered == 1) {
            $user = $this->crypt($_COOKIE['cookie1'], 'decrypt');
            $loginForm->get('usr_login')->setValue($user);
            $loginForm->get('usr_password')->setValue($pass);
            $isChecked = true;

        }

        $view = new ViewModel();
        $view->setVariable('meliscore_login', $loginForm);
        $view->setVariable('login_logo', $loginDataConfig['login_logo']);
        $view->isChecked = $isChecked;

        return $view;
    }
public function loginAction ( ) { $ isChecked = false ; $ pathAppConfigForm = '/meliscore/forms/meliscore_login' ; $ melisMelisCoreConfig = $ this -> serviceLocator -> get ( 'MelisCoreConfig' ) ; $ appConfigForm = $ melisMelisCoreConfig -> getItem ( $ pathAppConfigForm ) ; $ factory = new \ Zend \ Form \ Factory ( ) ; $ loginForm = $ factory -> createForm ( $ appConfigForm ) ; $ loginDataConfig = $ melisMelisCoreConfig -> getItem ( 'meliscore_login/datas' ) ; // change to layout login $ isRemembered = ! empty ( $ _COOKIE [ 'remember' ] ) ? ( int ) $ _COOKIE [ 'remember' ] : 0 ; $ user = '' ; $ pass = '' ; if ( $ isRemembered == 1 ) { $ user = $ this -> crypt ( $ _COOKIE [ 'cookie1' ] , 'decrypt' ) ; $ loginForm -> get ( 'usr_login' ) -> setValue ( $ user ) ; $ loginForm -> get ( 'usr_password' ) -> setValue ( $ pass ) ; $ isChecked = true ; } $ view = new ViewModel ( ) ; $ view -> setVariable ( 'meliscore_login' , $ loginForm ) ; $ view -> setVariable ( 'login_logo' , $ loginDataConfig [ 'login_logo' ] ) ; $ view -> isChecked = $ isChecked ; return $ view ; }
Shows login form

@return \Zend\View\Model\ViewModel
Shows login form