/**
  * Sign in
  *
  * @return \Framework\Response\Response
  */
 public function signinAction()
 {
     if (ServiceContainer::get('security')->isAuthenticated()) {
         $redirect = new ResponseRedirect($this->generateRoute('home'));
         $redirect->send();
     }
     $errors = array();
     if ($this->getRequest()->isPost() == 'POST') {
         if ($user = User::findByEmail($this->getRequest()->post('email'))) {
             if ($user->user_password == md5($this->getRequest()->post('password'))) {
                 ServiceContainer::get('security')->setUser($user);
                 $returnUrl = ServiceContainer::get('session')->returnUrl;
                 unset(ServiceContainer::get('session')->returnUrl);
                 return $this->redirect(!is_null($returnUrl) ? $returnUrl : $this->generateRoute('performance_dashboard'), 'info', 'Welcome back to our site ' . $user->user_name);
             }
         }
         array_push($errors, 'Invalid username or password');
     }
     return $this->render('signin.html', array('errors' => $errors));
 }