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. *
  11. * @since 30/january/2011
  12. */
  13. require_once __DIR__.'/../inc/global.inc.php';
  14. api_protect_course_script(true);
  15. api_block_anonymous_users();
  16. //delete temporal file
  17. $fileToDelete = Session::read('temp_realpath_image');
  18. if (file_exists($fileToDelete)) {
  19. unlink($fileToDelete);
  20. }
  21. //Clean sessions and return to Chamilo file list
  22. Session::erase('paint_dir');
  23. Session::erase('paint_file');
  24. Session::erase('temp_realpath_image');
  25. $exit = Session::read('exit_pixlr');
  26. if (empty($exit)) {
  27. $location = api_get_path(WEB_CODE_PATH).'document/document.php?'.api_get_cidreq();
  28. echo '<script>window.parent.location.href="'.$location.'"</script>';
  29. api_not_allowed(true);
  30. } else {
  31. 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>';
  32. $location = api_get_path(WEB_CODE_PATH).'document/document.php?id='.Security::remove_XSS($exit).'&'.api_get_cidreq();
  33. echo '<script>window.parent.location.href="'.$location.'"</script>';
  34. Session::erase('exit_pixlr');
  35. }