Renders the login template with the given parameters. Overwrite this function in
an extended controller to provide additional data for the login template.

@param array $data

@return \Symfony\Component\HttpFoundation\Response
559230
protected function renderLogin(array $data)
    {
        $response = new Response();
        $response->headers->add(array('X-Form-Type' => 'login'));

        return $this->render('FOSUserBundle:Security:login.html.twig', $data, $response);
    }
403967
final public function render($data = array())
    {
        $context = $this->getContext();
        $context->data       = array_merge($this->getData(), $data);
        $context->action     = 'render';
        $context->parameters = array();

        if ($this->invokeCommand('before.render', $context) !== false)
        {
            //Render the view
            $context->result = $this->_actionRender($context);
            $this->invokeCommand('after.render', $context);
        }

        return $context->result;
    }
64491
protected function create(array $data)
    {
        return User::create([
            'first_name' => $data['first_name'],
            'last_name' => $data['last_name'],
            'email' => $data['email'],
            'password' => Hash::make($data['password']),
        ]);
    }
631885
public function render($templateName = null, $data = [])
    {
        $this->setTemplate($templateName, $data);

        return json_encode($this->_data);
    }
695961
protected function execute(array $data) {
        // Auto-connect:
        if ($this->isConnected() === false) {
            $this->connect();
        }

        $this->lastRequestContent = $data;

        $dataAsString = json_encode($data);

        $options = $this->options;

        $options[CURLOPT_POSTFIELDS] = $dataAsString;

        if (isset($this->session)) {
            $options[CURLOPT_HTTPHEADER][] = 'X-RPC-Auth-Session: ' . $this->session;
        } elseif (array_key_exists(self::USERNAME, $this->config) &&
            is_string($this->config[self::USERNAME]) &&
            !empty($this->config[self::USERNAME]) &&
            array_key_exists(self::PASSWORD, $this->config) &&
            is_string($this->config[self::PASSWORD]) &&
            !empty($this->config[self::PASSWORD])) {
            $options[CURLOPT_HTTPHEADER][] = 'X-RPC-Auth-Username: ' . $this->config[self::USERNAME];
            $options[CURLOPT_HTTPHEADER][] = 'X-RPC-Auth-Password: ' . $this->config[self::PASSWORD];
        }

        curl_setopt_array($this->resource, $options);

        $responseString = curl_exec($this->resource);

        $this->lastInfo = curl_getinfo($this->resource);

        if ($responseString === false) {
            switch ($this->lastInfo['http_code']) {
                case 0:
                    $message = curl_error($this->resource);

                    if (strlen($message) === 0) {
                        $message = 'Connection to Web server failed';
                    }

                    throw new RuntimeException($message);
                default:
                    throw new RuntimeException(sprintf(
                        'Web server responded with HTTP status code "%s"',
                        $this->lastInfo['http_code']
                    ));
            }
        } elseif (!is_string($responseString)) {
            throw new RuntimeException('No content from Web server');
        }

        $headerLength = curl_getinfo($this->resource, CURLINFO_HEADER_SIZE);
        $this->lastResponseHeaders = substr($responseString, 0, $headerLength);

        $body = substr($responseString, $headerLength);

        $lastResponse = json_decode(trim($body), true);

        if (!is_array($lastResponse)) {
            if (is_string($body) && strlen($body) > 0) {
                throw new RuntimeException(sprintf(
                    'i-doit responded with an unknown message: %s',
                    $body
                ));
            } else {
                throw new RuntimeException('i-doit responded with an invalid JSON string.');
            }
        }

        $this->lastResponse = $lastResponse;

        return $this->lastResponse;
    }
1305379
protected function renderLogin(array $data)
    {
        //Backward compatibility with Fos User 1.3
        if(class_exists('FOS\UserBundle\FOSUserEvents')){
            /** @var $formFactory \FOS\UserBundle\Form\Factory\FactoryInterface */
            $formFactory = $this->container->get('fos_user.registration.form.factory');
            $form = $formFactory->createForm();
        }else{
            $form = $this->container->get('fos_user.registration.form');
        }
        $csrf_token_register = '';
        if(isset($form->createView()->children['_token'])){
            $csrf_token_register = $form->createView()->children['_token']->vars['value'];
        }
        $data['csrf_token_register'] = $csrf_token_register;
        
        return parent::renderLogin($data);
    }
1194774
public function login($data) {
        $response=CodeBank_ClientAPI::responseBase();
        
        $response['login']=true;
        
        //Try to login
        $member=MemberAuthenticator::authenticate(array(
                                                        'Email'=>$data->user,
                                                        'Password'=>$data->pass
                                                    ));
        
        if($member instanceof Member && $member->ID!=0 && Permission::check('CODE_BANK_ACCESS', 'any', $member)) {
            try {
                $member->logIn();
                
                $ipAgrement=CodeBankConfig::CurrentConfig()->IPAgreement;
                
                
                //Get preferences
                $prefs=new stdClass();
                $prefs->heartbeat=$member->UseHeartbeat;
                
                //Set the response to HELO
                $response['status']='HELO';
                $response['message']=_t('CodeBankAPI.WELCOME_USER', '_Welcome {user}', array('user'=>htmlentities($member->Name))); //Set the message to "Welcome ...."
                $response['data']=array(
                                        'id'=>Member::currentUserID(),
                                        'hasIPAgreement'=>!empty($ipAgrement),
                                        'preferences'=>$prefs,
                                        'isAdmin'=>(Permission::check('ADMIN')!==false),
                                        'displayName'=>(trim($member->Name)=='' ? $member->Email:trim($member->Name))
                                    );
            }catch (Exception $e) {
                //Something happend on the server
                $response['status']='EROR';
                $response['message']=_t('CodeBankAPI.SERVER_ERROR', '_Server error has occured, please try again later');
            }
        }else {
            //Bad username/pass combo
            $response['status']='EROR';
            $response['message']=_t('CodeBankAPI.INVALID_LOGIN', '_Invalid Login');
        }
        
        
        return $response;
    }
1280854
public function render($templates, array $data = array())
    {
        $templates = (array) $templates;

        foreach ($templates as $template) {
            if (!is_readable($template) || !is_file($template)) {
                throw new \Shade\Exception('Template file "'.$template.'" does not exists');
            }
            $content = str_replace(array_keys($data), $data, file_get_contents($template));
            $data[$this->layoutContentPlaceholder] = $content;
        }

        return $content;
    }
412735
protected function render($type, array $data = [])
    {
        $templateName = empty($data['title']) ? $type.'_notitle' : $type;
        $template = $this->templates[$templateName];

        if (is_callable($template)) {
            return $template($data);
        } else {
            $replace = array();

            foreach ($data as $key => $value) {
                $replace['{'.$key.'}'] = $key != 'html' ? $this->escapeHtml($value) : (string) $value;
            }

            return strtr($template, $replace);
        }
    }
667356
protected function render($template, $data = [])
    {
        $view = new View();
        $view->type(View::VIEW_TYPE_CELL);
        $view->set($data);
        $className = get_class($this);
        $namePrefix = '\View\Cell\\';
        $name = substr($className, strpos($className, $namePrefix) + strlen($namePrefix));
        $view->context(str_replace('\\', DIRECTORY_SEPARATOR, $name));
        return $view->render($template);
    }
204287
public function setLoginData(array $data)
    {
        $data = Helpers::parseLoginData($data);
        $this->getUser()->setLoginData($data[User::ID_LOGIN], $data[User::ID_ROLE], $data[User::ID_UNIT], $data[User::LOGOUT_DATE]);
    }
440104
public function render($name, $data = null)
  {
    $t = $this->template($name, $data);

    return $t->render();
  }
553714
public function render(array $data = array())
    {
        parent::render();

        if(!$this->_twig_template instanceof Twig_Template) {
            throw new RuntimeException(sprintf('The template cannot be rendered'));
        }

        //Render the template
        $content = $this->_twig_template->render($data);

        //Remove the template from the stack
        array_pop($this->_stack);

        return $content;
    }
967383
public function create(array $data)
    {
        if (array_key_exists('password', $data)) {
            $data['password'] = bcrypt($data['password']);
        }

        return parent::create($data);
    }
876269
protected function _loginUser($username, $data = array())
    {
        $data['username'] = $username;

        $parameter        = JFactory::getApplication()->isAdmin() ? 'admin_language' : 'language';
        $data['language'] = $this->getObject('user.provider')->load($username)->get($parameter);

        $options = $this->_options;

        JPluginHelper::importPlugin('user');
        $results = JFactory::getApplication()->triggerEvent('onUserLogin', array($data, $options));

        // The user is successfully logged in. Refresh the current user.
        if (in_array(false, $results, true) == false)
        {
            parent::_loginUser($username);
            return true;
        }

        return false;
    }
1000521
protected function create(array $data)
    {
        $fields = [
            'name'     => $data['name'],
            'email'    => $data['email'],
            'password' => bcrypt($data['password']),
        ];
        if (config('auth.providers.users.field', 'email') === 'username' && isset($data['username'])) {
            $fields['username'] = $data['username'];
        }
        return User::create($fields);
    }
929474
public function render($data = array(), $params = array())
    {
        if ($this->controller->getTemplate() !== null) {
            foreach ($this->controller->filters as $filter) {
                $this->twig->addFilter($filter);
            }
            $this->twig->addGlobal('params', $params);
            $key = "twig" . microtime(true);
//            Debugbar::timer($key, $this->controller->getTemplate());
            $template = $this->twig->load($this->controller->getTemplate());
            $data = $template->render($this->getData($data));
//            Debugbar::stopTimer($key);
        }
        return $data;
    }