diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-09-16 20:08:07 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-09-16 20:08:07 +0200 |
commit | 4fc998245c56ad95c1e753ab52b0c702d4a8a59d (patch) | |
tree | 9381b2fc2a430855c3a3b4d681d9b77e0c14648a /src/Wallabag/ImportBundle/Controller/ImportController.php | |
parent | ac87e0db2ac5db90f1b0639a2d31c7098b4eaa20 (diff) | |
download | wallabag-4fc998245c56ad95c1e753ab52b0c702d4a8a59d.tar.gz wallabag-4fc998245c56ad95c1e753ab52b0c702d4a8a59d.tar.zst wallabag-4fc998245c56ad95c1e753ab52b0c702d4a8a59d.zip |
Only display message in queue for admin
Instead of for EVERYONE
Diffstat (limited to 'src/Wallabag/ImportBundle/Controller/ImportController.php')
-rw-r--r-- | src/Wallabag/ImportBundle/Controller/ImportController.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Wallabag/ImportBundle/Controller/ImportController.php b/src/Wallabag/ImportBundle/Controller/ImportController.php index d670746c..ea4f7d7b 100644 --- a/src/Wallabag/ImportBundle/Controller/ImportController.php +++ b/src/Wallabag/ImportBundle/Controller/ImportController.php | |||
@@ -19,12 +19,20 @@ class ImportController extends Controller | |||
19 | 19 | ||
20 | /** | 20 | /** |
21 | * Display how many messages are queue (both in Redis and RabbitMQ). | 21 | * Display how many messages are queue (both in Redis and RabbitMQ). |
22 | * Only for admins. | ||
22 | */ | 23 | */ |
23 | public function checkQueueAction() | 24 | public function checkQueueAction() |
24 | { | 25 | { |
25 | $nbRedisMessages = null; | 26 | $nbRedisMessages = null; |
26 | $nbRabbitMessages = null; | 27 | $nbRabbitMessages = null; |
27 | 28 | ||
29 | if (!$this->get('security.authorization_checker')->isGranted('ROLE_SUPER_ADMIN')) { | ||
30 | return $this->render('WallabagImportBundle:Import:check_queue.html.twig', [ | ||
31 | 'nbRedisMessages' => $nbRedisMessages, | ||
32 | 'nbRabbitMessages' => $nbRabbitMessages, | ||
33 | ]); | ||
34 | } | ||
35 | |||
28 | if ($this->get('craue_config')->get('import_with_rabbitmq')) { | 36 | if ($this->get('craue_config')->get('import_with_rabbitmq')) { |
29 | $nbRabbitMessages = $this->getTotalMessageInRabbitQueue('pocket') | 37 | $nbRabbitMessages = $this->getTotalMessageInRabbitQueue('pocket') |
30 | + $this->getTotalMessageInRabbitQueue('readability') | 38 | + $this->getTotalMessageInRabbitQueue('readability') |