Skip to content

Instantly share code, notes, and snippets.

@danbower
danbower / index.html
Last active Oct 18, 2015
HTML5 Starter Template
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Starter Template</title>
<link href="style.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
View gist:3dd39392f8b9ab15c0c1
public function manualLoginAction()
{
$user = $this->getDoctrine()->getRepository('UserBundle:User')->find(1);
$token = new UsernamePasswordToken($user, $user->getPassword(), 'admin_area', $user->getRoles());
$this->get('security.context')->setToken($token);
$request = $this->get('request');
$event = new InteractiveLoginEvent($request, $token);
$this->get("event_dispatcher")->dispatch('security.interactive_login', $event);