Guest User

Untitled

a guest
Sep 23rd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. <?php
  2.  
  3. require_once __DIR__.'/../../../../../../app/bootstrap.php.cache';
  4. require_once __DIR__.'/../../../../../../app/AppKernel.php';
  5.  
  6. use Symfony\Component\HttpFoundation\Request;
  7.  
  8. /**
  9. * This function must check the user session to be sure that he/she is
  10. * authorized to upload and access files in the File Browser.
  11. *
  12. * @return boolean
  13. */
  14. function CheckAuthentication()
  15. {
  16. $kernel = new AppKernel('prod', true);
  17. $kernel->loadClassCache();
  18. $request = Request::createFromGlobals();
  19. $request->request->set('_route', 'admin');
  20. $response = $kernel->handle($request);
  21. $container = $kernel->getContainer();
  22. return $container->get('security.context')->isGranted('ROLE_FILE_UPLOADER');
  23. }
Add Comment
Please, Sign In to add comment