vendor/kunstmaan/admin-bundle/Controller/SettingsController.php line 12

Open in your IDE?
  1. <?php
  2. namespace Kunstmaan\AdminBundle\Controller;
  3. use Symfony\Component\Routing\Annotation\Route;
  4. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  5. use Symfony\Component\Security\Core\Exception\AccessDeniedException;
  6. /**
  7.  * Main settings controller
  8.  */
  9. class SettingsController extends BaseSettingsController
  10. {
  11.     /**
  12.      * Index page for the settings
  13.      *
  14.      * @Route("/", name="KunstmaanAdminBundle_settings")
  15.      * @Template("@KunstmaanAdmin/Settings/index.html.twig")
  16.      *
  17.      * @throws AccessDeniedException
  18.      *
  19.      * @return array
  20.      */
  21.     public function indexAction()
  22.     {
  23.         $this->denyAccessUnlessGranted('ROLE_ADMIN');
  24.         return array();
  25.     }
  26.     /**
  27.      * Show bundles version update information
  28.      *
  29.      * @Route("/bundle-version", name="KunstmaanAdminBundle_settings_bundle_version")
  30.      * @Template("@KunstmaanAdmin/Settings/bundleVersion.html.twig")
  31.      *
  32.      * @throws AccessDeniedException
  33.      *
  34.      * @return array
  35.      */
  36.     public function bundleVersionAction()
  37.     {
  38.         $this->denyAccessUnlessGranted('ROLE_SUPER_ADMIN');
  39.         $versionChecker $this->container->get('kunstmaan_admin.versionchecker');
  40.         if (!$versionChecker->isEnabled()) {
  41.             return array('data' => null);
  42.         }
  43.         $data null;
  44.         try {
  45.             $data $versionChecker->check();
  46.         } catch (\Exception $e) {
  47.             $this->container->get('logger')->error(
  48.                 $e->getMessage(),
  49.                 array('exception' => $e)
  50.             );
  51.         }
  52.         return array(
  53.             'data' => $data,
  54.         );
  55.     }
  56. }