|
|
|
@ -1,31 +1,28 @@ |
|
|
|
|
<?php |
|
|
|
|
/** |
|
|
|
|
* ContextListener.php |
|
|
|
|
* publisher |
|
|
|
|
* Date: 23.05.14 |
|
|
|
|
*/ |
|
|
|
|
/* For licensing terms, see /license.txt */ |
|
|
|
|
|
|
|
|
|
namespace Chamilo\ThemeBundle\EventListener; |
|
|
|
|
|
|
|
|
|
use Symfony\Component\DependencyInjection\ContainerAwareTrait; |
|
|
|
|
use Symfony\Component\HttpKernel\Event\FilterControllerEvent; |
|
|
|
|
use Symfony\Component\HttpKernel\Event\GetResponseEvent; |
|
|
|
|
use Symfony\Component\Security\Core\User\User; |
|
|
|
|
use Symfony\Component\Security\Core\User\UserInterface; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Class ContextListener |
|
|
|
|
* @package Chamilo\ThemeBundle\EventListener |
|
|
|
|
*/ |
|
|
|
|
class ContextListener |
|
|
|
|
{ |
|
|
|
|
protected $indicator = '^/admin'; |
|
|
|
|
protected $container = null; |
|
|
|
|
use ContainerAwareTrait; |
|
|
|
|
|
|
|
|
|
public function __construct($container) |
|
|
|
|
{ |
|
|
|
|
$this->container = $container; |
|
|
|
|
} |
|
|
|
|
protected $indicator = '^/admin'; |
|
|
|
|
|
|
|
|
|
public function onRequest(GetResponseEvent $event) |
|
|
|
|
{ |
|
|
|
|
$request = $event->getRequest(); |
|
|
|
|
$uri = $request->getPathInfo(); |
|
|
|
|
$uri = $request->getPathInfo(); |
|
|
|
|
if (!preg_match('!'.$this->indicator.'!', $uri)) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|