exit_pixlr.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. use ChamiloSession as Session;
  4. /**
  5. * This file allows creating new svg and png documents with an online editor.
  6. *
  7. * @package chamilo.document
  8. *
  9. * @author Juan Carlos Ra�a Trabado
  10. * @since 30/january/2011
  11. */
  12. require_once __DIR__.'/../inc/global.inc.php';
  13. api_protect_course_script(true);
  14. api_block_anonymous_users();
  15. //delete temporal file
  16. $fileToDelete = Session::read('temp_realpath_image');
  17. if (file_exists($fileToDelete)) {
  18. unlink($fileToDelete);
  19. }
  20. //Clean sessions and return to Chamilo file list
  21. Session::erase('paint_dir');
  22. Session::erase('paint_file');
  23. Session::erase('temp_realpath_image');
  24. $exit = Session::read('exit_pixlr');
  25. if (empty($exit)) {
  26. $location = api_get_path(WEB_CODE_PATH).'document/document.php?'.api_get_cidreq();
  27. echo '<script>window.parent.location.href="'.$location.'"</script>';
  28. api_not_allowed(true);
  29. } else {
  30. echo '<div align="center" style="padding-top:150; font-family:Arial, Helvetica, Sans-serif;font-size:25px;color:#aaa;font-weight:bold;">'.get_lang('PleaseStandBy').'</div>';
  31. $location = api_get_path(WEB_CODE_PATH).'document/document.php?id='.Security::remove_XSS($exit).'&'.api_get_cidreq();
  32. echo '<script>window.parent.location.href="'.$location.'"</script>';
  33. Session::erase('exit_pixlr');
  34. }