Beispiel #1
0
 /**
  * send password reset mail to user
  *
  * @param User $user
  * @return boolean
  */
 public function sendPasswordResetMail(User $user)
 {
     $body = $this->container->get('templating')->render('MainBundle:user:password_reset_mail.html.twig', ['user' => $user]);
     $message = \Swift_Message::newInstance()->setSubject('poppytag.com password reset')->setBody($body)->setFrom('*****@*****.**')->setTo($user->getEmail())->setContentType('text/html');
     $this->container->get('mailer')->send($message);
 }
 private function canAccess(Section $section, User $user)
 {
     return $user->getSection()->getCodeSection() === $section->getCodeSection() || $user->hasRole(User::ROLE_ADMIN);
 }