Example #1
0
 protected function createAndPersistData()
 {
     for ($i = 1; $i <= self::ACCOUNTS_COUNT; $i++) {
         $account = new Account();
         $account->setActive(true);
         $account->setEmail(sprintf('*****@*****.**', $i));
         $account->setPassword('password');
         $this->manager->persist($account);
         $this->setReference(sprintf('account_%s', $i), $account);
     }
 }
Example #2
0
 /**
  * @Route("login")
  * @Route("/login")
  * @Route("/login/")
  * @Route("/login/{w}")
  */
 public function loginAction(Request $request, $w = null)
 {
     $account = new Account();
     $account->setUsername('vin');
     $account->setPassword('password');
     $form = $this->createForm(new LoginType(), $account, array('action' => "", 'method' => 'POST'));
     $form->handleRequest($request);
     if ($form->isValid()) {
         return $this->forward('AppBundle:Twitter:verifyLogin', array('getUsername' => $account->getUsername(), 'getPassword' => $account->getPassword()));
     }
     if (isset($w)) {
         return $this->render('twitter/login.html.twig', array('current_year' => date("Y"), 'login_form' => $form->createView(), 'msg' => "Wrong credentials. Please try again!"));
     } else {
         return $this->render('twitter/login.html.twig', array('current_year' => date("Y"), 'login_form' => $form->createView(), 'msg' => null));
     }
 }