@@ -21,31 +21,38 @@ |
||
21 | 21 | |
22 | 22 | foreach($config['content_types'] as $name=>$contentType) { |
23 | 23 | |
24 | - if(empty($contentType['title'])) |
|
25 | - throw new InvalidConfigurationException('Content type '.$name.' shoud have a title'); |
|
24 | + if(empty($contentType['title'])) { |
|
25 | + throw new InvalidConfigurationException('Content type '.$name.' shoud have a title'); |
|
26 | + } |
|
26 | 27 | |
27 | - if(empty($contentType['description'])) |
|
28 | - throw new InvalidConfigurationException('Content type '.$name.' shoud have a description'); |
|
28 | + if(empty($contentType['description'])) { |
|
29 | + throw new InvalidConfigurationException('Content type '.$name.' shoud have a description'); |
|
30 | + } |
|
29 | 31 | |
30 | - if(!isset($contentType['class']) || empty($contentType['class']) || !class_exists($contentType['class'])) |
|
31 | - throw new InvalidConfigurationException('CMS '.$contentType['class'].' can\'t be found'); |
|
32 | + if(!isset($contentType['class']) || empty($contentType['class']) || !class_exists($contentType['class'])) { |
|
33 | + throw new InvalidConfigurationException('CMS '.$contentType['class'].' can\'t be found'); |
|
34 | + } |
|
32 | 35 | |
33 | - if(empty($contentType['controller'])) |
|
34 | - throw new InvalidConfigurationException('CMS '.$contentType['controller'].' can\'t be found'); |
|
36 | + if(empty($contentType['controller'])) { |
|
37 | + throw new InvalidConfigurationException('CMS '.$contentType['controller'].' can\'t be found'); |
|
38 | + } |
|
35 | 39 | |
36 | 40 | $container->setParameter('cms.content_types', $config['content_types']); |
37 | 41 | } |
38 | 42 | |
39 | 43 | foreach($config['blocks'] as $name=>$contentType) { |
40 | 44 | |
41 | - if(empty($contentType['title'])) |
|
42 | - throw new InvalidConfigurationException('Block '.$name.' shoud have a title'); |
|
45 | + if(empty($contentType['title'])) { |
|
46 | + throw new InvalidConfigurationException('Block '.$name.' shoud have a title'); |
|
47 | + } |
|
43 | 48 | |
44 | - if( (!isset($contentType['class']) || empty($contentType['class'])) && class_exists($this->_blockDefaultClass) ) |
|
45 | - $config['blocks'][$name]['class'] = $this->_blockDefaultClass; |
|
49 | + if( (!isset($contentType['class']) || empty($contentType['class'])) && class_exists($this->_blockDefaultClass) ) { |
|
50 | + $config['blocks'][$name]['class'] = $this->_blockDefaultClass; |
|
51 | + } |
|
46 | 52 | |
47 | - if(isset($contentType['class']) && !class_exists($contentType['class'])) |
|
48 | - throw new InvalidConfigurationException('Block '.$contentType['class'].' can\'t be found'); |
|
53 | + if(isset($contentType['class']) && !class_exists($contentType['class'])) { |
|
54 | + throw new InvalidConfigurationException('Block '.$contentType['class'].' can\'t be found'); |
|
55 | + } |
|
49 | 56 | |
50 | 57 | $container->setParameter('cms.blocks', $config['blocks']); |
51 | 58 | } |
@@ -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 | } |