@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | { |
16 | 16 | $builder |
17 | 17 | ->add('googleAuthenticatorSecret', 'text', |
18 | - array( |
|
18 | + array( |
|
19 | 19 | 'read_only' => true, |
20 | 20 | 'label' => "Authenticator Secret" |
21 | 21 | )) |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | } |
42 | 42 | $builder |
43 | 43 | ->add('enable', 'submit', |
44 | - array( |
|
44 | + array( |
|
45 | 45 | 'attr' => array('class' => 'btn btn-success'), |
46 | 46 | 'label' => 'Activate Two-Factor Authentication') |
47 | 47 | ); |
@@ -112,7 +112,7 @@ |
||
112 | 112 | * @return UserInterface |
113 | 113 | */ |
114 | 114 | public function createUser($username, $password, array $roles = array(), |
115 | - array $scopes = array()) |
|
115 | + array $scopes = array()) |
|
116 | 116 | { |
117 | 117 | $user = parent::createUser(); |
118 | 118 |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | * @return string |
82 | 82 | */ |
83 | 83 | public function getNextAvailableUsername($username, $maxIterations = 10, |
84 | - $default = null) |
|
84 | + $default = null) |
|
85 | 85 | { |
86 | 86 | $i = 0; |
87 | 87 | $testName = $username; |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | } |
103 | 103 | |
104 | 104 | public function findUserByUsernameOrEmail($username) { |
105 | - if (is_numeric($cpf = preg_replace('/[^0-9]/', '', $username)) && strlen($cpf) == 11) { |
|
105 | + if (is_numeric($cpf = preg_replace('/[^0-9]/', '', $username)) && strlen($cpf) == 11) { |
|
106 | 106 | $person = parent::findUserBy(array('cpf' => $cpf)); |
107 | 107 | if ($person !== null) { |
108 | 108 | return $person; |
@@ -14,7 +14,7 @@ |
||
14 | 14 | public function fragmentAction($name) |
15 | 15 | { |
16 | 16 | return $this->render('LoginCidadaoInfiniteScrollBundle:Default:index.html.twig', |
17 | - array('name' => $name)); |
|
17 | + array('name' => $name)); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $em->persist($broadcast); |
113 | 113 | $em->flush(); |
114 | 114 | $url = $this->generateUrl('lc_dev_broadcast_settings', |
115 | - array('broadcastId' => $broadcast->getId())); |
|
115 | + array('broadcastId' => $broadcast->getId())); |
|
116 | 116 | return $this->redirect($url); |
117 | 117 | } |
118 | 118 | |
@@ -138,23 +138,23 @@ discard block |
||
138 | 138 | |
139 | 139 | $form->handleRequest($request); |
140 | 140 | if ($form->isValid()) { |
141 | - $placeholders = $form->get('placeholders')->getData(); |
|
142 | - $broadcast->setHtmlTemplate($placeholders, $form->get('title')->getData(), $form->get('shortText')->getData()); |
|
141 | + $placeholders = $form->get('placeholders')->getData(); |
|
142 | + $broadcast->setHtmlTemplate($placeholders, $form->get('title')->getData(), $form->get('shortText')->getData()); |
|
143 | 143 | |
144 | - $translator = $this->get('translator'); |
|
145 | - if ($form->get('saveAndAdd')->isClicked()) { |
|
144 | + $translator = $this->get('translator'); |
|
145 | + if ($form->get('saveAndAdd')->isClicked()) { |
|
146 | 146 | $this->sendBroadcast($broadcast, $form->get('shortText')->getData(), $form->get('title')->getData()); |
147 | 147 | $broadcast->setSent(true); |
148 | 148 | $this->get('session')->getFlashBag()->add('success', $translator->trans("Broadcast sent")); |
149 | - } else { |
|
149 | + } else { |
|
150 | 150 | $this->get('session')->getFlashBag()->add('success', $translator->trans("Broadcast saved")); |
151 | - } |
|
151 | + } |
|
152 | 152 | |
153 | - $em = $this->getDoctrine()->getManager(); |
|
154 | - $em->persist($broadcast); |
|
155 | - $em->flush(); |
|
153 | + $em = $this->getDoctrine()->getManager(); |
|
154 | + $em->persist($broadcast); |
|
155 | + $em->flush(); |
|
156 | 156 | |
157 | - return $this->redirect($this->generateUrl('lc_dev_broadcasts')); |
|
157 | + return $this->redirect($this->generateUrl('lc_dev_broadcasts')); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | return array('form' => $form->createView()); |
@@ -165,18 +165,18 @@ discard block |
||
165 | 165 | $html = $broadcast->getHtmlTemplate(); |
166 | 166 | |
167 | 167 | foreach ($broadcast->getReceivers() as $person) { |
168 | - $notification = new Notification(); |
|
169 | - $notification->setIcon($broadcast->getCategory()->getDefaultIcon()); |
|
170 | - //$notification->setCallbackUrl("url"); |
|
171 | - $notification->setShortText($shortText); |
|
172 | - $notification->setTitle($title); |
|
173 | - $notification->setHtmlTemplate($html); |
|
174 | - $notification->setPerson($person); |
|
175 | - $notification->setSender($broadcast->getCategory()->getClient()); |
|
176 | - $notification->setCategory($broadcast->getCategory()); |
|
177 | - $notification->setMailTemplate($broadcast->getMailTemplate()); |
|
178 | - |
|
179 | - $helper->send($notification); |
|
168 | + $notification = new Notification(); |
|
169 | + $notification->setIcon($broadcast->getCategory()->getDefaultIcon()); |
|
170 | + //$notification->setCallbackUrl("url"); |
|
171 | + $notification->setShortText($shortText); |
|
172 | + $notification->setTitle($title); |
|
173 | + $notification->setHtmlTemplate($html); |
|
174 | + $notification->setPerson($person); |
|
175 | + $notification->setSender($broadcast->getCategory()->getClient()); |
|
176 | + $notification->setCategory($broadcast->getCategory()); |
|
177 | + $notification->setMailTemplate($broadcast->getMailTemplate()); |
|
178 | + |
|
179 | + $helper->send($notification); |
|
180 | 180 | } |
181 | 181 | } |
182 | 182 |
@@ -140,7 +140,7 @@ |
||
140 | 140 | } |
141 | 141 | |
142 | 142 | private function getNotificationGrid($offset = 0, $perIteration = 10, |
143 | - ClientInterface $client = null) |
|
143 | + ClientInterface $client = null) |
|
144 | 144 | { |
145 | 145 | $handler = $this->getAuthenticatedNotificationHandler(); |
146 | 146 | if ($client instanceof ClientInterface) { |
@@ -157,9 +157,9 @@ |
||
157 | 157 | // } |
158 | 158 | |
159 | 159 | public function setHtmlTemplate(ArrayCollection $placeholders, $title, $shortText) { |
160 | - $this->htmlTemplate = NotificationHandler::renderHtmlByCategory($this->getCategory(), $placeholders, $title, $shortText); |
|
161 | - $this->mailTemplate = NotificationHandler::renderHtmlByCategory($this->getCategory(), $placeholders, $title, $shortText); |
|
162 | - return $this; |
|
160 | + $this->htmlTemplate = NotificationHandler::renderHtmlByCategory($this->getCategory(), $placeholders, $title, $shortText); |
|
161 | + $this->mailTemplate = NotificationHandler::renderHtmlByCategory($this->getCategory(), $placeholders, $title, $shortText); |
|
162 | + return $this; |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | public function setMailTemplate($var) { |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | { |
12 | 12 | |
13 | 13 | public function findUnconfigured(PersonInterface $person, |
14 | - ClientInterface $client = null) |
|
14 | + ClientInterface $client = null) |
|
15 | 15 | { |
16 | 16 | $qb = $this->getEntityManager()->createQueryBuilder() |
17 | 17 | ->select('c') |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | ->innerJoin('LoginCidadaoCoreBundle:Authorization', 'a', |
20 | 20 | 'WITH', 'a.client = c.client AND a.person = :person') |
21 | 21 | ->leftJoin('LoginCidadaoNotificationBundle:PersonNotificationOption', |
22 | - 'o', 'WITH', 'o.category = c AND a.person = o.person') |
|
22 | + 'o', 'WITH', 'o.category = c AND a.person = o.person') |
|
23 | 23 | ->where('o is null') |
24 | 24 | ->setParameter('person', $person); |
25 | 25 |
@@ -19,7 +19,7 @@ |
||
19 | 19 | ->getRepository('LoginCidadaoNotificationBundle:FailedCallback') |
20 | 20 | ->createQueryBuilder('f') |
21 | 21 | ->join('LoginCidadaoNotificationBundle:Notification', 'n', |
22 | - 'WITH', 'f.notification = n') |
|
22 | + 'WITH', 'f.notification = n') |
|
23 | 23 | ->where('n.sender = :client') |
24 | 24 | ->setParameter('client', $client); |
25 | 25 | return $qb->getQuery()->getResult(); |