1: <?php
2:
3: namespace Mapbender\CoreBundle\Controller;
4:
5: use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6: use Symfony\Component\DependencyInjection\ContainerInterface;
7: use Symfony\Component\Security\Core\SecurityContext;
8: use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
9: use Symfony\Component\HttpKernel\Exception\HttpException;
10: use Symfony\Component\HttpFoundation\Response;
11: use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
12:
13: 14: 15: 16: 17:
18: class ProxyController extends Controller {
19: 20: 21: 22:
23: public function proxyAction() {
24: $session = $this->get("session");
25: if($session->get("proxyAllowed",false) !== true) {
26: throw new AccessDeniedHttpException('You are not allowd to use this'
27: . ' proxy without a session.');
28: }
29: session_write_close();
30:
31: return $this->get('mapbender.proxy')->proxy($this->getRequest());
32: }
33: }
34:
35: