@@ -9,25 +9,25 @@ |
||
| 9 | 9 | class LoginListener |
| 10 | 10 | { |
| 11 | 11 | |
| 12 | - private $securityContext; |
|
| 13 | - private $request; |
|
| 14 | - private $secret; |
|
| 12 | + private $securityContext; |
|
| 13 | + private $request; |
|
| 14 | + private $secret; |
|
| 15 | 15 | |
| 16 | - public function __construct(SecurityContext $securityContext, Request $request, $secret) { |
|
| 16 | + public function __construct(SecurityContext $securityContext, Request $request, $secret) { |
|
| 17 | 17 | $this->securityContext = $securityContext; |
| 18 | 18 | $this->request = $request; |
| 19 | 19 | $this->secret = $secret; |
| 20 | - } |
|
| 20 | + } |
|
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * Do the magic. |
|
| 24 | - * |
|
| 25 | - * @param InteractiveLoginEvent $event |
|
| 26 | - */ |
|
| 27 | - public function onSecurityInteractiveLogin(InteractiveLoginEvent $event) |
|
| 28 | - { |
|
| 22 | + /** |
|
| 23 | + * Do the magic. |
|
| 24 | + * |
|
| 25 | + * @param InteractiveLoginEvent $event |
|
| 26 | + */ |
|
| 27 | + public function onSecurityInteractiveLogin(InteractiveLoginEvent $event) |
|
| 28 | + { |
|
| 29 | 29 | if ($this->securityContext->isGranted('ROLE_ADMIN')) { |
| 30 | - setcookie ("can_edit", hash('sha256', 'can_edit'.$this->secret), 0, '/'); |
|
| 30 | + setcookie ("can_edit", hash('sha256', 'can_edit'.$this->secret), 0, '/'); |
|
| 31 | + } |
|
| 31 | 32 | } |
| 32 | - } |
|
| 33 | 33 | } |