Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once __DIR__.'/../../../../../../app/bootstrap.php.cache';
- require_once __DIR__.'/../../../../../../app/AppKernel.php';
- use Symfony\Component\HttpFoundation\Request;
- /**
- * This function must check the user session to be sure that he/she is
- * authorized to upload and access files in the File Browser.
- *
- * @return boolean
- */
- function CheckAuthentication()
- {
- $kernel = new AppKernel('prod', true);
- $kernel->loadClassCache();
- $request = Request::createFromGlobals();
- $request->request->set('_route', 'admin');
- $response = $kernel->handle($request);
- $container = $kernel->getContainer();
- return $container->get('security.context')->isGranted('ROLE_FILE_UPLOADER');
- }
Add Comment
Please, Sign In to add comment