Overview

Namespaces

  • Mapbender
    • Component
      • HTTP
    • CoreBundle
      • Command
      • Component
        • Exception
      • Controller
      • DataFixtures
        • ORM
      • DependencyInjection
      • Element
        • Type
      • Entity
      • EventListener
      • Extension
      • Form
        • DataTransformer
        • EventListener
        • Type
      • Security
      • Template
    • DrupalIntegrationBundle
      • DependencyInjection
      • Security
        • Authentication
          • Provider
          • Token
        • Authorization
          • Voter
        • Factory
        • Firewall
        • User
      • Session
    • KmlBundle
      • Element
    • ManagerBundle
      • Controller
      • Form
        • DataTransformer
        • Type
    • MonitoringBundle
      • Command
      • Component
      • Controller
      • DependencyInjection
      • Entity
      • EventListener
      • Form
    • PrintBundle
      • Component
      • Controller
    • WmcBundle
      • Component
        • Exception
      • Element
        • Type
      • Entity
      • Form
        • EventListener
        • Type
    • WmsBundle
      • Component
        • Exception
      • Controller
      • DependencyInjection
      • Element
        • Type
      • Entity
      • Event
      • Form
        • EventListener
        • Type
    • WmtsBundle
      • Component
        • Exception
      • Controller
      • Entity
      • Form
        • Type
  • None
  • PHP

Classes

  • ApplicationController
  • GroupController
  • ProxyController
  • TranslationController
  • WelcomeController
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
  • Download
 1: <?php
 2: 
 3: /**
 4:  * TODO: License
 5:  */
 6: 
 7: namespace Mapbender\CoreBundle\Controller;
 8: 
 9: use Symfony\Bundle\FrameworkBundle\Controller\Controller;
10: use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
11: use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
12: use Symfony\Component\Security\Acl\Domain\ObjectIdentity;
13: 
14: /**
15:  * Welcome controller.
16:  *
17:  * This controller can be used to display an list of available applications.
18:  * It has been seperated in it's own class so it can easily be added or
19:  * removed from the routing.
20:  *
21:  * @author Christian Wygoda
22:  */
23: class WelcomeController extends Controller {
24:     /**
25:      * List applications.
26:      *
27:      * Lists all applications (TODO: available to the current user)
28:      *
29:      * @Route("/")
30:      * @Template()
31:      */
32:     public function listAction() {
33:         $securityContext = $this->get('security.context');
34:         $oid = new ObjectIdentity('class', 'Mapbender\CoreBundle\Entity\Application');
35: 
36:         $applications = $this->get('mapbender')->getApplicationEntities();
37:         $allowed_applications = array();
38:         foreach($applications as $application)
39:         {
40:             if($securityContext->isGranted('VIEW', $application))
41:             {
42:                 if(!$application->isPublished() && !$securityContext->isGranted('EDIT', $application)) {
43:                     continue;
44:                 }
45:                 $allowed_applications[] = $application;
46:             }
47:         }
48: 
49:         return array('applications' => $allowed_applications);
50:     }
51: }
52: 
53: 
Mapbender3 API documenation API documentation generated by ApiGen 2.8.0